GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Validate SEP-2243 Mcp-Param headers in the modern server by Kehrlann · Pull Request #1286 · modelcontextprotocol/java-sdk

Conversation

@Kehrlann

@Kehrlann Kehrlann commented Oct 26, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Closes #1199

  • Tools can mark inputSchema arguments with x-mcp-header, so clients mirror them into Mcp-Param-{Name} headers. Servers MUST reject a request whose headers and body disagree, with 400 / -32020.
  • Since only tools/call use those header, they are not part of the McpRequestHandler interface, and rather are carried through the McpTransportContext.
  • The HTTP transport extracts and decodes Mcp-Param-* headers and puts them in the context. STDIO puts a marker "not mirrored" value instead.
  • Validation happens in ToolsFeature, where we have both the tool definition (including x-mcp-header annotations in the schema) and the values for the tool call.
  • McpHeaderDecoder and McpParamHeaders are public, so other HTTP transports can reuse them.
  • Mcp-Name now uses the same strict decoder.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@Kehrlann
Kehrlann added this pull request to stack #1287 October 26, 2026 17:26
@Kehrlann
Kehrlann requested a review from chemicL October 26, 2026 17:29
@Kehrlann
Kehrlann removed this pull request from stack #1287 October 31, 2026 15:23
@Kehrlann
Kehrlann changed the base branch from dgarnier/merge-mcp-transport-contexts to main October 31, 2026 15:24
@Kehrlann Kehrlann mentioned this pull request Oct 31, 2026
feat: validate SEP-2243 Mcp-Param headers in modern server #1202
Closed
6 of 9 tasks
@Kehrlann
Validate SEP-2243 Mcp-Param headers in the modern server
b4df33d
- Tools can mark inputSchema arguments with x-mcp-header, so clients
  mirror them into Mcp-Param-{Name} headers. Servers MUST reject a
  request whose headers and body disagree, with 400 / -32020.
- Since only tools/call use those header, they are not part of the
  McpRequestHandler interface, and rather are carried through the
  McpTransportContext.
- The HTTP transport extracts and decodes Mcp-Param-* headers and puts
  them in the context. STDIO puts a marker "not mirrored" value instead.
- Validation happens in ToolsFeature, where we have both the tool
  definition (including x-mcp-header annotations in the schema) and the
  values for the tool call.
- McpHeaderDecoder and McpParamHeaders are public, so other HTTP
  transports can reuse them.
- Mcp-Name now uses the same strict decoder.

Signed-off-by: Daniel Garnier-Moiroux <[email protected]>
@Kehrlann
Kehrlann force-pushed the dgarnier/x-mcp-header branch from da99f3e to b4df33d Compare November 2, 2026 08:36
@Kehrlann
Kehrlann merged commit b859714 into main Nov 2, 2026
25 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Kehrlann
Kehrlann deleted the dgarnier/x-mcp-header branch November 2, 2026 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@chemicL chemicL Awaiting requested review from chemicL

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Validate SEP-2243 Mcp-Param-{Name} headers in the modern server

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@Kehrlann
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.