-
Notifications
You must be signed in to change notification settings - Fork 46
Add JSON schema validation for MCP gateway configuration (--validate flag) #9839
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
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pkg/workflow/mcp_renderer.go
Outdated
| // This catches compiler bugs that generate invalid configurations | ||
| // Note: We need to clean up the indentation and substitute variables for validation | ||
| configForValidation := prepareConfigForValidation(generatedConfig) | ||
| if err := ValidateMCPGatewayConfig(configForValidation); err != nil { |
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 should only happen with --validate flag enabled
- Add SkipValidation flag to JSONMCPConfigOptions struct - Pass compiler's skipValidation flag through WorkflowData - Validation only runs when --validate flag is enabled - Embed MCP gateway schema in pkg/workflow/schemas/ - Update all engine implementations to pass SkipValidation flag - Update tests to skip validation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot merge main, format, lint, review code |
…-schema-configuration
- Merge main branch - Recompile all workflow files - Fix staticcheck QF1012: Use WriteString instead of fmt.Fprintf for simple strings Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot investigate the build failures and fix compiler so that the agentic workflows compile (fix the compiler) |
- Add nil checks for workflowData before accessing CompilerSkipValidation - Fix logic: skip validation when workflowData is nil OR flag is not set OR flag is true - Update TestCustomEngineRenderMCPConfig to match new output format - All MCP-related tests now pass Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Fixed the build failure. The issue was a nil pointer dereference when accessing Changes in commit 2f8199f:
Verification:
|
|
@copilot merge main, format, lint go |
…-schema-configuration
- Merge latest changes from main branch - Format all code with make fmt - Lint Go code with make lint (all checks pass) - Recompile all 121 workflow files Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
@copilot recompile workflows and report results if they all validate |
Add MCP Gateway Configuration JSON Schema Validation
This PR adds JSON schema validation for MCP gateway configurations before they are sent to the gateway script, ensuring the compiler generates correct configurations. Validation only runs when the
--validateflag is enabled.Plan
Key Changes
New file:
pkg/workflow/mcp_gateway_schema_validation.goValidateMCPGatewayConfig()functionUpdate:
pkg/workflow/mcp_renderer.goSkipValidationflag toJSONMCPConfigOptionsstructUpdate: All engines (copilot, claude, codex, custom)
SkipValidationflag through optionsskipValidationsettingUpdate:
pkg/workflow/compiler_types.goCompilerSkipValidationfield toWorkflowDatato pass flag from compiler to enginesBehavior
Testing
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.