Table of Contents

Property StderrHandler

Namespace
LMKit.Mcp.Transport
Assembly
LM-Kit.NET.dll

StderrHandler

Gets or sets a handler for stderr output from the subprocess.

public Action<string> StderrHandler { get; set; }

Property Value

Action<string>

An action that receives each line of stderr output, or null to discard stderr.

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.