Method ForStdio
ForStdio(string, string)
Creates a builder configured for stdio transport.
public static McpClientBuilder ForStdio(string command, string arguments = null)
Parameters
commandstringThe command to execute (e.g., "npx", "python", "uvx").
argumentsstringCommand-line arguments (optional).
Returns
- McpClientBuilder
A new builder instance configured for stdio transport.
Examples
// Node.js MCP server
var builder = McpClientBuilder.ForStdio("npx", "@modelcontextprotocol/server-filesystem /tmp");
// Python MCP server
var builder = McpClientBuilder.ForStdio("python", "-m my_mcp_server");
// UV-based Python server
var builder = McpClientBuilder.ForStdio("uvx", "mcp-server-git");
// Native executable
var builder = McpClientBuilder.ForStdio("/path/to/mcp-server", "--verbose");
Exceptions
- ArgumentException
Thrown when
commandis null or whitespace.
ForStdio(StdioTransportOptions)
Creates a builder configured for stdio transport with detailed options.
public static McpClientBuilder ForStdio(StdioTransportOptions options)
Parameters
optionsStdioTransportOptionsThe stdio transport options.
Returns
- McpClientBuilder
A new builder instance configured for stdio transport.
Exceptions
- ArgumentNullException
Thrown when
optionsis null.