Problem
OpenCode uses a different MCP configuration format than Claude Code. Currently:
- Install script only supports Claude Code - Uses
claude mcp add command
- No global config documentation - OpenCode requires manual
~/.config/opencode/opencode.jsonc
- MCP disappears in OpenCode - When not in a project directory with
opencode.jsonc
Symptoms in OpenCode
- "0 MCP" shown in status bar
- Oracle shows as "failed" or "Disabled"
- MCP works in some directories but not others
Root Cause
OpenCode MCP config is per-project by default, unlike Claude Code which loads from ~/.claude.json globally. Without a global config at ~/.config/opencode/opencode.jsonc, MCP servers don't load.
Config Format Differences
| Aspect |
Claude Code |
OpenCode |
| Config file |
~/.claude.json |
~/.config/opencode/opencode.jsonc |
| MCP key |
mcpServers.name |
mcp.name |
| Type field |
Not required |
"type": "local" required |
| Command format |
"command": "bun", "args": [...] |
"command": ["bun", "..."] |
| Global config |
Automatic |
Must create manually |
Working OpenCode Config
Key requirements:
- Use full paths (no
~ expansion in command array)
- Add PATH environment variable
- Use array format for command
Proposed Changes
1. Separate Install Scripts
Keep editor configurations optional and separate from main install:
scripts/
├── install.sh # Main install (clone + bun install only)
├── setup-claude.sh # Claude Code MCP config (optional)
└── setup-opencode.sh # OpenCode MCP config (optional)
Benefits:
- Cleaner main install - just installs the code
- User choice - run only the setup script for their editor
- Easier maintenance - each editor's quirks in separate files
- No bloat - don't check for editors user doesn't have
Usage:
# Install oracle-v2
curl -sSL .../install.sh | bash
# Then configure for your editor:
~/.local/share/oracle-v2/scripts/setup-claude.sh # Claude Code users
~/.local/share/oracle-v2/scripts/setup-opencode.sh # OpenCode users
2. Add docs/OPENCODE.md
Full documentation for OpenCode users covering:
- Why global config is needed
- Config format differences
- Troubleshooting common issues
- Full working example
3. Update README.md
Add OpenCode section to Install documentation with link to docs/OPENCODE.md
Testing
Verified fix on 2026-01-19:
- Created
~/.config/opencode/opencode.jsonc with config above
- Restarted OpenCode
- Oracle MCP now loads from any directory
Related
- Discovered while debugging "MCP disappearing" issue in OpenCode
- Oracle learning:
2026-01-19_opencode-mcp-global-config-required
Problem
OpenCode uses a different MCP configuration format than Claude Code. Currently:
claude mcp addcommand~/.config/opencode/opencode.jsoncopencode.jsoncSymptoms in OpenCode
Root Cause
OpenCode MCP config is per-project by default, unlike Claude Code which loads from
~/.claude.jsonglobally. Without a global config at~/.config/opencode/opencode.jsonc, MCP servers don't load.Config Format Differences
~/.claude.json~/.config/opencode/opencode.jsoncmcpServers.namemcp.name"type": "local"required"command": "bun", "args": [...]"command": ["bun", "..."]Working OpenCode Config
Key requirements:
~expansion in command array)Proposed Changes
1. Separate Install Scripts
Keep editor configurations optional and separate from main install:
Benefits:
Usage:
2. Add
docs/OPENCODE.mdFull documentation for OpenCode users covering:
3. Update
README.mdAdd OpenCode section to Install documentation with link to
docs/OPENCODE.mdTesting
Verified fix on 2026-01-19:
~/.config/opencode/opencode.jsoncwith config aboveRelated
2026-01-19_opencode-mcp-global-config-required