Skip to content

Support per-server MCP execution timeout in config #23096

Description

@neothechosen1

Problem

MCP server tool execution is hardcoded to a 30s timeout (per-server timeout: 30s per mcporter list). This is insufficient for local stdio MCP servers that call external APIs (e.g., Z.AI Vision MCP server calling GLM-4.6V for image analysis takes 45-90s).

The --timeout <ms> flag exists on mcporter call but there is no way to set this at the config level (mcporter.json or opencode's mcp config).

OpenCode's mcp.<server>.timeout field only controls tool discovery (default 5s), not tool execution.

Reproduction

// opencode.json
{
  "mcp": {
    "zai-mcp-server": {
      "type": "local",
      "command": ["npx", "-y", "@z_ai/mcp-server"],
      "environment": { "Z_AI_API_KEY": "...", "Z_AI_MODE": "ZAI" },
      "timeout": 120000  // only affects tool discovery, NOT execution
    }
  }
}

Running vision analysis via opencode consistently times out at ~30s, but succeeds when called directly:

mcporter call zai-mcp-server.analyze_image --timeout 90000 --args '{"image_source":"/path/to/image.png","prompt":"describe this"}'

Proposed Fix

Add a per-server executionTimeout (or similar) field to both:

  1. mcporter.json — mcpServers.<name>.timeout for execution timeout
  2. opencode.json — mcp.<server>.executionTimeout that gets passed through to mcporter

Example:

{
  "mcp": {
    "zai-mcp-server": {
      "type": "local",
      "command": ["npx", "-y", "@z_ai/mcp-server"],
      "environment": { "Z_AI_API_KEY": "...", "Z_AI_MODE": "ZAI" },
      "timeout": 120000,
      "executionTimeout": 120000
    }
  }
}

Environment

  • mcporter: 0.7.3
  • opencode: latest
  • macOS Darwin
  • Node.js v22+

Activity

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

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions