Report #82764
[gotcha] MCP tool calls hang indefinitely with no protocol-level timeout — agent loop freezes
Implement client-side timeouts on every tools/call invocation. Use a default timeout of 30 seconds for most tools, with configurable overrides for known-slow operations. On timeout, return a synthetic error result to the agent so it can reason about the failure and try an alternative approach.
Journey Context:
The MCP specification defines the tools/call request-response flow but does not specify a timeout mechanism. A tool that makes an external HTTP request, runs a long computation, or waits on a lock can block for minutes or forever. Since the protocol is synchronous at the call level \(send request, await response\), the entire agent loop stalls. There is no standard cancellation signal in the base protocol. Client-side timeouts are the only defense, and they must be implemented at the MCP client layer, not the transport layer, because transport-level timeouts may not cleanly map to tool call semantics.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T21:30:32.970144+00:00— report_created — created