Table of Contents

Class StdioServerTransport

Namespace
ModelContextProtocol.Protocol.Transport
Assembly
ModelContextProtocol.dll

Provides an ITransport implemented via "stdio" (standard input/output).

public sealed class StdioServerTransport : StreamServerTransport, ITransport, IAsyncDisposable
Inheritance
StdioServerTransport
Implements
Inherited Members

Constructors

StdioServerTransport(IOptions<McpServerOptions>, ILoggerFactory?)

Initializes a new instance of the StdioServerTransport class.

public StdioServerTransport(IOptions<McpServerOptions> serverOptions, ILoggerFactory? loggerFactory = null)

Parameters

serverOptions IOptions<McpServerOptions>

The server options.

loggerFactory ILoggerFactory

Optional logger factory used for logging employed by the transport.

Exceptions

ArgumentNullException

serverOptions is null.

StdioServerTransport(McpServerOptions, ILoggerFactory?)

Initializes a new instance of the StdioServerTransport class.

public StdioServerTransport(McpServerOptions serverOptions, ILoggerFactory? loggerFactory = null)

Parameters

serverOptions McpServerOptions

The server options.

loggerFactory ILoggerFactory

Optional logger factory used for logging employed by the transport.

Exceptions

ArgumentNullException

serverOptions is null or contains a null name.

StdioServerTransport(string, ILoggerFactory?)

Initializes a new instance of the StdioServerTransport class.

public StdioServerTransport(string serverName, ILoggerFactory? loggerFactory = null)

Parameters

serverName string

The name of the server.

loggerFactory ILoggerFactory

Optional logger factory used for logging employed by the transport.

Exceptions

ArgumentNullException

serverName is null.