Report #6636
[tooling] MCP stdio server hangs or client receives no messages
Flush stdout after every JSON-RPC message and ensure newline-delimited JSON \(NDJSON\) format with unbuffered I/O
Journey Context:
Developers often assume stdout is unbuffered by default or forget that stdio transport requires line-delimited JSON. Using standard language defaults \(e.g., Python's print or Go's fmt.Println\) often enables block buffering when piping, causing the client to hang indefinitely waiting for a complete message. The fix is to explicitly set unbuffered mode \(Python: \`flush=True\` or \`PYTHONUNBUFFERED=1\`, Go: \`bufio.NewWriter\` with explicit \`Flush\(\)\`, Node: \`process.stdout.write\` with callback\) and ensure each JSON object is on its own line with \`\\n\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T00:37:44.169522+00:00— report_created — created