Fix wire-validation attribution bugs, extend schema erratum to 2025-06-18 - #421
Merged
Conversation
… 2025-06-18 Follow-ups from the #399 review: - Stateless mock: validate error replies with a placeholder id so the JSON-RPC-mandated id:null is not recorded as a harness violation, and skip inbound validation when express left the body unparsed (wrong or missing Content-Type) — both were false positives blamed on the wrong party. Same unparsed-body guard in the stateful mock. - Stateful mock: validate client traffic against the protocol version the client declares via MCP-Protocol-Version, falling back to 2025-03-26 when the header is absent (it only exists from 2025-06-18, whose spec says to assume 2025-03-26), instead of always using the run version. - sdk-client: validate batches once as a whole array instead of also per element, which double-recorded every violation. - Make specVersion required on connectToServer/connectStateful/ createServerStateful; add isSpecVersion to types.ts. - Extend the NumberSchema erratum to 2025-06-18 (same generator bug on minimum/maximum, modelcontextprotocol#3139) and add a tripwire test that forces erratum deletion once the schemas are re-vendored. - Document the wire-schema-valid / wire-schema-harness-error check IDs in the README.
commit: |
pcarleton
added a commit
that referenced
this pull request
Jul 27, 2026
pcarleton
added a commit
that referenced
this pull request
Jul 27, 2026
…ation Reuses the canonical spec-version list from #421 instead of keeping a separate copy; SPEC_VERSION_TIMELINE is now exported so the validation message can enumerate the valid keys.
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.
Follow-ups from the #399 review (deferred there to keep the merge unblocked):
Attribution false positives fixed
id: nullerror replies no longer record a spuriouswire-schema-harness-error(validated with a placeholder id, mirroringwithNullIdCarveOut).undefined.MCP-Protocol-Version(falling back to 2025-03-26 when absent, per the 2025-06-18 spec) instead of the CLI-resolved run version, so clients that legitimately negotiate a different version (README permits this) are not false-flagged.Hardening
specVersionis now required onconnectToServer/connectStateful/createServerStateful— omitting it silently validated againstLATEST_SPEC_VERSION.isSpecVersionguard intypes.tsreplaces an inline version-list copy.Erratum
minimum/maximum(spec fix: modelcontextprotocol#3139, also extended).Docs
wire-schema-validandwire-schema-harness-errorcheck IDs, including that harness errors indicate suite bugs and that scenarios with no instrumented traffic (Wire-schema validation does not see raw-HTTP / inline-mock scenario traffic #418) emit neither check.474/474 tests (+12 new covering each fixed behavior and the no-header fallback); verified at the CLI that an id-less client message is flagged as an implementation violation with no harness-error check emitted.