Class StdioMcpClient

Assembly: redb.Route.Llm.Mcp.dll

Stdio transport — spawns an external process, exchanges newline-delimited
UTF-8 JSON-RPC frames over stdin/stdout, drains stderr to the logger.
All stdin writes are serialised through a .

public sealed class StdioMcpClient : McpClientBase, IMcpClient, IAsyncDisposable

Inheritance

Object→McpClientBase→StdioMcpClient

Implements

Inherited Members

Methods

SendFrameAsync(string, CancellationToken)

Writes a single JSON frame to the server. Implementations must serialize concurrent writes.

protected override Task SendFrameAsync(string frameJson, CancellationToken cancellationToken)

StartTransportAsync(CancellationToken)

Brings up the byte-level transport (e.g. spawn process, open HTTP/SSE channels).

protected override Task StartTransportAsync(CancellationToken cancellationToken)

StopTransportAsync()

Tears the transport down. Should not throw on already-stopped state.

protected override Task StopTransportAsync()

Constructors

StdioMcpClient(string, McpTransport, ILogger)

Creates a new stdio MCP client.