Part 6 of 14 · 2 min read
What the example measured
The shutdown ladder, the SSE and status-code tables, the header-mismatch and idempotency results, and the transport comparison timings.
Read each table left to right: the situation on the left, what the example observed on the right.
One slow call, three ways. A 40-step job, cancelled partway through, behaves differently by transport:
| stdio | Streamable HTTP, 2026-07-28 | HTTP, 2025-11-25 | |
|---|---|---|---|
| Progress | notification lines on stdout, matched by the progress token | SSE events on this request's stream | SSE events, each with an event id |
| Cancel | notifications/cancelled |
close the stream | CancelledNotification (disconnecting is not cancelling) |
| Dropped connection | the pipe closes: restart the process | stream ends: send the request again | GET with Last-Event-ID: the server replays what you missed |
What to notice: the cancel signal is a message on two transports and a socket event on the third. That is why section 1's notifications/cancelled and section 4's closed-stream check are different mechanisms for the identical idea.
HTTP status codes in the pages checked:
| Situation | Status and body |
|---|---|
| notification accepted | 202, no body |
| missing or mismatched mirrored header | 400 and error -32020 |
| unsupported protocol version | 400 and an UnsupportedProtocolVersionError |
| unknown method | 404 and a JSON-RPC error -32601 |
bad Origin |
403 |
| GET or DELETE (old shapes) | 405 |
What to notice: two choices are not covered by the specification text: 406 for a missing Accept types list, and 200 with a JSON-RPC error for failures like an unknown tool (-32602). Both are marked as such in the code.
The header-mismatch and idempotency results, already walked through in sections 2 and 3:
| Experiment | Without the fix | With the fix |
|---|---|---|
Spoofed Mcp-Name header |
HTTP 200, 1 hold created | HTTP 400 (-32020), 0 holds created |
| Dropped connection, retried call | 2 attempts, 2 holds (duplicate) | 2 attempts, 1 hold (idempotency key) |
| Dropped connection, origin check | hostile page: hold created | hostile page: 403, no hold |
Transport cost, measured on this machine over loopback with a small call repeated 150 times: starting the stdio server took about 47 to 51 ms, against about 1.5 ms to connect to an already-running HTTP server. A call took about 0.4 ms on stdio against about 1.3 ms over HTTP. The request was 297 bytes on stdio against 470 bytes over HTTP, because every HTTP request carries headers. What to notice: on a real network, with TLS and a proxy, the gap changes, but the shape is the point. stdio is cheaper per call and costs a process; HTTP costs a little per call and costs nothing to start.