stdio (standard input/output) is the Model Context Protocol's local transport: the client launches the server as a child process and exchanges newline-delimited JSON-RPC messages over its stdin and stdout.
How the stdio transport works
Every process has three standard streams: stdin, stdout, and stderr. With the stdio transport:
- The client starts the server with a command, such as
npx some-package. - The client writes JSON-RPC messages to the server's stdin, one per line.
- The server writes responses to stdout.
- The server may write logs to stderr; it must never write anything else to stdout.
- When the client exits, the server process ends.
Most desktop and IDE clients, including Claude Desktop, Cursor, and VS Code, support stdio servers through a config file listing the command, arguments, and environment variables.
stdio versus streamable HTTP
stdio needs no network, port, or TLS, and it inherits your local environment. But it only serves one client on one machine. For shared or hosted use, streamable HTTP fits better.
An example
{ "mcpServers": { "social": { "command": "npx", "args": ["socialhandoff-mcp"] } } }The client runs that command at startup and talks to the server over its pipes.
Why it matters for AI-agent publishing
stdio is the fastest way to try an MCP server from a desktop assistant. The API key is usually passed as an environment variable in the config, so keep that file private.
SocialHandoff ships a stdio server you start with npx socialhandoff-mcp. Build a config with the MCP config generator and follow connect an agent with MCP.