Skip to main content

stdio

since 2024-11-05

Local MCP servers running as child processes on the same machine as the client

The stdio transport connects an MCP client to a server by launching the server as a child process and communicating via stdin/stdout. Each JSON-RPC message is a single UTF-8 line. This is the primary transport for local integrations: Claude Desktop, Cursor, VS Code extensions. No network configuration required.

Overview

The stdio transport is the simplest MCP transport and the most widely deployed. The client spawns the server as a subprocess and writes newline-delimited JSON-RPC messages to the process's stdin. The server writes responses to stdout. Stderr is used for logging and is not part of the protocol.

This model means no port binding, no TLS configuration, and no firewall rules. The server process is fully isolated to the client machine. The MCP client controls the server lifecycle: it starts the process when needed and terminates it when done.

The wire format is one JSON-RPC message per line. Messages must not contain literal newlines in string values (use \n escapes). The framing is purely line-based: each \n terminates exactly one message.

Wire Format

stdio – wire format
http
// Client sends (to server stdin):
{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"claude-desktop","version":"1.0"}}}

// Server responds (from stdout):
{"jsonrpc":"2.0","id":1,"result":{"protocolVersion":"2025-06-18","capabilities":{"tools":{}},"serverInfo":{"name":"my-server","version":"1.0"}}}

// Server sends notification (no id):
{"jsonrpc":"2.0","method":"notifications/tools/list_changed"}

Advantages

  • +Zero network configuration – no ports, no TLS, no firewall rules
  • +Process isolation – server crashes do not affect the client network
  • +Works behind any firewall – pure local IPC
  • +Simple deployment – a single executable is the entire server
  • +Client controls server lifecycle – start on demand, terminate when done

Limitations

  • Local only – cannot be shared across machines or accessed remotely
  • One client per server process – no multiplexing across multiple clients
  • Server must be an executable the client can spawn
  • No built-in authentication – the OS process model is the security boundary