Home Glossary
HomeGlossaryStdio Transport
MCP Glossary

Stdio Transport

TL;DR

Stdio transport is the default MCP transport for local servers. The client launches the server as a subprocess and exchanges JSON-RPC messages over its stdin (client→server) and stdout (server→client) streams. It's simple, fast, and the preferred transport for locally installed MCP servers.

In depth

Stdio transport is the workhorse of the MCP ecosystem. When you configure an MCP server in Claude Desktop or Claude Code, the host launches it as a subprocess using the given command and args. The host writes JSON-RPC requests to the subprocess's stdin, newline-delimited, and reads responses from stdout.

This transport has zero network overhead, no ports, no TLS, and inherits the subprocess's permissions (usually the user's). Server crashes are detected immediately when the subprocess exits. There's no authentication layer needed — the only actor on stdio is the parent process.

All official MCP SDKs ship a stdio transport implementation. A stdio server is typically an npm package (run with `npx`), a Python module (run with `uv` or `python`), or a compiled binary. Most MCP servers in the ecosystem are stdio-based.

Stderr is reserved for logs — the server writes human-readable debug output to stderr, leaving stdout clean for JSON-RPC. Mixing writes to stdout breaks the protocol.

Code example

// Claude Desktop / Claude Code config (.claude.json)
{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": { "GITHUB_TOKEN": "ghp_abc..." }
    }
  }
}

// What happens on host start:
// 1. Host spawns: `npx -y @modelcontextprotocol/server-github`
// 2. Host writes initialize request to the subprocess stdin
// 3. Server responds via stdout, one JSON-RPC message per line

Examples

  • 1
    `npx -y @modelcontextprotocol/server-filesystem /Users/me/docs`
  • 2
    `uv run mcp-server-supabase` — Python-based Supabase MCP
  • 3
    A compiled Rust binary shipped as a single executable
  • 4
    A local dev MCP launched from `./my-server.ts` via `tsx`
  • 5
    A container MCP via `docker run -i my-mcp-image` (stdin/stdout mapped)

What it's NOT

  • ✗Stdio does NOT require root permissions — it runs as the host's user.
  • ✗Stdio is NOT limited to text — binary content is base64-encoded within JSON-RPC.
  • ✗Writing logs to stdout DOES break stdio — always log to stderr.
  • ✗Stdio is NOT slower than HTTP — for local servers, it's much faster (no TCP overhead).

Related terms

MCP TransportSSE Transport (Server-Sent Events)HTTP / Streamable TransportMCP Server

See also

  • MCP Transports Spec

Frequently asked questions

Can I debug stdio traffic?

Yes — use `mcp-inspector` or wrap your server command to log incoming/outgoing messages. Set `DEBUG=mcp:*` env var on official SDKs.

Does stdio support multiple concurrent requests?

Yes. JSON-RPC is request/response with ids, so many requests can be in flight simultaneously on the same stdio pair.

What if my server needs env vars?

Pass them in the `env` field of the config. Never hardcode credentials — use a secret manager and inject at launch.

Build with MCP

Browse 300+ MCP servers, explore recipes, or continue learning the MCP vocabulary.

Browse MarketplaceAll terms