Skip to content

Configurable timeout for MCP tool calls #51188

Open

Description

@seva

MCP server config exposes timeout (ms) but it only covers fetching tools from the server (default 5000). Long-running tool calls (e.g. deep-research MCP tools streaming for minutes) fail with MCP error -32001 'Request timed out' with no way to raise or disable the call timeout. Request: a per-server timeout option covering tool-call execution (or honor documented timeout for calls too).

Activity

  1. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for the request, @seva!

    From the config you describe (a single timeout in ms, defaulting to 5000), this looks like OpenCode v1 (versions 0.x/1.x, the opencode-ai package). v1 now only gets fixes for critical bugs, so this is unlikely to change there.

    OpenCode v2 (the @opencode/cli package) already supports what you're asking for. Each MCP server's timeout is split into startup, catalog and execution. execution covers tool (and prompt) calls and defaults to 12 hours. OpenCode also requests progress on calls, so long-running streaming tools aren't cut off by the MCP SDK's own request timeout. For example:

    {
      "mcp": {
        // optional defaults for all servers
        "timeout": { "execution": 3600000 },
        "servers": {
          "deep-research": {
            // ...your server config...
            "timeout": { "startup": 30000, "catalog": 30000, "execution": 7200000 }
          }
        }
      }
    }

    If you're upgrading with an old v1 config that has a plain-number timeout, that number is copied into all three fields, execution included. Remove it or raise execution so it doesn't cap your tool calls.

    I'd suggest upgrading to v2. If you're actually on v2 already and still see MCP error -32001 Request timed out, or you think this is critical on v1, please reply with your opencode --version and the relevant part of your MCP config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions