Skip to content

fix(mcp): let a remote tool call run for 10 minutes, not 60 seconds - #518

Merged
mrnasil merged 1 commit into
mainfrom
fix/mcp-http-tool-call-timeout
Nov 28, 2026
Merged

mrnasil merged 1 commit into
mainfrom
fix/mcp-http-tool-call-timeout

Conversation

@mrnasil

@mrnasil mrnasil commented Nov 28, 2026

Copy link
Copy Markdown
Member

Problem

Both HTTP transports bounded every request at 60 s, tools/call included. A remote tool that builds, drives a browser or generates media failed with a timeout, while the same tool over stdio (which has no bound) worked.

Decision

tools/call waits up to 10 minutes; everything else keeps 60 s.

  • Not unbounded: in whycodes run, serve or CI nobody is there to press Esc, and a dead server would hold the run forever. An interactive user can still cancel at any time; that path is unchanged.
  • Not one longer bound for everything: initialize and the listings run at startup, where a dead server should fail in a minute, not ten.
  • No config key: nobody has asked for one, and 10 minutes matches the stream bound the SDK clients already use.

The longer bound applies to the Streamable HTTP POST and, on the legacy transport, to both the POST and the wait for the answer on the SSE stream. stdio is unchanged (still unbounded).

Verification

  • a_tool_call_may_outlast_the_protocol_request_bound: a server answers after twice the protocol bound; tools/call succeeds, tools/list times out.
  • a_legacy_tool_call_waits_longer_for_its_sse_answer: same for the SSE answer wait.
  • cargo test -p whycodes-mcp: 81 + 10 passed. Clippy, fmt, budget scripts: green.
  • Coverage: mcp crate measured locally after cargo llvm-cov clean; http.rs shows the same 6 lines as main (warn! field lines this Windows host reports and CI does not). The full scripts/coverage.sh workspace run was not done locally.

🤖 Generated with Claude Code

Both HTTP transports bounded every request at 60 s, tools/call
included, so a remote tool that builds, drives a browser or generates
media failed with a timeout while the same tool over stdio (no bound)
worked. tools/call now waits up to 10 minutes on Streamable HTTP and on
the legacy SSE answer; initialize, listings and notifications keep the
60 s bound so a dead server still fails fast at startup.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@mrnasil
mrnasil merged commit d73a0cf into main Nov 28, 2026
7 checks passed
@mrnasil
mrnasil deleted the fix/mcp-http-tool-call-timeout branch November 28, 2026 15:20
@mrnasil mrnasil mentioned this pull request Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant