Skip to content

feat(mcp)!: retire the legacy SSE transport; /sse serves Streamable HTTP - #111

Merged
Ooscaar merged 1 commit into
developfrom
feat/mcp-retire-sse
Nov 18, 2026
Merged

Ooscaar merged 1 commit into
developfrom
feat/mcp-retire-sse

Conversation

@Ooscaar

@Ooscaar Ooscaar commented Nov 18, 2026

Copy link
Copy Markdown
Member

Why

The legacy SSE transport (GET /sse + POST /messages/) keeps each session in one worker's memory. With WEB_CONCURRENCY=4 the follow-up POST usually lands on another worker:

  • In the Railway logs, 72% of POST /messages/ return 404, with more than 1,000 "Could not find session" lines every 1.5 h.
  • It also blocks running more than one replica.

Other hosted MCP servers already retired it: Sentry and Neon return 410, PostHog redirects /sse to /mcp, and PlanetScale, Vercel, Linear, Stripe and Supabase don't serve it.

What changes

Request Before After
GET /sse (legacy SSE handshake) SSE stream (that then mostly 404s) 410 with the /mcp URL plus the Claude Code and mcp-remote commands
POST /messages/ Mostly 404 410, same body
POST /sse (Streamable HTTP) 405, so the client falls back to SSE Served, with its own protected-resource metadata (resource = /sse)
GET /sse with MCP-Protocol-Version — 405, the same as /mcp (stateless, no server stream)
/mcp, /chatgpt, / unchanged unchanged

/sse gets its own discovery document because MCP clients reject protected-resource metadata that names a different resource. The /chatgpt graft is generalised into _graft_streamable_endpoint and reused for /sse.

Who is affected (Railway HTTP logs, last 48 h)

  • Claude.ai: 21k SSE connections from Anthropic IPs, plus 11.9k Streamable HTTP attempts at /sse. They already try Streamable HTTP first, so they keep working with no change.
  • About 30 other sources break and must switch to https://mcp.zernio.com/mcp:
    • about 21 Claude Code setups using --transport sse
    • 2–5 mcp-remote/Node setups
    • 1 python-httpx2 script
    • 1 browser tool
  • 3 undici clients that also try Streamable HTTP keep working.

Tests

  • New tests/test_mcp_sse_retired.py:
    • 410 on the SSE handshake and on /messages
    • 405 for a Streamable HTTP GET
    • the /sse 401 challenge and its metadata
    • an authenticated initialize over /sse
  • Full suite: 3259 passed, 14 skipped. ruff is clean.

Changelog and docs (docs/MCP.md, docs/HTTP_DEPLOYMENT.md) are updated.

🤖 Generated with Claude Code

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>
@Ooscaar
Ooscaar merged commit 11326ff into develop Nov 18, 2026
4 checks passed
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.

1 participant