Skip to content

Support per-server MCP execution timeout in config #23096

Closed as not planned
Closed as not planned

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

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 17, 2026
  2. github-actions commented on Apr 17, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • This appears to be a feature request, but the title does not start with [FEATURE]: as required by the feature request template.
    • The feature request template requires a verification checkbox confirming you've searched for existing issues and confirmed this is not a duplicate.

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

  3. github-actions commented on Apr 17, 2026

    @github-actions
    Contributor

    This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

    Feel free to open a new issue that follows our issue templates.

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