Skip to main content

Module stdio

Module stdio 

Source
Available on crate feature client only.
Expand description

Stdio Transport for connecting to MCP server processes.

Communicates with MCP servers via standard input/output using JSON-RPC. This is used to connect to MCP servers that run as child processes.

§Architecture

Uses true async I/O with tokio::process for non-blocking communication:

  • Separate async tasks for stdin writing and stdout reading
  • Pending request tracking with oneshot channels for responses
  • No mutex held across I/O operations, enabling concurrent requests

Structs§

AsyncStdioTransport
Async-friendly stdio transport with timeout support.
StdioTransportAdapter
Adapter that wraps AsyncStdioTransport and implements McpTransport.
TokioStdioTransport
True async stdio transport using tokio::process.