What is a Transport?
Every MCP conversation involves two parties — a Client (e.g. Claude, an IDE plugin) and a Server (a tool provider or data source). They need to exchange messages. The transport is the physical mechanism that carries those messages.
Think of it as the road between two houses. The houses stay the same — only the road changes. MCP supports two transports: stdio (direct OS pipe) and SSE (HTTP stream). Both carry identical JSON-RPC messages.
MCP Stack — Where Transports Fit
Transports sit at the bottom of the MCP stack. Everything above them (Tools, Prompts, Sampling, Resources) is completely unaffected by which transport you choose.
What it is
The client and server talk through a direct OS pipe — like two tin cans connected by a string. No internet, no port, no URL. Just raw stdin and stdout streams attached between a parent and child process.
The client spawns the server process itself — the server doesn't exist until the client starts it. Once spawned, they share a private pipe that no other process can interrupt or intercept.
Step-by-step
python server.py)When to use
Visual flowchart
What it is
The server runs as an independent HTTP service on a port — like a website. It doesn't need a client to start it. Clients connect over HTTP and maintain a long-lived SSE stream to receive responses in real-time.
SSE (Server-Sent Events) is a web standard where the server keeps an HTTP connection permanently open and pushes data down to the client. Requests go client→server via regular HTTP POST; responses come back through the open SSE stream.
Step-by-step
http://localhost:8000)/sse — server keeps this connection permanently openWhen to use
Visual flowchart
JSON-RPC vs Transports — Not Alternatives
These operate at completely different layers. JSON-RPC defines what the message says. stdio/SSE define how it travels. You always need both — like you need both a language and a postal system to send a letter.
Full Feature Comparison
| Feature | stdio | SSE |
|---|---|---|
| Mechanism | OS pipe (stdin / stdout) | HTTP connection (URL + port) |
| Server startup | Client spawns the server | Server runs independently; clients connect |
| Multiple clients | No — 1 client per server process | Yes — many clients, one server |
| Network needed | No — zero network involved | Yes — even localhost is a network socket |
| Client sends via | writes to stdin | HTTP POST request |
| Server responds via | writes to stdout | long-lived SSE stream |
| Connection lifetime | lasts while client process runs | persistent until client disconnects |
| Speed | Very fast — zero HTTP overhead | Slightly slower — HTTP headers + TCP |
| Best for | Local tools, CLI, IDE plugins, testing | Web apps, remote servers, production |
| Complexity | Dead simple — just run it | Needs server startup + port config |
| Real-world examples | MCP Inspector, VS Code extensions, scripts | Deployed AI assistants, cloud services |