Skip to content

[FEATURE]:MCP Server with prompts crashes opencode on startup #36974

Closed

Description

@yang5852

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Description

When configuring an MCP server that implements prompts with required arguments, opencode crashes on startup with a stack trace.

Steps to Reproduce

  1. Configure a TIA Portal MCP server (TiaMcpServer) in opencode.json:
{
  "mcp": {
    "tiaportal-mcp": {
      "type": "local",
      "command": [
        "C:\\path\\to\\TiaMcpServer.exe",
        "--tia-major-version",
        "20"
      ],
      "enabled": true,
      "timeout": 30000
    }
  }
}
  1. Start opencode

  2. Observe crash with stack trace

Root Cause Analysis

The MCP server implements prompts that have required arguments (e.g., softwarePath, exportPath, regexName).

When opencode starts, it calls prompts/get for all prompts without passing any arguments. The server throws an ArgumentException instead of gracefully handling missing parameters:

System.ArgumentException: The arguments dictionary is missing a value for the required parameter 'regexName'.

The server returns JSON-RPC error code -32603 (Internal error), which opencode cannot handle properly.

Server Response

  • tools/list and tools/call work correctly
  • prompts/list returns the list of prompts
  • prompts/get fails when called without required arguments

Suggestion

opencode should gracefully handle MCP prompt errors during startup, or provide an option to disable prompt fetching for specific servers.

Environment

  • opencode version: 1.17.20
  • MCP Server: TiaMcpServer v0.0.17.0 (.NET Framework 4.8)
  • OS: Windows 11

Activity

  1. github-actions commented on Jul 15, 2026

    @github-actions
    Contributor

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

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions