Skip to content

Expose accurate MCP operation schemas across workers - #2532

Open
kylebernhardy wants to merge 7 commits into
mainfrom
codex/mcp-operation-schemas-878
Open

kylebernhardy wants to merge 7 commits into
mainfrom
codex/mcp-operation-schemas-878

Conversation

@kylebernhardy

@kylebernhardy kylebernhardy commented Sep 8, 2026

Copy link
Copy Markdown
Member

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

  1. This makes schema-backed tools the v5.3 default and requires existing explicitly allow-listed schema-less operations to also appear in 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.
  • End-to-end route (new integration coverage): the registered-operation integration test exercises a real two-worker registration through MCP tools/list, including the schema-less negative case. Both local invocation modes were blocked before Harper startup because this host lacks the required 127.0.0.2+ loopback aliases; CI must supply the executed end-to-end result.
  • npm run test:unit:main progressed 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.
  • Independent Claude review: LGTM with no open findings at 282586b3f770 after 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

@kylebernhardy kylebernhardy added this to the v5.3 milestone Sep 8, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@kylebernhardy

Copy link
Copy Markdown
Member Author

@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)

@kylebernhardy
kylebernhardy marked this pull request as ready for review September 9, 2026 14:26
@claude

claude Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Reviewed; no blockers found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

MCP: refactor operations tool registration so input schemas are introspectable/validatable JSON Schema

1 participant