Report #65818
[gotcha] MCP tool calls hang indefinitely on slow external APIs
Implement strict client-side timeouts for MCP tool calls and leverage MCP's cancellation mechanism \(sending a cancellation notification if the client disconnects or times out\). Design tools to return partial results or a polling ID for long-running tasks.
Journey Context:
MCP uses JSON-RPC, which expects a response for every request. If a tool calls a slow external API \(e.g., a 5-minute data pipeline\), the connection hangs. Developers assume the transport layer handles timeouts, but standard JSON-RPC does not auto-timeout. You must implement client-side timeouts and use the MCP cancellation spec to prevent zombie processes and frozen agent loops.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-20T16:57:22.977803+00:00— report_created — created