Repository navigation
feat(mcp)!: retire the legacy SSE transport; /sse serves Streamable HTTP - #111
Merged
Merged
Conversation
The SSE transport kept each session in one worker's memory, so with 4 workers 72% of POST /messages/ reached a worker without the session and got a 404. It was already failing for the clients still on it. - GET /sse (the SSE handshake) and /messages/ answer 410 with the /mcp URL and the Claude Code and mcp-remote commands to switch. - /sse serves Streamable HTTP with its own protected-resource metadata, so clients that saved the old URL and try Streamable HTTP there first (Claude.ai: 11.9k such attempts in 48 h) keep working unchanged. - A Streamable HTTP GET on /sse (MCP-Protocol-Version set) gets the same 405 /mcp gives. - The /chatgpt graft is generalised and reused for /sse. 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.
Why
The legacy SSE transport (
GET /sse+POST /messages/) keeps each session in one worker's memory. WithWEB_CONCURRENCY=4the follow-up POST usually lands on another worker:POST /messages/return 404, with more than 1,000 "Could not find session" lines every 1.5 h.Other hosted MCP servers already retired it: Sentry and Neon return 410, PostHog redirects
/sseto/mcp, and PlanetScale, Vercel, Linear, Stripe and Supabase don't serve it.What changes
GET /sse(legacy SSE handshake)/mcpURL plus the Claude Code andmcp-remotecommandsPOST /messages/POST /sse(Streamable HTTP)resource=/sse)GET /ssewithMCP-Protocol-Version/mcp(stateless, no server stream)/mcp,/chatgpt,//ssegets its own discovery document because MCP clients reject protected-resource metadata that names a different resource. The/chatgptgraft is generalised into_graft_streamable_endpointand reused for/sse.Who is affected (Railway HTTP logs, last 48 h)
/sse. They already try Streamable HTTP first, so they keep working with no change.https://mcp.zernio.com/mcp:--transport ssemcp-remote/Node setupspython-httpx2scriptundiciclients that also try Streamable HTTP keep working.Tests
tests/test_mcp_sse_retired.py:/messages/sse401 challenge and its metadatainitializeover/sseruffis clean.Changelog and docs (
docs/MCP.md,docs/HTTP_DEPLOYMENT.md) are updated.🤖 Generated with Claude Code