Per-server MCP timeout setting not working; requires experimental.mcp_timeout instead #6265

Closed
opened 2026-02-16 18:02:27 -05:00 by yindo · 0 comments
Owner

Originally created by @fitchmultz on GitHub (Jan 15, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

OpenCode v1.1.21's per-server MCP timeout setting (mcp.SERVER_NAME.timeout) is ignored. Long-running MCP tools timeout after ~60 seconds despite being configured with longer timeouts in the schema-documented field.

Environment:
• OpenCode: v1.1.21
• MCP Server: RepoPrompt (context_builder tool, typical runtime 5-20 minutes)
• Model: zai-coding-plan/glm-4.7
• Other harnesses (Codex, Claude Code): Work without issue using same MCP server

Expected Behavior:
Per the JSON schema, setting mcp.RepoPrompt.timeout: 3600000 should allow the tool to run for up to 1 hour.

Actual Behavior:
Tools timeout after ~60 seconds with error: McpError: MCP error -32001: Request timed out

Non-Working Configuration:

{
  "mcp": {
    "RepoPrompt": {
      "type": "local",
      "command": ["/Users/REDACTED/RepoPrompt/repoprompt_cli"],
      "environment": {},
      "timeout": 3600000  // Per-server timeout
    }
  },
  "provider": {
    "zai-coding-plan": {
      "options": {
        "apiKey": "REDACTED"
        // No timeout specified
      }
    }
  }
}

Working Configuration:

{
  "experimental": {
    "mcp_timeout": 3600000  // Global MCP timeout
  },
  "mcp": {
    "RepoPrompt": {
      "type": "local",
      "command": ["/Users/REDACTED/RepoPrompt/repoprompt_cli"],
      "environment": {},
      "timeout": 3600000  // Still specified but has no effect
    }
  },
  "provider": {
    "zai-coding-plan": {
      "options": {
        "apiKey": "REDACTED",
        "timeout": false  // Required to prevent model timeout override
      }
    }
  }
}

Root Cause:
The timeout hierarchy appears broken. Per-server timeouts should take precedence, but the global experimental setting + disabling model timeout is required instead.

Plugins

No response

OpenCode version

1.1.21

Steps to reproduce

  1. Send a task to GLM 4.7 instructing to use the RepoPrompt context_builder to gather context and generate a plan.
  2. Wait

Screenshot and/or share link

No response

Operating System

macOS

Terminal

iTerm2

Originally created by @fitchmultz on GitHub (Jan 15, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description OpenCode v1.1.21's per-server MCP timeout setting (mcp.SERVER_NAME.timeout) is ignored. Long-running MCP tools timeout after ~60 seconds despite being configured with longer timeouts in the schema-documented field. **Environment:** • OpenCode: v1.1.21 • MCP Server: RepoPrompt (context_builder tool, typical runtime 5-20 minutes) • Model: zai-coding-plan/glm-4.7 • Other harnesses (Codex, Claude Code): Work without issue using same MCP server **Expected Behavior:** Per the JSON schema, setting mcp.RepoPrompt.timeout: 3600000 should allow the tool to run for up to 1 hour. **Actual Behavior:** Tools timeout after ~60 seconds with error: `McpError: MCP error -32001: Request timed out` **Non-Working Configuration:** ```jsonc { "mcp": { "RepoPrompt": { "type": "local", "command": ["/Users/REDACTED/RepoPrompt/repoprompt_cli"], "environment": {}, "timeout": 3600000 // Per-server timeout } }, "provider": { "zai-coding-plan": { "options": { "apiKey": "REDACTED" // No timeout specified } } } } ``` **Working Configuration:** ```jsonc { "experimental": { "mcp_timeout": 3600000 // Global MCP timeout }, "mcp": { "RepoPrompt": { "type": "local", "command": ["/Users/REDACTED/RepoPrompt/repoprompt_cli"], "environment": {}, "timeout": 3600000 // Still specified but has no effect } }, "provider": { "zai-coding-plan": { "options": { "apiKey": "REDACTED", "timeout": false // Required to prevent model timeout override } } } } ``` **Root Cause:** The timeout hierarchy appears broken. Per-server timeouts should take precedence, but the global experimental setting + disabling model timeout is required instead. ### Plugins _No response_ ### OpenCode version 1.1.21 ### Steps to reproduce 1. Send a task to GLM 4.7 instructing to use the RepoPrompt context_builder to gather context and generate a plan. 2. Wait ### Screenshot and/or share link _No response_ ### Operating System macOS ### Terminal iTerm2
yindo added the bug label 2026-02-16 18:02:27 -05:00
yindo closed this issue 2026-02-16 18:02:27 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#6265