MCP Transports: stdio and Stateless Streamable HTTP
Transport carries MCP messages. It does not supply missing protocol state. In 2026-07-28, local stdio and remote Streamable HTTP both carry self-describing requests. Choose stdio for local child processes and Streamable HTTP for network services. Implement the modern single-endpoint, POST-only Streamable HTTP contract. Mirror and validate MCP version, method, and name headers against the JSON-RPC body. Deliver request-scoped SSE and long-lived subscriptions/listen streams correctly. Migrate session-based and legacy HTTP+SSE deployments without presenting legacy behavior as modern. Earlier Streamable HTTP revisions combined protocol negotiation with connection and session behavior. A server could mint Mcp-Session-Id, expose a standalone GET stream, accept DELETE for session termination, and resume SSE with Last-Event-ID. MCP 2026-07-28 removes those mechanisms from the modern wire. Every request can land on any healthy worker because its protocol version and client capabilities travel in the request body. HTTP headers mirror selected fields for routing and policy, but the server validates those headers against the body before execution. The result is easier to scale and easier to reason about. It also means that a server teaching the 2025 transport as current is teaching the wrong failure and security model. The stdio binding is for a client-launched subprocess: Client writes one UTF-8 JSON-RPC message per line to stdin. Server writes one UTF-8 JSON-RPC message per line to stdout. Server writes diagnostics to…
MCP Transports: stdio and Stateless Streamable HTTP: Transport carries MCP messages. It does not supply missing protocol state. In 2026-07-28, local stdio and…
This free lesson is part of the AI Engineering from Scratch curriculum. Read the full explanation, run the lesson code, and verify the result in the interactive reader or from the repository source.
Browse the complete course catalog or open this lesson on GitHub.