chore: renumber draft error codes per modelcontextprotocol#2907#353
Merged
Conversation
The error-code allocation policy in modelcontextprotocol#2907 renumbers the draft-only codes: HeaderMismatch -32001 -> -32020, MissingRequiredClientCapability -32003 -> -32021, UnsupportedProtocolVersion -32004 -> -32022. This updates every reference in the suite (mocks, scenarios, fixtures, tests, traceability yaml) and re-syncs the vendored draft schema to that commit. src/seps/traceability.json is generated and intentionally left for the scheduled refresh workflow.
commit: |
pcarleton
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Renumbers the draft-revision error codes to match the allocation policy that landed in modelcontextprotocol/modelcontextprotocol#2907:
HeaderMismatch-32001-32020MissingRequiredClientCapability-32003-32021UnsupportedProtocolVersion-32004-32022Motivation and Context
modelcontextprotocol/modelcontextprotocol#2907 partitions the JSON-RPC server-error range (
-32000..-32019legacy/implementation-defined,-32020..-32099reserved for the MCP spec) and renumbers the draft-only codes accordingly. The conformance suite still pinned the pre-policy numbers, so a server returning the now-spec-mandated-32020/-32021/-32022would fail checks that expect the old values, and the suite's own mocks and fixtures would emit codes the new spec text reserves for legacy implementation use.What changed
npm run sync-schema -- f817239fre-vendorssrc/spec-types/draft.ts(the schema diff between the previous pin andf817239fis exactly the renumber plus the new allocation-policy doc comment).src/scenarios/server/http-standard-headers.tsalready importedHEADER_MISMATCHfrom the vendored types, so its assertion picks up the new value automatically.-32001/-32003/-32004reference across the stateless mock, the everything-server fixture, theserver-statelessand SEP-2243 server scenarios, therequest-metadataclient scenario, all affected tests, and thesep-2243.yaml/sep-2575.yamlrequirement rows is updated to the new code.-32022only (the previous-32004 || -32001tolerance for pre-dedicated-code servers is dropped — those numbers are now in the legacy sub-range and the paired mocks emit-32022).src/seps/traceability.jsonis generated; it still carries the old text and is left for the scheduled refresh workflow per AGENTS.md.How Has This Been Tested?
npm run check,npm run build,npm test— all green (293 tests).node dist/index.js client --command "npx tsx examples/clients/typescript/everything-client.ts" --suite draft: identical to pre-change baseline (request-metadata7/7 confirms the everything-client's-32022retry check works against the mock's new emission).Breaking Changes
For draft-revision servers under test: the suite now requires the post-#2907 codes. Servers still emitting the pre-policy
-32001/-32003/-32004values will fail the corresponding checks (or need anexpected-failuresentry) until they update — that's the intended outcome of the spec renumber. Dated 2025-x revisions are unaffected.Types of changes
Checklist
Additional context
server-statelesserror-code table) should be rebased on top of this; its remaining content is then purely the precedence questions #2907 did not settle (which code applies when a missing_metafield and a present header overlap, andHeaderMismatchvsUnsupportedProtocolVersionprecedence when both rules trigger).sep-2243.yamlfor the standard- vs custom-header error-code requirement is unchanged (renumber only).