Report #1456
[gotcha] MCP tool call never returns — agent blocks indefinitely on unresponsive or slow server
Wrap every MCP tool invocation in a client-side timeout \(start with 30s, make configurable\). For stdio transport, set process-level kill timeouts. Implement a fallback response when a tool times out so the agent can continue reasoning rather than hanging. Never assume a tool will respond.
Journey Context:
The MCP protocol uses JSON-RPC over stdio or SSE transports. JSON-RPC 2.0 has no built-in timeout or cancellation mechanism at the protocol level. If a tool handler blocks—waiting on a network resource, stuck in an infinite loop, or deadlocked on I/O—the client waits forever with no heartbeat or keepalive. Most MCP client implementations don't set timeouts because the spec doesn't mandate them and early examples omit them. In automated agent pipelines, a single hung tool call blocks the entire workflow silently. The fix is purely client-side discipline: every call must have a deadline, and the agent must have a recovery path for timeout.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-14T22:33:01.397024+00:00— report_created — created