š Introduction
Query any opencode model from your AI assistant ā no API key required. A zero-key bridge that delegates all authentication to opencode.
mcp-opencode is an MCP server that lets your AI assistant query any model your local opencode install is configured for ā anthropic, github-copilot, google-vertex, and any other provider ā without ever handling an API key.
It acts as a thin bridge: your assistant calls a tool, the server forwards the prompt to opencode's local HTTP server, and the response comes back. opencode owns the credentials; this server never sees them.
š The zero-key delegation model
Most MCP servers that talk to model providers need their own API tokens, stored in config or environment variables. mcp-opencode takes a different approach:
- No tokens here ā you configure your providers once in opencode (via
opencode auth), and this server inherits them automatically. - No secrets in flight ā no credentials are stored in or passed through the MCP server. Authentication is delegated entirely to opencode's own config.
- One source of truth ā the models you can query are exactly the models
opencode knows about. Run
opencode modelsto see the same list the server exposes.
This means you get a second-opinion model, a cheaper model for bulk work, or a different provider's flagship ā all from inside your assistant, with zero extra auth setup.
⨠Features
- Query any model ā send prompts to anthropic, github-copilot, google-vertex, and any other provider you've configured in opencode.
- Discover models ā list every model opencode knows about, optionally filtered by provider.
- Zero config auth ā no API tokens; authentication is delegated entirely to opencode.
- Auto-start ā spins up the opencode server automatically if it isn't already running.
- Allow/block filters ā restrict which models are accessible via
MCP_OPENCODE_MODEL_ALLOW/MCP_OPENCODE_MODEL_BLOCK. - Works with any opencode provider ā whatever you've configured, you can query.
ā Prerequisites
- opencode installed, with at least one provider configured.
- Node.js ā„ 20.
š¦ Install
npm install -g @kud/mcp-opencodeThen register it with your AI client. For Claude Desktop, edit the config:
{
"mcpServers": {
"opencode": {
"command": "npx",
"args": ["-y", "@kud/mcp-opencode"]
}
}
}The same command / args pair works for Cursor, Windsurf, VSCode (Copilot),
and the Claude Code CLI ā only the surrounding config file differs.
š¬ Example conversations
"What models do I have access to?" ā Calls
list_models, returns all configured models grouped by provider.
"List only my Anthropic models." ā Calls
list_modelswithprovider: "anthropic".
"Ask GPT-4.1 via Copilot to explain what a monad is." ā Calls
querywithmodel: "github-copilot/gpt-4.1".
"Use Claude Sonnet to review this diff and suggest improvements." ā Calls
querywithmodel: "anthropic/claude-sonnet-4-6"and the diff as the prompt.
"Get a second opinion from Gemini on this architecture decision." ā Calls
querywithmodel: "google-vertex/gemini-2.5-pro".
Head to Tools for the full reference, or How it works to understand the bridge.