fix: correct server-stateless error-code expectations against the draft spec#336
Draft
felixweinberger wants to merge 1 commit into
Draft
fix: correct server-stateless error-code expectations against the draft spec#336felixweinberger wants to merge 1 commit into
felixweinberger wants to merge 1 commit into
Conversation
…ft spec - missing _meta / missing protocolVersion: expect -32001 HeaderMismatch instead of -32602 (the transports spec routes header-mirror failures, including a missing body counterpart, to -32001 with HTTP 400); clientInfo/clientCapabilities cells stay -32602 - a body carrying an unimplemented protocolVersion now expects UnsupportedProtocolVersionError (-32004 with data.supported/requested) per the versioning spec; re-tagged as sep-2575-http-server-unsupported-version-400-body - sep-2575-http-server-header-mismatch-400 becomes a real mismatch probe between two implemented per-request-metadata versions and reports SKIPPED while only one such version exists - mock server and everything-server fixture updated to the same precedence; the fixture also returned -32602 with HTTP 200 and applied draft validation to 2025-era traffic, both fixed
commit: |
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.
Three checks in
server-statelessexpect error codes the draft spec contradicts, so a spec-correct server can't pass the scenario. This fixes the expectations to match the spec text, updates the mock server and the everything-server fixture to the same behavior, and tightens the header-mismatch probe so it actually tests what its requirement sentence says.Motivation and Context
1+2. Missing
_meta/ missing_meta.protocolVersionexpected-32602, spec says-32001.The probes send a valid
MCP-Protocol-Versionheader with a body that has no value to mirror it. That's a header validation failure, not generic invalid params. The transports spec is explicit (streamable-http, error codes):and the validation failure conditions include "A header value does not match the corresponding request body value" — a body with no value can't match.
clientInfo/clientCapabilitieshave no corresponding header, so those two cells correctly stay-32602.3. A body carrying
protocolVersion: 'v999.0.0'expected-32001, spec says-32004.The probe's requested version isn't implemented by anyone, and versioning is unambiguous about that case:
UnsupportedProtocolVersionErroris-32004withdata: { supported, requested }(see the schema type). Expecting a bare-32001here also denies the client thesupportedlist it needs to renegotiate. The check is re-taggedsep-2575-http-server-unsupported-version-400-bodysince it exercises the unsupported-version requirement (body channel), not the mismatch requirement.The mismatch requirement keeps a real probe.
sep-2575-http-server-header-mismatch-400now sends two different implemented per-request-metadata versions on header vs body — the only construction where the mismatch rule applies without colliding with the unsupported-version rule. Exactly one such version exists today, so the check reports SKIPPED until a second one ships; before this change it was passing/failing on a probe that actually exercised a different requirement.Fixture fixes that fall out of this: the everything-server returned its
-32602with HTTP 200 (every rejection here must be 400), and applied draft per-request validation to 2025-era traffic — the spec notes header–body validation only applies to versions that require it. Both fixed, and the mock server now uses the same precedence (mirror-missing →-32001, other_metafields →-32602, unimplemented version on either channel →-32004, mismatch of two implemented versions →-32001).How Has This Been Tested?
data.supported/data.requestedshape.all-scenarios.test.ts) run against the updated fixture and pass; the dns-rebinding scenario surfaced the fixture's 200-on-error bug during this work (its "accepted" probe was previously matching an HTTP 200 error response).Breaking Changes
None for spec-correct servers. Servers that were passing these three cells by emitting the old codes will now fail them — that's the correction.
Types of changes
Checklist
Additional context
All spec links pin the schema/prose revision the suite's own
src/spec-types/SOURCEvendors (0168c57f), so the cited text is exactly what the runner's types are generated from.src/seps/sep-2575.yamlgains the-bodycheck id under the unsupported-version requirement; the requirement sentences themselves are unchanged.