Features
- Zero API key — routes prompts through a locally running opencode server, so no provider credentials are needed in your AI client.
- Multi-model support — any model configured in opencode is available; query GPT-4.1, Claude, Gemini, or any other supported provider.
- Model filtering — restrict or block models via
MCP_OPENCODE_MODEL_ALLOWandMCP_OPENCODE_MODEL_BLOCKenvironment variables using glob-style patterns. - Talk to a live session —
list_sessions,sendandreadlet your assistant hold a conversation with a running opencode session, such as the one open in your TUI, and the exchange shows up there live. - Headless jobs —
start_instance,task,wait,list_instancesandstop_instancerun work on a private opencode server per job, with guard rails (no git push, no credentials, no permission prompts) and a ready-madeopencode --servercommand to watch it live. - Auto-start — if opencode's background service is not running,
queryandlist_modelsstart it the same way the TUI does. - Session isolation — each
querycall creates and destroys its own opencode session, so one-off questions leave nothing behind. - Works everywhere — compatible with Claude Desktop, Claude Code, Cursor, Windsurf, VSCode, and any MCP-capable client.
Install
npm install -g @kud/mcp-opencodeRequires opencode 2.x (npm i -g @opencode/cli) with at least one provider configured, and Node.js ≥ 20. For opencode 1.x, stay on @kud/mcp-opencode@1.
Usage
Add the server to your MCP client configuration:
{
"mcpServers": {
"opencode": {
"command": "npx",
"args": ["-y", "@kud/mcp-opencode"]
}
}
}To restrict which models are available, pass environment variables:
{
"mcpServers": {
"opencode": {
"command": "npx",
"args": ["-y", "@kud/mcp-opencode"],
"env": {
"MCP_OPENCODE_MODEL_ALLOW": "github-copilot/*",
"MCP_OPENCODE_MODEL_BLOCK": "github-copilot/gpt-4o-mini"
}
}
}
}