← Back to Dashboard
1. The Stdio Transport2. Streamable HTTP & SSE3. Managing Sessions

The Stdio Transport

📚 Transport Layers6 min60 XP⌨ Hands-on lab

Local Communication via Stdio

The stdio (Standard Input/Output) transport is the most common way to run MCP servers locally. It is lightweight, extremely secure, and requires no open network ports.

How it Works

The Host application (like Claude Desktop) launches the MCP Server as a child subprocess. It communicates by writing JSON-RPC messages to the server's stdin and reading from its stdout.

{
  "mcpServers": {
    "local-db": {
      "command": "node",
      "args": ["/path/to/server.js"],
      "env": { "DB_PASS": "secret123" }
    }
  }
}
🎯 Pro Tip: When using the stdio transport, your server code must never log debug information using console.log(), because it will corrupt the JSON-RPC stream on stdout! Use console.error() for debug logging instead.
⌨ HANDS-ON LABSpeak Raw JSON-RPC to a Server
⭐ +150 XP

No SDK, no client — just pipes. Launch the reference everything-server and handshake with it by writing a raw JSON-RPC initialize message straight into its stdin.

1Run the official reference server (@modelcontextprotocol/server-everything) with npx.
2Handshake manually: echo a JSON-RPC initialize request and pipe it into the server's stdin.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
OBJECTIVE 1 / 2 — type "hint" if stuck
🧪 Knowledge Check
Press 1-4 to select1 of 3
Why is the stdio transport considered extremely secure?
It uses 256-bit AES encryption.
It runs entirely locally as a child process without opening any network ports.
It requires an internet connection to Anthropic servers.
It requires a biometric hardware key.
The Stdio Transport Tutorial | Transport Layers — MCP Academy