-
Notifications
You must be signed in to change notification settings - Fork 23
Refactor Tavily MCP configuration to shared workflow and add mcp-servers import support #1280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…erging - Created shared/tavily-mcp.md for reusable Tavily MCP configuration - Updated scout.md to use imports field instead of inline mcp-servers - Fixed bug in mergeTools where newline-separated JSON objects weren't being parsed correctly - Import functionality now properly handles multiple JSON objects from different imports Co-authored-by: pelikhan <[email protected]>
Added comprehensive tests to verify that imports work correctly with single and multiple imported files. Tests validate that MCP configurations are properly merged from imported files. Co-authored-by: pelikhan <[email protected]>
Co-authored-by: pelikhan <[email protected]>
| @@ -0,0 +1,6 @@ | |||
| --- | |||
| tools: | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot the compiler should support importing mcp-servers entries. move tavily under mcp-servers and add support in compiler to import mcp servers entries as well
🤖 Workflow run triggered by this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done! I've moved tavily under mcp-servers in the shared file and added full compiler support for importing mcp-servers entries.
Changes in commit 7892cf8:
- Updated
shared/tavily-mcp.mdto usemcp-serversinstead oftools - Added
mcp-serversto the included file schema - Implemented
extractMCPServersFromContent()andmergeMCPServers()functions - Updated the parser and compiler to merge imported
mcp-serverswith top-level ones - Added test case
TestCompileWorkflowWithMCPServersImportto validate the functionality
The scout workflow now correctly imports the Tavily MCP server from the shared file using mcp-servers, and the compiled lock file contains the proper HTTP MCP server configuration.
- Updated shared/tavily-mcp.md to use mcp-servers instead of tools - Added mcp-servers to included_file_schema.json - Added MergedMCPServers field to ImportsResult struct - Implemented extractMCPServersFromContent and mergeMCPServers functions - Updated ProcessImportsFromFrontmatterWithManifest to extract and merge mcp-servers - Updated compiler to merge imported mcp-servers with top-level mcp-servers - Added test for importing mcp-servers (TestCompileWorkflowWithMCPServersImport) Co-authored-by: pelikhan <[email protected]>
pelikhan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot update docs on imports to mention MCP servers
- Copied full MCP servers schema from main workflow to included file schema with $defs for stdio_mcp_tool and http_mcp_tool - Refactored mergeMCPServers to ensure clean map creation instead of modifying input - Updated documentation to mention MCP servers can be imported: - include-directives.md: Added frontmatter merging section for mcp-servers with example - packaging-imports.md: Added MCP server import examples and updated existing examples - All tests passing Co-authored-by: pelikhan <[email protected]>
Done! Updated documentation to mention MCP servers can be imported: include-directives.md:
packaging-imports.md:
Commit d413d04 |
|
@copilot merge main, recompile 🤖 Workflow run triggered by this comment |
…ly-mcp-configuration
- Merged latest changes from main branch - Recompiled all workflows to update lock files - All tests passing including import-related tests - Tavily MCP server still correctly configured in scout workflow Co-authored-by: pelikhan <[email protected]>
Done! Merged main branch and recompiled all workflows. Changes:
Commit 9f3a0b6 |
…ly-mcp-configuration
…ty and error handling - Simplified the parsing and validation of agent output in create_discussion.js and create_issue.js. - Enhanced error messages for better debugging. - Improved the handling of discussion categories and issue labels. - Added checks for empty titles and bodies, ensuring defaults are set appropriately. - Streamlined the creation process for discussions and issues, including better logging of created items. - Updated summary writing to include details of created discussions and issues.
|
@copilot
🤖 Workflow run triggered by this comment |
- Created pkg/workflow/imports.go with mergeTools and mergeMCPServers functions - Removed these functions from compiler.go for better code organization - Fixed linting issue: removed unnecessary nil check in mergeMCPServers (S1031) - All tests passing including import-related tests - Scout workflow still compiles correctly with Tavily MCP server Co-authored-by: pelikhan <[email protected]>
Done! Linting:
Code Organization:
Commit 1f8e0a5 |
Overview
Refactored the Tavily MCP server configuration from the scout workflow into a separate shared workflow file and updated scout to use the
importsfield. Added full compiler support for importingmcp-serversentries from shared workflows. This change improves code reusability and maintainability by allowing MCP server configurations to be shared across multiple workflows.Changes
1. Created Shared Tavily MCP Configuration
Created
.github/workflows/shared/tavily-mcp.mdcontaining the reusable Tavily MCP server configuration usingmcp-servers:2. Updated Scout Workflow
Modified
.github/workflows/scout.mdto import the shared configuration instead of defining it inline:3. Added Compiler Support for Importing MCP Servers
Schema Updates:
mcp-serversschema toincluded_file_schema.jsonwith proper$defsforstdio_mcp_toolandhttp_mcp_tool(copied from main workflow schema)Parser Updates (
pkg/parser/frontmatter.go):MergedMCPServersfield toImportsResultstructextractMCPServersFromContent()to extract MCP servers from imported filesProcessImportsFromFrontmatterWithManifest()to collect and merge MCP servers from importsCompiler Updates (
pkg/workflow/compiler.go):mergeMCPServers()to merge imported MCP servers with top-level ones using object maps4. Fixed Critical Bug in Import Merging
Discovered and fixed a bug in
pkg/workflow/compiler.gowhere themergeTools()function failed to parse tools from multiple imports. The function was attempting to parse concatenated newline-separated JSON objects as a single JSON object, which is invalid:{"tool1": {...}} {"tool2": {...}}The Fix: Modified
mergeTools()to:parser.MergeTools()This fix enables workflows to properly import and merge both tools and mcp-servers from multiple shared configuration files.
5. Updated Documentation
Include Directives Documentation:
tools:andmcp-servers:Packaging and Imports Guide:
imports:field6. Added Integration Tests
Added comprehensive tests in
pkg/workflow/imports_test.goto prevent regressions:TestCompileWorkflowWithImports- validates single import functionality for toolsTestCompileWorkflowWithMultipleImports- validates multiple tool imports merge correctlyTestCompileWorkflowWithMCPServersImport- validates MCP server imports work correctly7. Merged Main Branch
8. Code Organization and Linting
pkg/workflow/imports.goto consolidate import/merge related functionsmergeTools()andmergeMCPServers()fromcompiler.gotoimports.goVerification
Impact
This change enables reusable MCP server configurations across multiple workflows using the
mcp-serversfield in shared workflow files, improving maintainability and consistency. It also fixes a fundamental issue with the imports system that would have affected any workflow using multiple imports.Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.