Skip to content
EventPast event

Claude Code MCP timeout retry causes duplicate execution

1 reports1 reporting sourcesLatest report

Start here

AI overview

The author had Claude Code batch-convert 30 PDF folders via MCP; the synchronous implementation took about 90 seconds, exceeding the client's 60-second limit. After the timeout, the server process was still running, the client judged it a failure and retried the same task, and the two processes wrote to the same output path, producing 3 corrupted text files. The author says increasing the timeout and returning results in segments with sleep were both ineffective; the only solution is separating response from processing, and a complete implementation of the job submission pattern is attached.

Generated by AI from reports · Updated 29 days ago

Progress timeline

Oct 30
  1. Qiita
    Claude Code's MCP tool calls time out after 60 seconds — complete implementation of a job submission pattern that prevents ghost duplicate executions

    The author had Claude Code batch-convert 30 PDF folders via an MCP tool; the synchronous implementation took about 90 seconds and timed out at the client's 60-second wait limit. The timeout only means the client stopped waiting; the server-side process was still running. Claude Code judged the tool to have failed and retried, so the same task was submitted again, and two processes wrote to the same output path, producing 3 corrupted text files. The author notes that increasing the timeout value and sleeping inside the tool to return progress in segments both fail; the only solution is to separate the response from the processing. The article gives a complete implementation of the job submission pattern: the tool returns a job_id within 1 second, the AI polls the running/done/failed status with get_job_status, and a running task with the same target is reused directly, making retries idempotent. The article ends with a .mcp.json configuration, a comparison table of three approaches, and a 7-question implementation checklist, and notes that the in-memory JobStore loses tasks after a server restart, so SQLite can be used when persistence is needed.