When should you choose stdio transport for an MCP server, and when is it the wrong choice?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
Describe how stdio transport works in MCP, when it is the right choice, and name at least one scenario where it would be the wrong choice.
stdio launches the MCP server as a local subprocess and pipes newline-delimited JSON-RPC over stdin and stdout; perfect for local trusted tools, useless across a network.
Imagine two people in the same room passing notes back and forth. The host writes a note (a request) and hands it through one slot; the server writes its reply and hands it back through another slot. That's stdio: the host starts the server program right next to it, then they exchange messages by writing lines of text. Each note is one line, so the reader knows a note ends at the newline. Because the two are in the same room, there's no mail carrier, no address, no lock on the door. Simple and private. But if the server lives in another building, you cannot pass notes by hand anymore. Then you need the postal system, which is the network transport.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
4 min: subprocess model + stdin, stdout, stderr roles + newline-delimited JSON-RPC framing + local trust use cases + privilege caveat + why remote needs Streamable HTTP.
| Concern | stdio transport | Streamable HTTP transport |
|---|---|---|
| Topology | Local subprocess, same machine | Remote server across a network |
| Channel | stdin and stdout pipes | HTTP requests, optional streaming |
| Auth needed | None, no network surface | Yes, OAuth 2.1 bearer tokens |
| Multi-client | One client per process | Many clients to one server |
| Best for | Local trusted dev tools | Cloud and shared deployments |
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Thinking stdio can reach a remote server. It has no listener and no port, so it only works when host and server share one machine.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.