Skip to content

fix(examples): support draft protocol in SDK-backed fixtures - #596

Open
aniket-r2Dev2 wants to merge 1 commit into
modelcontextprotocol:mainfrom
aniket-r2Dev2:fix/conformance-568-draft-protocol
Open

aniket-r2Dev2 wants to merge 1 commit into
modelcontextprotocol:mainfrom
aniket-r2Dev2:fix/conformance-568-draft-protocol

Conversation

@aniket-r2Dev2

Copy link
Copy Markdown

Fixes #568

Summary

The published v1 MCP TypeScript SDK correctly rejects the in-progress 2026-07-28 draft protocol version. Three conformance example servers relied on that transport, so they could not respond to draft server/discover and tools/list requests.

This PR extracts the existing pre-transport draft validation and discovery logic into a shared helper and reuses it in the example fixtures, while keeping their legacy SDK transport paths.

Changes

  • Introduce examples/servers/typescript/helpers/draft-protocol.ts for draft request classification, header/_meta checks, discovery, result envelopes and method-not-found responses.
  • Reuse the helper in everything-server.ts, replacing its duplicated draft preflight and discovery handler.
  • Enable draft server/discover and tools/list in the three negative fixtures: invalid-tool-names.ts, no-dns-rebinding-protection.ts and sep-2106-stripped-schema.ts.
  • Preserve intentionally invalid fixture behavior and route dated/session-era traffic to the existing SDK transport.
  • Add focused helper tests and draft-version integration regression cases for the three fixtures.

Validation

Locally verified:

  • Patch applied against matching upstream source and fork diff reviewed (7 files, 1 commit)
  • 11/11 isolated Node.js helper checks passed
  • 3/3 HTTP smoke tests passed with dependency stubs
  • Patch application and syntax checks passed

Not yet validated with the actual repository dependencies: container network access prevents cloning the complete repository and downloading npm packages. The smoke checks use stubs and do not establish an actual SDK integration pass.

  • npm ci
  • npm test -- examples/servers/typescript/helpers/draft-protocol.test.ts src/scenarios/server/negative.test.ts
  • npm run typecheck
  • npm run lint
  • npm run build
  • npm test

Opening as a draft until full CI checks are green and any integration failures are addressed.

AI assistance

AI assistance was used to prepare this change, analyze upstream code, draft tests, and check the patch. The GitHub diff and available isolated tests were inspected before publishing.

@aniket-r2Dev2
aniket-r2Dev2 marked this pull request as ready for review November 22, 2026 05:56

This branch has not been deployed

No deployments
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.

examples: SDK-transport servers cannot speak draft protocol versions — extract everything-server's pre-transport handling into a shared helper

1 participant