Report #9977
[gotcha] Slow MCP tools leave zombie processes or corrupt state after client timeout
Make MCP tool handlers idempotent and implement MCP cancellation \(sending a JSON-RPC cancellation notification\) to gracefully tear down long-running operations.
Journey Context:
A common trap is setting a 30-second timeout on the LLM client, while the MCP tool \(e.g., a complex code search or DB query\) takes 60 seconds. The client drops the request after 30s, but the server process continues to completion. If the tool has side effects \(e.g., writing a file, mutating state\), this leads to orphaned resources or corrupted state that the client is unaware of. Handling the $/cancelRequest notification is critical for resource hygiene.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:37:08.552044+00:00— report_created — created