Transports, Versioning and Backwards Compatibility
MCP has two standard transports, stdio and Streamable HTTP. Revision 2026-07-28 made both stateless: no handshake, no sessions, no resumable streams, and HTTP headers that mirror the body for intermediaries. Versions are dates, each request declares its version, and dual-era clients and servers bridge to the initialize-based 2025 revisions with well-defined fallback rules.
Key points
- 1
stdio: the host launches the server as a subprocess; one JSON-RPC message per line, no embedded newlines, UTF-8. stdout carries only MCP messages; stderr is for any logging and SHOULD NOT be read as an error signal. The server never writes requests and the client never writes responses. Shutdown: close stdin, wait, then force-terminate (SIGTERM then SIGKILL, or TerminateProcess on Windows). Restart a crashed server and retry in-flight requests.
- 2
Streamable HTTP: one MCP endpoint that accepts POST; every client message is its own POST with
Accept: application/json, text/event-stream. Requests are answered with a single JSON object or a request-scoped SSE stream (progress and log notifications, then the response). Accepted notifications get 202 with no body. SendX-Accel-Buffering: noon SSE so proxies do not buffer. - 3
Removed from Streamable HTTP in 2026-07-28: the GET stream,
Mcp-Session-Idsessions (and DELETE), server-sent requests, and resumability viaLast-Event-ID. A broken stream loses the request: re-issue it with a new ID. Closing the stream is the cancellation signal. Modern-only servers answer GET or DELETE with 405 and ignore session and Last-Event-ID headers. - 4
Request headers:
MCP-Protocol-Versionon every POST must match_metaprotocolVersion;Mcp-Methodon all requests;Mcp-Name(fromparams.nameorparams.uri) fortools/call,resources/readandprompts/get. Any mismatch, or a missing or malformed required header, gets 400 plus-32020HeaderMismatch. The body is the source of truth. - 5
x-mcp-headerin a tool'sinputSchemamirrors a primitive (string, integer or boolean; not number) argument intoMcp-Param-{Name}. It must be reachable only throughpropertieskeys. HTTP clients MUST support it and MUST drop just the invalid tool fromtools/list. Non-ASCII, control-character or padded values are sent as=?base64?...?=. - 6
Security: validate
Originon every connection (403 if present and invalid), bind local servers to 127.0.0.1, and authenticate connections; otherwise DNS rebinding lets websites drive local servers. Gateways that enforce policy on mirrored headers SHOULD reject requests whose version predates header validation. - 7
HTTP status map (2026-07-28): 202 accepted notification; 400 unsupported version (
-32022), missing capability (-32021), header mismatch (-32020) or missing required_meta(-32602); 403 bad Origin; 404 plus-32601for unknown methods; 405 for GET or DELETE. - 8
Versions are
YYYY-MM-DDstrings marking the last backwards-incompatible change: 2024-11-05 (HTTP+SSE), 2025-03-26 (Streamable HTTP, OAuth 2.1, batching added), 2025-06-18 (batching removed, structured output, elicitation,MCP-Protocol-Versionheader), 2025-11-25 (experimental tasks, URL elicitation, CIMD), and 2026-07-28 (stateless core, Current). Revisions are Draft, Current or Final. - 9
Negotiation: each request declares its version and the server accepts or rejects each one. If unsupported:
UnsupportedProtocolVersionError-32022withdata.supportedanddata.requested, and the client retries with a common version. Servers MUST implementserver/discover(supportedVersions, capabilities, instructions, serverInfo, ttlMs and cacheScope); clients MAY call it first. - 10
Era fallback: on stdio, probe with
server/discover. A DiscoverResult or a recognised modern error means modern; any other error or a timeout means legacy, so fall back toinitialize. On HTTP, inspect a 400 body: a modern error means correct and retry, while an empty or unrecognised body means fall back toinitialize, then to HTTP+SSE (GET expecting anendpointevent). Never key fallback to one code; cache the era per process or origin. - 11
Dual-era servers MAY serve both eras on one endpoint:
initializeselects legacy semantics scoped to the process or session, and modern_metais served statelessly. Modern-only servers should name their supported versions in any error toinitialize. A missingMCP-Protocol-Versionheader MAY be treated as 2025-03-26 if pre-2025-06-18 clients are supported; otherwise reject. - 12
Feature lifecycle (SEP-2596): Active, Deprecated, Removed. The minimum deprecation window is twelve months (ninety days for expedited security removal), counted from the revision that deprecates the feature. Deprecated in 2026-07-28: Roots, Sampling, Logging, Dynamic Client Registration (earliest removal in the first revision on or after 2027-07-28), plus HTTP+SSE and the
includeContextvalues. Earliest removal means eligible, not guaranteed. Extensions are negotiated inextensions; without support, fall back to core or reject.
Common traps
Any
print()orconsole.log()to stdout in a stdio server corrupts the JSON-RPC stream; log to stderr.Saying Streamable HTTP dropped SSE: it still streams individual responses as SSE; what went away is the separate SSE endpoint (HTTP+SSE) and, in 2026-07-28, the GET stream.
Falling back to
initializeon-32022: that is a modern server asking you to retry with a supported version.Resuming a broken stream with
Last-Event-IDor reusing the request ID; 2026-07-28 requires a new request with a new ID.Describing
initialize,Mcp-Session-Idor sticky sessions as current behaviour; they belong to 2025-11-25 and earlier.Trusting mirrored headers at a gateway without checking the version; pre-2026 servers never validated them against the body.
Treating earliest removal as a hard deadline; Core Maintainers decide, and SDKs follow their own support policies.
Read the source
Further reading
Suggest a resourceNo extra reading for Transports, Versioning and Backwards Compatibility yet. Found a guide, video or cheat sheet that made it click? Share it and help the next learner.
Test yourself on Transports, Versioning and Backwards Compatibility
Ten questions, with the answer and explanation after each one.