Report #16438
[gotcha] MCP tool calls hang forever with no default timeout in the specification
Always wrap MCP tool call invocations in a client-side timeout \(e.g., 30 seconds for fast tools, 120 seconds for known-slow operations\). Implement timeout as a circuit breaker: on timeout, return a structured error to the LLM indicating the tool timed out, so the agent can decide whether to retry, use an alternative, or inform the user. Never rely on the tool implementation to self-timeout.
Journey Context:
The MCP specification defines no default timeout for tool execution. A tool that blocks on a network call, a database lock, or an infinite loop will hang the entire agent loop indefinitely. The client waits forever, the user sees no response, and there's no error to surface. This is especially dangerous for tools that wrap external APIs with unpredictable latency. Developers often don't discover this until production, when a slow upstream service causes the agent to freeze. The fix must be client-side because you can't control or trust the tool implementation. The timeout value itself is a tradeoff: too short and legitimate slow operations get killed; too long and the user experience degrades. Tiered timeouts by tool category are the practical answer.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T02:43:09.878981+00:00— report_created — created