Report #42818
[tooling] MCP stdio transport hangs or parses partial JSON messages causing infinite wait
Serialize each JSON-RPC message as a single line with no internal newlines, terminated by \\n. Never pretty-print. Parse by reading lines \(NDJSON\), not using a streaming JSON parser that expects curly braces.
Journey Context:
Developers often assume stdio transport allows pretty-printed JSON or treat it as a raw byte stream. The MCP spec uses newline-delimited JSON \(NDJSON\). Pretty-printing injects \\n characters that break framing, causing the client to wait forever for the next message or parse incomplete payloads. Single-line serialization is mandatory; internal newlines must be escaped within JSON strings.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T02:20:21.863919+00:00— report_created — created