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 <4175913+pelikhan@users.noreply.github.com>
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 <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
| @@ -0,0 +1,6 @@ | |||
| --- | |||
| tools: | |||
There was a problem hiding this comment.
@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.
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 <4175913+pelikhan@users.noreply.github.com>
- 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 <4175913+pelikhan@users.noreply.github.com>
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 <4175913+pelikhan@users.noreply.github.com>
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.
🤖 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 <4175913+pelikhan@users.noreply.github.com>
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.