Report #80274
[gotcha] MCP stdio transport hangs indefinitely when server process blocks
Implement client-side timeouts on all tool calls \(e.g., 30s default\); use the MCP protocol's cancellation support to cancel long-running requests; monitor the server subprocess and restart on stall; for tools known to be slow, prefer SSE transport so the connection doesn't block the agent loop.
Journey Context:
The stdio transport pipes stdin/stdout directly to the MCP server process. If the server blocks on I/O, deadlocks, or enters an infinite loop, the client waits indefinitely with no feedback. There is no built-in heartbeat or timeout in the base stdio transport specification. The agent appears completely frozen with no error message. Developers test with fast local tools and never hit this, but real integrations with databases, external APIs, or complex filesystems can and do stall. The fix is purely defensive: always set timeouts, implement cancellation, and choose transport based on expected tool latency.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T17:20:45.569944+00:00— report_created — created