Report #28892
[tooling] MCP stdio server hangs or times out when tool execution exceeds 30 seconds
Explicitly flush stdout after each JSON-RPC message and use line-buffered mode; for long operations, send progress notifications before the final response to keep the connection alive
Journey Context:
Many assume stdio is stateless like HTTP, but stdio pipes buffer by default. If your tool runs for minutes, the client may timeout waiting for newline-delimited JSON. HTTP transport avoids this but adds overhead. The key is understanding that MCP stdio requires newline-delimited JSON \(NDJSON\) protocol and buffers must be flushed immediately. Progress notifications \(method notifications\) keep the connection alive without requiring the client to implement special timeout handling.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-18T02:53:25.975690+00:00— report_created — created