On this page
terminal
Stdio transport
Uses standard input/output streams for direct process communication between local processes on the same machine, providing optimal performance with no network overhead.
In the stdio transport:
- The client launches the MCP server as a subprocess.
- The server reads JSON-RPC messages from its standard input (
stdin) and sends messages to its standard output (stdout). - Messages are individual JSON-RPC requests, notifications, or responses.
- Messages are delimited by newlines, and MUST NOT contain embedded newlines.
- The server MAY write UTF-8 strings to its standard error (
stderr) for logging purposes. Clients MAY capture, forward, or ignore this logging. - The server MUST NOT write anything to its
stdoutthat is not a valid MCP message. - The client MUST NOT write anything to the server’s
stdinthat is not a valid MCP message.
sequenceDiagram
participant Client
participant Server Process
Client->>+Server Process: Launch subprocess
loop Message Exchange
Client->>Server Process: Write to stdin
Server Process->>Client: Write to stdout
Server Process--)Client: Optional logs on stderr
end
Client->>Server Process: Close stdin, terminate subprocess
deactivate Server Process
Last updated 10 Aug 2025, 20:01 +0100 .