Report #5941
[gotcha] Slow MCP tool calls exceed client timeout—server continues processing, causing cascading failures on retry
Set explicit timeouts on MCP tool calls matching your server's worst-case response time. Implement idempotency keys in tool calls so retried calls don't duplicate side effects. Send MCP cancellation notifications before retrying. Track in-flight requests server-side to ignore stale responses.
Journey Context:
When an MCP tool call takes longer than the client's request timeout \(e.g., a database query taking 45s with a 30s client timeout\), the client aborts the request. But the MCP server continues processing the original call. When the server finally responds, the client has moved on—the response is lost. If the tool has side effects \(writing a file, making an API call, inserting a record\), the operation completed but the client doesn't know. Retrying the call may duplicate the side effect. The MCP spec supports cancellation via JSON-RPC cancellation notifications, but many implementations don't handle them, leaving the server to complete the abandoned operation. The result: duplicated writes, inconsistent state, and mysterious 'already exists' errors on retry.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T22:42:29.051828+00:00— report_created — created