Repository navigation
fix(mcp): serve legacy MCP clients alongside 2026-07-28 - #357
Merged
Merged
Conversation
Codex CLI and other hosts still open with a legacy initialize, which the public /mcp endpoint rejected. Fanout is now dual-era, as the 2026-07-28 versioning rules allow: modern requests stay stateless, and an initialize for 2025-11-25 or 2025-06-18 gets a session, so the capabilities a legacy client declares (including MCP Apps) are known on later requests. Scope and tool rate checks no longer depend on modern-only headers: they read the bounded request body for legacy requests and reject batches, so a read-only token cannot reach dashboard writes over the legacy protocol. Legacy sessions expire after ten idle minutes, with eight per user and OAuth client. The 401 challenge names telemetry:read. Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ
…ader says The 2026-07-28 versioning rules select legacy semantics for any initialize. Routing read the header first, so an initialize carrying the modern header reached the stateless handler and failed. Decode the one message before routing; scope and rate checks follow the same split. Claude-Session: https://claude.ai/code/session_018HfyEXHyGD1utmKF4CQtyQ
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.
Codex CLI 0.163 and other hosts still open with a legacy
initialize. The public/mcpendpoint accepted only 2026-07-28, so default Codex failed with-32020: MCP-Protocol-Version header is required. Codex worked only behind its experimentalmcp_2026_07_28flag.The 2026-07-28 versioning rules allow a dual-era server. A request with modern per-request metadata is served statelessly, and an
initializeselects legacy semantics scoped to a session. Fanout now does both on/mcp.initializeasking for them negotiates to 2025-11-25.initializegoes to the legacy session handler. Modern headers or modern_metaselect the stateless handler.Mcp-MethodandMcp-Name, which only modern clients send. Accepting legacy clients as-is would have let atelemetry:readtoken reach dashboard writes and skip the rate limit. Both checks now read the bounded body unless the SDK has verified the modern headers against it. Batches are rejected. Dashboard handlers also enforcedashboard:managethemselves.io.modelcontextprotocol/ui, per the core rule to revert to core behavior. Legacy sessions use the capabilities declared ininitialize.scope="telemetry:read"./api/mcp: stays modern-only.Verification:
just checkpasses.initializecarrying a modern header was routed to the stateless handler; this is fixed in the second commit with a regression test. The second round approved.