[BUG] Claude CLI incompatible with FastMCP Streamable HTTP transport - sends GET instead of POST
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude CLI fails to connect to FastMCP servers using Streamable HTTP transport. When attempting to connect via claude mcp add --transport sse, the CLI sends GET /mcp HTTP/1.1 to initiate the connection, but FastMCP's Streamable HTTP implementation requires POST /mcp with a JSON-RPC initialize method in the request body. This results in "400 Bad Request: Missing session ID" errors.The claude.ai web interface connects successfully to the same servers, confirming the issue is specific to the CLI implementation.
What Should Happen?
Claude CLI should send POST /mcp with a JSON-RPC initialize request body, matching the behavior of the claude.ai web interface:
{
"method": "initialize",
"params": {
"protocolVersion": "2025-11-25",
"capabilities": {},
"clientInfo": {"name": "Anthropic", "version": "1.0.0"}
},
"jsonrpc": "2.0",
"id": 0
}
The server should respond with 200 OK and create a session, allowing subsequent tool calls.
Error Messages/Logs
**Server response to Claude CLI:**
HTTP/1.1 400 Bad Request
{
"jsonrpc": "2.0",
"id": "server-error",
"error": {
"code": -32600,
"message": "Bad Request: Missing session ID"
}
}
**Request sent by Claude CLI (from tcpdump):**
GET /mcp HTTP/1.1
Accept: application/json, text/event-stream
Host: example.com
Authorization: Basic <redacted>
User-Agent: claude-code/2.1.72 (cli)
Accept-Encoding: gzip, deflate, br, zstd
**Successful request from claude.ai web interface:**
POST /mcp HTTP/1.1
Accept: application/json, text/event-stream
Content-Type: application/json
{"method":"initialize", ...}
Steps to Reproduce
- Set up a remote FastMCP server (v3.0.2) with SSE transport on any accessible host
- Configure Claude CLI to connect:
claude mcp add --transport sse \
--header "Authorization: Basic <credentials>" \
server-name https://example.com/mcp/endpoint
- Attempt to list servers:
claude mcp list
- Observe connection failure with "Failed to connect" error
- Check server logs showing "400 Bad Request: Missing session ID"
=== Comparison test: ===
- Same MCP servers connect successfully via claude.ai web interface
- Only Claude CLI fails to establish connection
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.72
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
Additional Information
Related upstream issues documenting similar problems:
- https://github.com/PrefectHQ/fastmcp/issues/3179 - Documents Claude Code establishing GET SSE connections
- https://github.com/geelen/mcp-remote/issues/113 - Same "Missing session ID" error with FastMCP Streamable HTTP
- https://github.com/anthropics/claude-code/issues/15523 - Similar session management issues with Figma MCP server
Root cause analysis:
The Claude CLI appears to implement the deprecated HTTP+SSE transport pattern (which used separate GET and POST endpoints), while FastMCP implements the modern Streamable HTTP transport (MCP spec 2025-03-26) which uses a single POST endpoint for initialization.
Impact:
This prevents Claude CLI users from connecting to any MCP servers built with FastMCP's Streamable HTTP transport, forcing them to use the web interface as a workaround or limiting developers to stdio-only local servers.
Workaround:
Use claude.ai web interface for remote MCP connections - it correctly implements Streamable HTTP transport and connects successfully.
Technical evidence:
Full packet capture via tcpdump confirms the CLI sends plain GET requests without JSON-RPC body, while the web interface correctly sends POST with initialize method. Available upon request if needed for debugging.
Willing to assist:
I am happy to provide additional diagnostic information, packet captures, server logs, or testing support to any Anthropic engineer working on resolving this issue. Please feel free to reach out if you need more details.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗