Skip to content

Fix wire-validation attribution bugs, extend schema erratum to 2025-06-18 - #421

Merged
pcarleton merged 1 commit into
mainfrom
paulc/wire-schema-followups
Jul 27, 2026
Merged

Fix wire-validation attribution bugs, extend schema erratum to 2025-06-18#421
pcarleton merged 1 commit into
mainfrom
paulc/wire-schema-followups

Conversation

@pcarleton

Copy link
Copy Markdown
Member

Follow-ups from the #399 review (deferred there to keep the merge unblocked):

Attribution false positives fixed

  • The stateless mock's JSON-RPC-mandated id: null error replies no longer record a spurious wire-schema-harness-error (validated with a placeholder id, mirroring withNullIdCarveOut).
  • An unparsed request body (wrong or missing Content-Type) is a transport fault, not a JSON-RPC message: both mocks now skip inbound validation for it instead of blaming the implementation for undefined.
  • The stateful mock validates client traffic against the version the client declares via 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.
  • Batches are validated once as a whole array; the per-element loop double-recorded every violation.

Hardening

  • specVersion is now required on connectToServer/connectStateful/createServerStateful — omitting it silently validated against LATEST_SPEC_VERSION.
  • New isSpecVersion guard in types.ts replaces an inline version-list copy.

Erratum

  • Extended to 2025-06-18, which has the same NumberSchema generator bug on minimum/maximum (spec fix: modelcontextprotocol#3139, also extended).
  • Added a tripwire test that fails the moment a re-vendor makes an erratum branch a no-op, forcing its deletion.

Docs

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.

… 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.
@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@modelcontextprotocol/conformance@421

commit: 6082106

@pcarleton
pcarleton merged commit 5cc567c into main Jul 27, 2026
8 checks passed
@pcarleton
pcarleton deleted the paulc/wire-schema-followups branch July 27, 2026 19:32
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant