Make the draft-spec scenarios internally consistent (fixes #311, #312, #315)#319
Merged
Merged
Conversation
…teless draft path The stateless (SEP-2575) request path now answers resources/list, resources/templates/list and resources/read — including the SEP-2164 -32602 + data.uri error for unknown URIs — and includes the SEP-2549 ttlMs/cacheScope hints on its cacheable list results, matching what the draft-spec scenarios exercise.
Fixes the class of issues where a strictly-conformant SDK rejects the harness's requests for reasons unrelated to the behaviour under test (#311, #312, #315). - add a shared stateless draft request helper (draft-client.ts) that puts the cross-cutting SEP-2243 headers (Mcp-Method, Mcp-Name, MCP-Protocol-Version, Accept) and SEP-2575 _meta (protocolVersion, clientInfo, clientCapabilities) on every request, with overrides for negative cases and the SHOULD-level retry on UnsupportedProtocolVersionError - migrate the draft scenarios onto it: the SEP-2322 helpers and server-stateless now send Mcp-Method/Mcp-Name (#312); the SEP-2243 server scenarios drop the legacy initialize handshake and carry _meta on every raw request (#311); caching and sep-2164-resource-not-found are stateless DRAFT-2026-v1 requests instead of an SDK 2025-11-25 session (#315) - add a draft self-conformance gate (draft-self-conformance.test.ts) that points the harness's own draft drivers at the existing client-testing judge scenarios (request-metadata, http-standard-headers) and requires zero failures or warnings - align the request-metadata mock's unsupported-version rejection with the draft schema (-32004) and teach the everything-client to recognize it - rewrite the SEP-2549/SEP-2164 negative example servers as stateless draft servers so they keep exercising the violation, not the transport
…view - rename draft-client.ts to stateless-client.ts and name the helpers by feature (sendStatelessRequest, buildStandardHeaders, buildRequestMeta, withRequestMeta, CONFORMANCE_CLIENT_INFO); 'draft' now only appears in DRAFT_PROTOCOL_VERSION, the one name that tracks the moving target - retry only genuine UnsupportedProtocolVersionError rejections (-32004, tolerating -32001/-32602) and only with recognized versions; record the retry on the response - parse text/event-stream responses incrementally and resolve on the matching event instead of blocking until the timeout - keep the MCP-Protocol-Version header and _meta protocolVersion in sync when the version is overridden via meta overrides - make server-stateless's sendRpc SSE-tolerant - emit explicit setup failures in the SEP-2243 server scenarios when the tools/list discovery fails instead of misleading per-case results - latch the worst status per check in the request-metadata judge so an early violation cannot be masked by a later conformant request - rename the gate to harness-traffic-conformance.test.ts and derive its driver list from the draft suite with documented per-judge exclusions (35 pairings) - everything-server: advertise resources in stateless server/discover and use -32004 for unsupported protocol version - add unit tests for the helper (retry guard, SSE handling, header/_meta version sync, default headers)
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.
Each draft scenario landed in its own PR and only set up the one requirement it tests, so a strictly-conformant SDK rejects the harness's own requests. This makes every draft scenario speak the same stateless wire format. Follows #317.
Commits
resources/*(incl. SEP-2164-32602+data.uri) and SEP-2549ttlMs/cacheScopehints._meta; migrates the draft scenarios onto it: SEP-2322 helpers andserver-statelessnow sendMcp-Method/Mcp-Name(server-stateless doesn't setmcp-methodetc. #312), the SEP-2243 server scenarios drop the legacy initialize handshake and carry_metaon every raw request (http-header-validation missing io.modelcontextprotocol/protocolVersion #311),cachingandsep-2164-resource-not-foundare statelessDRAFT-2026-v1requests instead of an SDK 2025-11-25 session (caching scenario should use DRAFT-2026-v1 #315).-32004for unsupported version; SEP-2549/2164 negative fixtures rewritten as stateless servers.stateless-client.ts,sendStatelessRequest,buildStandardHeaders; "draft" only remains inDRAFT_PROTOCOL_VERSION), SSE-tolerant parsing, louder setup failures, worst-status latching in the request-metadata judge,resourcesadvertised in statelessserver/discover.Verification
npm test: 20 files / 223 tests green (draft scenarios vs everything-server, negative suites, helper unit tests).http-standard-headersjudge → Mcp-Method/Mcp-Name SUCCESS for the SEP-2322 driver (failed before, server-stateless doesn't setmcp-methodetc. #312);request-metadatajudge → 7/7 SUCCESS for thecachingdriver (failed before, http-header-validation missing io.modelcontextprotocol/protocolVersion #311/caching scenario should use DRAFT-2026-v1 #315).Notes
cachingandsep-2164-resource-not-foundnow require SEP-2575 stateless support from the server under test (they are draft-only requirements).http-header-validation/http-custom-header-server-validationstay inpending(everything-server doesn't enforce SEP-2243 yet) but are now self-consistent and runnable via--suite draft.