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 anopencode attachcommand to watch it live. - Auto-start — if opencode is not already listening on the configured port (default 4096), the server spawns
opencode serveon that port in the background. - 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 installed with at least one provider configured, and Node.js ≥ 20.
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"
}
}
}
}