Map a JSON-RPC response to the HTTP status the Streamable HTTP transport must
surface. Successful results and ordinary application errors ride on 200.
The draft reserves specific statuses so intermediaries — and clients probing
modern-vs-legacy servers — can act without parsing the body:
- UnsupportedProtocolVersionError (-32004) -> 400 (all modern versions),
- HeaderMismatch (-32001) -> 400,
- MissingRequiredClientCapability (-32003) -> 400 (all modern versions),
- Method not found (-32601) -> 404 on draft requests, which lets a client
tell a modern MCP endpoint apart from a legacy HTTP+SSE 404. Pre-draft
versions keep the legacy JSON-RPC-error-over-200 shape.
Map a JSON-RPC response to the HTTP status the Streamable HTTP transport must surface. Successful results and ordinary application errors ride on 200. The draft reserves specific statuses so intermediaries — and clients probing modern-vs-legacy servers — can act without parsing the body: - UnsupportedProtocolVersionError (-32004) -> 400 (all modern versions), - HeaderMismatch (-32001) -> 400, - MissingRequiredClientCapability (-32003) -> 400 (all modern versions), - Method not found (-32601) -> 404 on draft requests, which lets a client tell a modern MCP endpoint apart from a legacy HTTP+SSE 404. Pre-draft versions keep the legacy JSON-RPC-error-over-200 shape.