OpenCode
OpenCode does not read claude_desktop_config.json. Put the server in the project opencode.json or opencode.jsonc, or globally in ~/.config/opencode/opencode.json (Windows: %USERPROFILE%\.config\opencode\opencode.json).
Differences from Claude Desktop:
| Claude Desktop | OpenCode | |
|---|---|---|
| Key | mcpServers | mcp |
type | omitted | local (required) |
command | binary, flags in args | one array: binary, flags, paths |
timeout | client default | default 5s is too short for tools/list. Set 30000. |
Quit and restart OpenCode after saving.
Windows:
{ "$schema": "https://opencode.ai/config.json", "mcp": { "filesystem-ultra": { "type": "local", "command": [ "C:\\path\\to\\filesystem-ultra-v4.exe", "--profile", "strict", "--compact-mode", "--cache-size", "200MB", "--parallel-ops", "8", "--log-level", "error", "--log-dir", "C:\\logs\\mcp-filesystem", "--roots-mode", "union", "C:\\your\\project\\" ], "enabled": true, "timeout": 30000 } }}Linux: same shape, with /path/to/filesystem-ultra and a Linux --log-dir.
--roots-mode
Section titled “--roots-mode”Default is replace. OpenCode sends the workspace as MCP Roots and replaces the CLI allowlist with that one folder. A config with many paths will look correct on disk, but list_allowed_directories will only show the workspace.
| Mode | Effect |
|---|---|
replace (default) | Client Roots replace the CLI list. OpenCode: only the workspace. |
union | CLI paths plus the workspace. Use this when the allowlist must survive. |
ignore | CLI list only. Client Roots are ignored. |
Copy examples/harness/ instead of guessing flags. One MCP instance per workspace. One role uses one disk family. Do not mix native Read/Edit with this server. Codex *** Begin Patch is not apply_patch.