Skip to content

MCP Streamable HTTP: “Bad Request: Missing session ID” (400)

MCPtested on Python-SDK mcp 2.3.0, MCP 2026-07-28

Over Streamable HTTP, the MCP-Protocol-Version header decides which era of the protocol applies. Without it, the SDK treats the request like a client up to 2025-11-25: first initialize, then a session. It rejects a request without a session.

Symptom

curl -si http://worker1:8000/mcp \
  -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" \
  -H "Mcp-Method: server/discover" --data @discover.json
HTTP/1.1 400 Bad Request
date: Sat, 28 Nov 2026 12:32:40 GMT
server: uvicorn
content-type: application/json
mcp-session-id: d76d77a24b3545c9b49a60bff4547d24
content-length: 95

{"jsonrpc":"2.0","id":null,"error":{"code":-32600,"message":"Bad Request: Missing session ID"}}

The response even contains an mcp-session-id header – a clear sign that the server is working in the old mode with sessions.

Diagnosis

Compare the headers of your request with a working one. Exactly one line is missing here.

-H "MCP-Protocol-Version: 2026-07-28"

Causes

header missingMCP-Protocol-Version not set

Since 2026-07-28 there is no initialize and no session. Every request carries the version in the header and in _meta. Without the header, the SDK falls back to the old path.

new terminalShell variable with the headers is missing

In the course, the fixed headers live in the variable KOPF. In a new terminal it is empty – the request goes out without the version header.

Fix

Send the version header. With all required headers, the server answers 200 OK.
curl -si http://worker1:8000/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -H "MCP-Protocol-Version: 2026-07-28" \
  -H "Mcp-Method: server/discover" \
  --data @discover.json
HTTP/1.1 200 OK
date: Sat, 28 Nov 2026 12:31:54 GMT
server: uvicorn
content-length: 440
content-type: application/json

Don't: Copy the Mcp-Session-Id from the response and send it back. MCP 2026-07-28 has no sessions; you would only keep using the old path.

▶
Break it yourself and find it – free
MCPA hands-on, Day 8: Streamable HTTP with curl – headers, status codes, two eras on one endpoint and protection against DNS rebinding.
Go to day 8 →

FAQ

Why does the old path still exist?

The SDK keeps it for clients that only speak versions up to 2025-11-25, so old clients can still talk to new servers.

Which headers does a request in 2026-07-28 need at least?

Content-Type, Accept with application/json and text/event-stream, MCP-Protocol-Version and Mcp-Method; for tools/call also Mcp-Name.

Related error patterns

More