Skip to content

Using with OpenCode

OpenCode reads MCP servers from <project>/opencode.json. The OpenCode schema nests servers under a top-level mcp key with a type: "local" discriminator. codehub setup writes the correct shape for you.

write opencode.json in the current project
codehub setup --editors opencode

The writer merges a codehub entry into the existing mcp object.

Prerequisite: codehub must be on your PATH — run mise run cli:link from a checkout, or mise run cli:install-global to install the packed tarball. See Install.

The entry looks like:

opencode.json
{
"mcp": {
"codehub": {
"type": "local",
"command": ["codehub", "mcp"],
"enabled": true
}
}
}

Reload OpenCode after the first write. The server runs over stdio for the session.

--editors accepts any comma-separated subset of claude-code,cursor,codex,windsurf,opencode. The default is all five.

wire OpenCode alongside Claude Code
codehub setup --editors opencode,claude-code
remove only the codehub entry
codehub setup --editors opencode --undo

--undo removes only the codehub entry from opencode.json. Other MCP servers configured there are left alone.

  • MCP tools — the catalogue of 29 tools OpenCode will see.