Skip to content

Add HeaderMismatchError to schema and reserve -32000..-32099 for MCP#2642

Closed
pja-ant wants to merge 2 commits into
mainfrom
error-code-reservation
Closed

Add HeaderMismatchError to schema and reserve -32000..-32099 for MCP#2642
pja-ant wants to merge 2 commits into
mainfrom
error-code-reservation

Conversation

@pja-ant

@pja-ant pja-ant commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Motivation and Context

The -32001 HeaderMismatch error code from SEP-2243 was defined only in transport prose, not in the schema. This adds it as a proper schema type alongside the other error interfaces.

This also adds normative language to the Error Responses section reserving -32000 to -32099 for MCP-defined errors. JSON-RPC designates this range as "implementation-defined server errors"; MCP claims it so that SDKs and applications don't allocate codes that later collide with protocol-defined ones.

How Has This Been Tested?

npm run prep passes (schema validation, example validation, link check, formatting).

Breaking Changes

None to the wire protocol. Implementations that have already allocated custom codes in -32000..-32099 would be non-conforming under the new MUST NOT, but that was always the intent of this range.

Types of changes

  • Documentation update
  • Protocol schema addition (non-breaking — new error type)

Checklist

  • I have read the MCP Documentation
  • My changes follow MCP's coding/style guidelines
  • I have regenerated the schema (npm run generate:schema)
  • npm run prep passes

pja-ant added 2 commits April 23, 2026 21:40
Declares the -32001 HeaderMismatch error (previously only in transport
prose) as a schema type with constant and example, and adds normative
language to the Error Responses section reserving the -32000..-32099
range for MCP-defined errors so implementations don't allocate
conflicting codes.
@mintlify

mintlify Bot commented Apr 23, 2026

Copy link
Copy Markdown

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
mcp-staging 🟢 Ready View Preview Apr 23, 2026, 8:57 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@pja-ant
pja-ant marked this pull request as ready for review April 23, 2026 20:59
@pja-ant
pja-ant requested a review from a team as a code owner April 23, 2026 20:59
SamMorrowDrums added a commit to SamMorrowDrums/modelcontextprotocol that referenced this pull request Jun 1, 2026
Per WG feedback (Kurtis), revert the bare-header-tolerated design and
restore strict byte-equality between _meta and the corresponding HTTP
header on both request (Accept-Language) and response (Content-Language)
sides, with header absence on requests tolerated for CDN compatibility.

Use error code -32005 for HeaderMismatch instead of -32001, which is
already in conflicting use across SDKs (REQUEST_TIMEOUT in Python and
Kotlin vs HeaderMismatch in Go and C#); the code is provisional pending
SEP-2243 / SEP-2678 / PR modelcontextprotocol#2642 schema-level reservation work.

Add a Normalization footgun section covering Fastly, Varnish, CloudFront
and reverse-proxy header rewriting; consolidate operator-config detail
in that section so Security and Backward Compatibility just link to it.

Co-authored-by: Copilot <[email protected]>
@localden localden added the rc-high-priority Related to an upcoming specification release and needs to be addressed with a high priority. label Jun 24, 2026
@localden

Copy link
Copy Markdown
Contributor

Confirmed with @pja-ant that this is something that is covered in @felixweinberger's earlier PR.

@localden localden closed this Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

rc-high-priority Related to an upcoming specification release and needs to be addressed with a high priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants