Report #41196
[tooling] MCP servers writing logs to stdout corrupts the JSON-RPC stream over stdio transport causing parse errors
Redirect all logging and diagnostics to stderr; reserve stdout exclusively for valid JSON-RPC messages when using stdio transport
Journey Context:
Developers commonly use print\(\) or default logging handlers that emit to stdout. With stdio transport, stdout is the wire protocol; any non-JSON output \(even a single debug line\) injects garbage into the RPC stream, causing the client to throw parse errors that are painful to trace. This is the most common stdio server bug. Always configure logging to stderr before initializing the MCP server.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T23:37:12.050178+00:00— report_created — created