stdio transport
The MCP transport in which the client starts the server as a subprocess and they exchange one JSON-RPC message per line over standard input and output.
In more detail
Anything else the server prints to standard output corrupts the stream, so logs go to standard error. It suits local servers; shut the subprocess down cleanly, and kill it if it does not exit.
Related terms
- Streamable HTTP — The MCP transport for remote servers: one endpoint that takes each message as its own POST and replies with a JSON object or a stream of server-sent events.
- standard output and standard error — The two channels a program writes normal output (stdout) and error messages (stderr) to, plus stdin for input.
- subprocess module — The standard library module for running other programs from Python and collecting their output and exit code.
Taught in
- What MCP Is — AI Engineering: LLM Apps, RAG & Agents
- Build An MCP Server — AI Engineering: LLM Apps, RAG & Agents
- Connect An Agent To MCP — AI Engineering: LLM Apps, RAG & Agents
- Remote Servers And Trust — AI Engineering: LLM Apps, RAG & Agents
- Capstone: The Tasks Assistant — AI Engineering: LLM Apps, RAG & Agents