Skip to content

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 DesktopOpenCode
KeymcpServersmcp
typeomittedlocal (required)
commandbinary, flags in argsone array: binary, flags, paths
timeoutclient defaultdefault 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.

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.

ModeEffect
replace (default)Client Roots replace the CLI list. OpenCode: only the workspace.
unionCLI paths plus the workspace. Use this when the allowlist must survive.
ignoreCLI 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.