Repository navigation
A policy denial is not a request to prompt the user and try again - #90
Merged
Merged
Conversation
The 2026-07-28 revision partitioned the JSON-RPC server-error space. -32020..-32099 is "reserved for the MCP specification", which implementations "MUST NOT emit ... [any code] that is not defined by this specification", and -32000..-32019 is legacy, where "new codes MUST NOT be allocated". fold minted five codes in the middle of the reserved band and one in the legacy band, so the whole set had to move; the specification's own instruction is to allocate outside the reserved range entirely. Only the thousands digit changed, which keeps the migration mechanical: -32040 -> -31040, -32041 -> -31041, -32042 -> -31042, -32043 -> -31043, -32044 -> -31044, and -32002 -> -31045. -32042 is why this could not wait for a major version. The specification has already given that number a meaning — URL elicitation required — and the SDK fold links against acts on it: mcp/client.go matches CodeURLElicitationRequired, parses elicitations out of the error data, calls the client's elicitation handler, and retries the request. A fold policy denial arriving at such a client is therefore not read as a denial. Its user is prompted for an out-of-band interaction that does not exist, and the call fold refused is tried again. A deny-by-default gateway whose refusals become prompts and retries is not a cosmetic conformance gap. The middleware is unexported in the SDK today and one TODO away from not being, and no other language's SDK is bound by Go's export rules. -32002 was wrong more quietly. The revision defines it as "resource not found" and tells clients to keep honouring it from servers on older versions, so fold answering it for a task id no upstream owns read as a missing resource from a legacy server rather than as what it was. Minted error codes are frozen by the v1 contract and this breaks that freeze in a minor release. It is the same trade v1.9.0 took, for the same reason it wrote down: there are no users to protect yet, and taking the break now rather than after launch is the honest choice. README records it beside that precedent rather than leaving the contract looking unbroken. Nothing else about the errors moved — same messages, same data, same audit outcomes. Changelog entries for released versions keep the codes they shipped with, because they are describing what those releases did. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
1 task done
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.
Found by running
/spec-driftagainst2026-07-28— the first time it has been run. This is the top finding of that sweep; the rest are summarised at the bottom.The protocol reserved the range fold's codes were in
fold minted five codes in the middle of the reserved band (
-32040–-32044) and one in the legacy band (-32002). The specification's own instruction is to allocate outside the JSON-RPC reserved range entirely, so that is where they went. Only the thousands digit moved, which keeps the migration mechanical:-32040-31040-32041-31041-32042-31042-32043-31043-32044-31044-32002-31045-32042is why this could not wait for a major versionThe specification has already given that number a meaning — URL elicitation required — and the SDK fold links against acts on it. Verified in
[email protected]:mcp/shared.go:398—CodeURLElicitationRequired = -32042mcp/client.go:780— middleware matching that code, which parseserror.data.elicitations, invokes the client'sElicitationHandler, and retries the requestSo a fold policy denial reaching such a client is not surfaced as a denial. Its user is prompted for an out-of-band interaction that does not exist, and the call fold refused is tried again. A deny-by-default gateway whose refusals become prompts and retries is not a cosmetic conformance gap.
Contained today only by an accident of Go:
urlElicitationMiddlewareis unexported, with aTODO: Consider exporting thissitting next to it, and no other language's SDK is bound by Go's export rules.-32002was wrong more quietly — the revision defines it as "resource not found" and tells clients to keep honouring it from older servers, so an unowned task id read as a missing resource from a legacy server.This breaks the v1 contract, deliberately
Minted error codes are frozen by API stability. This changes them in a minor release.
It is the same trade v1.9.0 took and for the reason that release wrote down: there are no users to protect yet, and taking the break now rather than after launch is the honest choice. Confirmed with the maintainer before making it. README records the break beside that precedent rather than leaving the contract looking unbroken.
Nothing else about the errors moved — same messages, same
data(includingmissingScopes), same audit outcomes. Changelog entries for released versions keep the codes they shipped with, because they describe what those releases did; only the Unreleased section was updated, since it ships alongside this.Verification
go test -race ./...green; lint 0 issues; gofmt / vet / tidy cleanThe rest of the sweep — not in this PR
Recorded here so it is not lost; I would take them in this order:
inputResponsesandrequestStatewhen forwarding (router.go:329,:406,:545). The spec: clients MUST echorequestStateexactly. Stripping it makes the upstream re-prompt, spinning to the SDK's 10-retry ceiling — ten round trips and ten human prompts per call. Three lines.inputRequestsin a relayed result.docs/design-server-initiated.md§8 needs rewriting before that item is built._meta, so 1 and 2 are live rather than hypothetical — and the existing canary inlisten_test.golooks like it covers this and does not. A canary is needed.Mcp-Param-*headers are not forwarded, which the spec requires of intermediaries by name.ttlMsis discarded,extensionsunadvertised, two federated task methods the extension deleted, and the deprecation windows — none of whichdocs/roadmap.mdmentions.🤖 Generated with Claude Code