Built-in MCP injection overrides user-defined MCP entries with the same key
Author: RandylinuxCreated Sep 24, 2026Updated Sep 24, 2026
Built-in MCP injection overrides user-defined MCP entries (same key) and ignores user config
Environment
- oh-my-opencode-slim 2.2.24
- OpenCode 1.18.32
Problem
The plugin injects built-in MCP servers into the resolved OpenCode config:
src/mcp/grep-app.ts→gh_grep = { type: "remote", url: "https://mcp.grep.app", oauth: false }src/mcp/context7.ts→context7 = { type: "remote", url: "https://mcp.context7.com/mcp", ... }
When the user already defines an entry with the same key (e.g. mcp.gh_grep in
opencode.jsonc), the injected definition wins and the user's url, headers and
timeout are ignored.
Evidence
opencode debug config(plugins enabled) reports the injected URL even though the user config had a different URL.opencode debug config --pure(plugins disabled) reports the user's URL — proving the override comes from the plugin.- Editing
headers/timeoutformcp.gh_grepin the user config had no effect.
Workaround
{ "disabled_mcps": ["gh_grep", "context7"] }in oh-my-opencode-slim.json, then define the MCPs yourself.
Suggestions
- Merge instead of replace: let the user entry win for
url/headers/timeout(or only inject defaults for fields the user did not set). - Only inject a built-in MCP when the key is not already present in the config.
- Mention the
disabled_mcpsoption in the docs for exactly this case.
Source: alvinunreal/oh-my-opencode-slim