Repository navigation
fix(mcp): server/discover pins no era — Claude Code probes, then initializes - #43
Merged
Merged
Conversation
…ializes Claude Code 2.1.308/2.1.310 probes with server/discover, reads the version list, then sends a legacy initialize (2025-11-25) on the same connection. The kernel pinned modern on the probe and refused that initialize with -32010, so every Claude Code connect failed from 2026-10-04. discover now answers (modern-shaped, version-exempt) without pinning; the first era-bearing message pins: initialize pins legacy, a request carrying the _meta protocol version pins modern. discover after initialize, a modern-marked request on legacy, and initialize after a real modern request all stay refused; ambiguous handshakes still pin nothing. Falsifier: the recorded two-line handshake replayed over stdio, red (-32010) against the unpatched kernel, green after. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CHANGELOG [Unreleased] -> Fixed conflict only: keep both entries (discover probe first, #42 store split second); no other text changed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What broke
Since 2026-10-04 Claude Code has failed every connection to the Torque MCP server with -32010. A pass-through stdio shim recorded the handshake from Claude Code 2.1.308 (desktop-bundled) and 2.1.310 (CLI):
server/discover(idserver-discover-probe-1, carrying the modern_meta).2026-07-28, 2025-11-25, 2025-06-18and pins the connection modern.initializewithprotocolVersion: 2025-11-25.Discover was already version-exempt because it is the request a client uses to learn which versions exist. Pinning an era on that request turned it into a choice the client never made.
The fix
server/discoverstill answers with a modern-shaped result and still needs no version, but it pins no era. The era is pinned by the first message that carries one:initializepins legacy._meta io.modelcontextprotocol/protocolVersionpins modern.The rest of "eras never mix" is unchanged, and the tests still assert each case:
server/discoverafterinitializeis refused.initializeafter a real modern request is refused (new test, replacing the old discover-then-initialize one).The refusal for an unpinned connection no longer names discover as a way to pin an era.
Tests
npm test: all 16 suites green (rpc 58/58).Wire trace: before and after
Before (installed 1.0.0, Claude Code 2.1.310):
After (this branch, same client, same one-turn
claude -p --strict-mcp-configcall):In its own
system/initevent, Claude Code reports{"name":"tq","status":"connected"}and lists themcp__tq__*tools.Not in this PR
🤖 Generated with Claude Code