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.
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" }
}
}
}
console.log(), because it will corrupt the JSON-RPC stream on stdout! Use console.error() for debug logging instead.