Repository navigation
test(mcp): pin the legacy-fallback contract Claude Code's v2 runtime relies on - #13
Merged
Merged
Conversation
…relies on ADR-0009 Phase 1 pre-flight (issue #12). Verified on the wire with MCP_SDK_GENERATION=v2 on Claude Code 2.1.226: the client spawns a throwaway server process, sends `server/discover`, treats our -32601 as "not modern", then connects the real process with the 2025-era `initialize` (protocolVersion 2025-11-25, capabilities elicitation + roots). Three tests pin what that fallback depends on: a clean method-not-found on the probe (no crash, no hang), an `initialize` reply carrying our own version whatever the client requests while still recording the elicitation capability, and `_meta` in params being ignored on tools/list and ping. Co-Authored-By: Claude Fable 5.1 <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.
Summary
ADR-0009 Phase 1 pre-flight (#12): verify
engram-mcp, which declares protocol2024-11-05, under Claude Code's v2 MCP runtime (spec 2026-07-28).Verified on the wire (Claude Code 2.1.226,
MCP_SDK_GENERATION=v2, every JSON-RPC request the client sent captured through ateewrapper):server/discoverwith 2026-07-28_meta.-32601 Method not found. Per the SDK docs, anything that is not definitive modern evidence is treated as a legacy server.initializewithprotocolVersion: 2025-11-25, capabilitieselicitation+roots, thennotifications/initialized,tools/list. Engram replies2024-11-05; the client accepts and lists all 39 tools.With
MCP_PROTOCOL_NEGOTIATION=legacythere is no probe; one process, same handshake.Not verified: the tool-call round trip inside a live session, because the local CLI's OAuth session is expired (
claude auth loginneeded). The handshake andtools/listare the parts that differ between runtimes;tools/callgoes through the same legacy codec once the era is chosen.Tests added (
tests/test_mcp_protocol.py)server/discover→ clean-32601, no crash, no hanginitializewith2025-11-25or2026-07-28→ reply carries our version; elicitation capability still recorded (ADR-0007 gate keeps its signal)_metain params ignored ontools/listandpingVerification
tests/test_mcp_protocol.pypasses on a scratch DB🤖 Generated with Claude Code