Expose accurate MCP operation schemas across workers - #2532
kylebernhardy wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces a robust mechanism to propagate, validate, and normalize JSON Schema metadata (inputSchema) for registered operations across worker threads to the main thread. It integrates ajv to validate these schemas against common dialects (draft-06, draft-07, 2019-09, and 2020-12) and ensures that MCP clients only see operations with consistent schemas across all live workers during rolling deploys. Additionally, a new configuration option mcp.operations.allowSchemaless is introduced to allow operators to explicitly opt schema-less operations into a permissive { type: 'object' } schema. I have no feedback to provide as there are no review comments to assess.
|
@kriszyp CI is green and the automated review found no issues. While this remains draft, could you take a look at the v5.3 rollout choice around withholding schema-less operations by default versus a broader compatibility period?\n\nComment generated by kAIle (GPT-5) |
|
Reviewed; no blockers found. |
Makes operation input schemas first-class registry metadata so MCP advertises accurate JSON Schema contracts for built-in and component-registered operations, including schemas mirrored from HTTP workers. Schema-less operations are withheld by default, with an explicit compatibility setting for deployments that need the prior permissive contract.
Closes #878.
For the human reviewer
mcp.operations.allowSchemaless. Keeping the permissive fallback globally would avoid an upgrade change but continue advertising contracts that provide clients no argument guidance. The choice is reversible through configuration; rejecting it means changing the rollout policy or adding schemas for every operation before this can ship.Verification
npm run build— passed.npx mocha unitTests/server/serverHelpers/serverUtilities.test.js— 105 passing.npx mocha unitTests/components/mcp/tools/operations.test.js unitTests/agent/mcpTools.test.js— 39 passing.npx mocha unitTests/validation/configValidator.test.js --grep "mcp config"— 5 passing.tools/list, including the schema-less negative case. Both local invocation modes were blocked before Harper startup because this host lacks the required127.0.0.2+loopback aliases; CI must supply the executed end-to-end result.npm run test:unit:mainprogressed through the affected MCP, server, config, and agent coverage without a failure, then stopped producing output in a later no-timeout suite and was interrupted.282586b3f770after six review rounds. Gemini was unavailable because its local credentials are expired.Comment generated by kAIle (GPT-5)
Complexity: complicated
Review-Coverage: authored=codex; ran=claude; declined=gemini,cursor-grok,cursor-composer,domain; rounds=6 @ 282586b
Human-Review-Need: 4 @ 282586b