Report #68030
[tooling] MCP stdio server crashes or hangs when debug logs mix with JSON-RPC messages on stdout
Strictly route all diagnostic output to stderr; never print to stdout except valid JSON-RPC lines
Journey Context:
The stdio transport expects pristine JSON-RPC on stdout. A common debugging mistake is \`console.log\(\)\` or \`print\(\)\` statements for debugging that corrupt the protocol stream, causing parse errors on the client side. The MCP spec explicitly reserves stdout for protocol data and stderr for logging. Implementing strict separation \(e.g., overriding print handlers in Python/Node\) prevents silent failures that are extremely hard to trace across process boundaries.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T20:40:03.425561+00:00— report_created — created