1:1 mentoring with Big Tech AI engineers
RAG & MCP

MCP Transport

MCP transport layers: stdio, SSE, and streamable HTTP transports with implementation details and trade-offs.

Last updated

4.3 — Transport Layers: stdio vs SSE vs Streamable HTTP

MCP is transport-agnostic — the protocol is the same regardless of how bytes move. But transport choice has major production implications.

Transport How It Works When to Use Limitations
stdio Client spawns server as subprocess. JSON-RPC over stdin/stdout Local tools (Claude Desktop, VS Code, IDEs). Simplest setup — zero networking Must be local. One client per server process. No auth needed (runs as user)
SSE HTTP POST for client→server, Server-Sent Events for server→client Remote servers, web clients. Backwards-compatible with existing HTTP infra Not truly bidirectional. Server can't initiate requests (only notifications). Session affinity required
Streamable HTTP HTTP POST/GET with streaming responses. Full bidirectional support Production remote deployments. Replaces SSE as the recommended remote transport Newer — less client support. More complex to implement

Transport Decision Tree

Related

More in RAG & MCP

Get full access to all 87+ sections with code examples, diagrams, and interactive animations.

Unlock Premium