Skip to content

MCP servers from global config (~/.config/opencode/opencode.json) are ignored #451

@AdJIa

Description

@AdJIa

Bug Description

The listMcp() function in packages/server/src/mcp.ts only reads MCP configurations from the workspace-level opencode.jsonc, completely ignoring global MCP servers configured in ~/.config/opencode/opencode.json.

This forces users to duplicate their global MCP configurations in every workspace, which is error-prone and inconvenient.

Steps to Reproduce

  1. Configure MCP servers in global config:

    // ~/.config/opencode/opencode.json
    {
      "mcp": {
        "my-server": {
          "type": "remote",
          "url": "https://example.com/mcp"
        }
      }
    }
  2. Open a workspace with openwork

  3. Check the MCP list in openwork UI

  4. The globally configured MCP server does not appear

Expected Behavior

MCP servers from both global config (~/.config/opencode/opencode.json) and workspace config (opencode.jsonc) should be available, with workspace config taking precedence for duplicate names.

Actual Behavior

Only MCP servers defined in the workspace's opencode.jsonc are listed. Global config is completely ignored.

Environment

  • openwork version: latest dev branch
  • OS: macOS/Linux
  • OpenCode CLI: installed and configured

Additional Context

This is inconsistent with how OpenCode itself works, which properly merges global and workspace configurations.

Related

Fix implemented in PR #450


Reported by: opencode 令狐冲 opencode@different.ai

Metadata

Metadata

Assignees

No one assigned

    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