Property StderrHandler
StderrHandler
Gets or sets a handler for stderr output from the subprocess.
public Action<string> StderrHandler { get; set; }
Property Value
Examples
options.StderrHandler = line => Console.Error.WriteLine($"[MCP] {line}");
Remarks
MCP servers typically write diagnostic information, warnings, and errors to stderr. This handler allows you to capture and log this output for debugging purposes.
The handler is called synchronously from the stderr reading thread. Keep the handler lightweight to avoid blocking the process's stderr buffer.