-
Notifications
You must be signed in to change notification settings - Fork 895
Description
Bug Description
The listMcp() function in packages/server/src/mcp.ts only reads MCP configurations from the workspace-level opencode.json(c), 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
-
Configure MCP servers in the global config:
// ~/.config/opencode/opencode.json { "mcp": { "my-server": { "type": "local", "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/tmp"] } } }
-
Open a workspace that has no workspace-level
opencode.json -
Open the MCP panel in OpenWork
Expected: my-server appears in the MCP list
Actual: MCP panel is empty
Root Cause
listMcp() in packages/server/src/mcp.ts reads only:
const { data: config } = await readJsoncFile(opencodeConfigPath(workspaceRoot), ...);There is no fallback to the global config at ~/.config/opencode/opencode.json.
Expected Behaviour
Global MCPs should be merged with project MCPs. Project-level entries take precedence over global ones (same name → project wins). Each item should carry the correct source field ("config.global" vs "config.project") so the UI can distinguish them.