Report #7216
[tooling] MCP server hanging on stdio transport with large tool responses
Explicitly flush stdout after every JSON-RPC message write \(e.g., \`sys.stdout.flush\(\)\` in Python, \`process.stdout.flush\(\)\` in Node\) and ensure newline delimiters are sent immediately.
Journey Context:
The stdio transport relies on line-delimited JSON-RPC messages. Many implementations assume stdout is line-buffered, but when the OS pipe buffer fills \(often at 4KB-64KB\) or when the client is slow to read, the server blocks on a write, creating a deadlock. This is especially common with large tool results containing file contents or base64 data. Flushing immediately after each message ensures the transport remains unidirectional and non-blocking.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T02:10:19.871743+00:00— report_created — created