openwork icon indicating copy to clipboard operation
openwork copied to clipboard

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

Open AdJIa opened this issue 9 months ago • 4 comments

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 令狐冲 [email protected]

AdJIa avatar Feb 05 '26 07:02 AdJIa

thx for reporting @AdJIa this is a pretty annoying bug and i will try to review it tomorrow!

benjaminshafii avatar Feb 05 '26 07:02 benjaminshafii

this should be fixed in all latest builds

src-opn avatar Apr 13 '26 18:04 src-opn

Just wanted to say that the issue still seem to be there for me in the latest Release (https://github.com/different-ai/openwork/releases/tag/v0.18.35).

Klemet avatar Aug 25 '26 08:08 Klemet

Nevermind, it seems to be fixed after a couple of re-launches 😁 !

Klemet avatar Aug 25 '26 10:08 Klemet