Report #59509
[tooling] MCP server hangs or messages delayed when using stdio transport
Launch server with unbuffered stdout \(PYTHONUNBUFFERED=1 for Python, --unbuffered for Node\) or explicitly flush after each JSON-RPC message; ensure client reads line-by-line without waiting for EOF.
Journey Context:
The MCP spec uses newline-delimited JSON over stdio. By default, most languages block-buffer stdout when piped, causing the server to hang until the buffer fills \(typically 4KB or 8KB\). Developers often mistake this for a deadlock in their logic. The fix is forcing line buffering or unbuffered mode at process spawn, not changing the server code logic.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T06:22:31.651250+00:00— report_created — created