opencode-delegate
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@opencode-delegateUse grok 4.7 from xAI in opencode to implement pagination for /api/users. You review it."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
claude-opencode-delegate
Give Claude every model in your OpenCode install as a delegate: Grok, Kimi, GLM, Qwen, DeepSeek, MiMo, MiniMax, and any other provider you've connected. Claude stays the orchestrator. It plans the work, briefs the other model, reviews the diff, and runs the tests.
you ▸ use grok 4.7 from xAI in opencode to implement the CSV export, you review it
claude ▸ delegate(model: "grok 4.7 from xAI", prompt: "<self-contained brief>")
↳ xai/grok-4.7 edits src/export.ts, runs tests …
claude ▸ reviews git diff, runs `bun test`, and reports backIt works in:
Claude Code (CLI, IDE, desktop): you can ask directly, use
/opencode, use theopencode-workersubagent, or use it from dynamic workflows.Claude Desktop on Linux, macOS, or Windows, as a plain MCP server.
How it works
Claude Code / Claude Desktop / subagent / workflow
│ MCP (stdio)
▼
opencode-delegate MCP server (Bun)
│ spawns
▼
opencode run --format json -m <provider/model> [--auto] [--session …]The server shells out to the opencode CLI, so it uses your existing OpenCode auth, config, agents,
MCP servers, and permission rules. It does not use a separate API.
Related MCP server: opencode-mcp
Requirements
Bun ≥ 1.1
OpenCode v2+ with at least one provider set up. Check that
opencode modelslists something.
Install
Claude Code: plugin (recommended)
/plugin marketplace add aashahin/claude-opencode-delegate
/plugin install opencode-delegate@claude-opencode-delegateThis gives you the MCP server, the opencode-delegate skill, the opencode-worker subagent, and the /opencode command.
Claude Code: MCP server only
git clone https://github.com/aashahin/claude-opencode-delegate ~/.local/share/claude-opencode-delegate
claude mcp add opencode -s user -- bun ~/.local/share/claude-opencode-delegate/dist/index.jsClaude Desktop
Clone the repo as shown above. Then add the server to ~/.config/Claude/claude_desktop_config.json
on Linux, or to ~/Library/Application Support/Claude/claude_desktop_config.json on macOS:
{
"mcpServers": {
"opencode": {
"command": "/home/YOU/.bun/bin/bun",
"args": ["/home/YOU/.local/share/claude-opencode-delegate/dist/index.js"],
"env": { "OPENCODE_DELEGATE_CWD": "/home/YOU/projects/my-app" }
}
}
}Use absolute paths, because Desktop doesn't load your shell PATH. The server searches for
opencode in ~/.opencode/bin, ~/.bun/bin, ~/.local/bin, and /usr/local/bin. If yours is
somewhere else, set OPENCODE_BIN. If your providers read API keys from environment variables (for
example XAI_API_KEY), add those to env too, or add the keys with opencode auth login.
Desktop has no project directory, so either set OPENCODE_DELEGATE_CWD or ask Claude to pass cwd.
Usage
Talk to Claude normally:
"Use grok 4.7 from xAI in opencode to implement pagination for /api/users. You review it."
"Ask kimi k3 via opencode for a second opinion on this diff, read-only."
"Have glm 5.3 and qwen 3.8 max both implement the parser in separate worktrees, then pick the better one."
/opencode deepseek v4 flash -- write unit tests for src/date.ts"Spawn opencode-worker subagents: minimax m3 does the docs, kimi k3 does the tests."
Model names
You can use exact ids (opencode-go/grok-4.7) or loose names (grok 4.7, kimi k3,
deepseek v4 flash).
If the same model is offered by several providers, the model maker's own provider wins over resellers such as
opencode-go,opencode, andopenrouter. Sogrok 4.7resolves toxai/grok-4.7.A provider word in the name overrides that, so "opencode-go grok 4.7" resolves to
opencode-go/grok-4.7. To set your own order, useOPENCODE_DELEGATE_PREFERRED_PROVIDERS.A version you name must match exactly, so
grok 4.7never silently becomes 4.6.If a name matches several different models, you get a list of candidates instead of a guess. For example,
mimomatches several MiMo models.Add
#variantfor a reasoning variant:xai/grok-4.7#high.If you don't name a model, tasks that edit files use
opencode-go/muse-spark-1.3-contributor. Read-only tasks (auto: false) use the freeopencode/muse-spark-1.3-contributor-free. You can change both with the env vars below.
Tools
Tool | What it does |
| Lists the |
| Runs a task and waits for it. Returns the response, |
| Same as |
| Collect results (with |
| Lists recent opencode sessions, so you can find one to continue. |
delegate and delegate_async take these arguments:
promptandmodelcwdandagent(for examplebuild,plan, or your own agents)filesto attachsession_id,continue, orforkto follow up in an earlier sessionauto,title, andtimeout_s
Permissions
By default the delegated model runs with --auto. It can edit files and run commands without
asking, but any rule you set to deny in your OpenCode config is still enforced. Pass
auto: false, or set OPENCODE_DELEGATE_AUTO=false, for read-only runs. Claude is told to review
every change it gets back.
Using it from workflows
Workflow agent() calls and subagents can use the MCP tools directly or through the opencode-worker
agent. If you fan out tasks that edit files, give each one its own git worktree so they don't
conflict.
Configuration (env vars)
Variable | Default | |
| auto-detected | Path to the |
|
| Model used when |
|
| Model used when |
|
| Default for |
|
| Seconds before a run is killed. |
|
| Maximum number of response characters returned to Claude. |
| the server's cwd | Base directory for |
| (none) | Comma-separated provider order used when a model is offered by several providers, e.g. |
Development
bun install
bun test # unit tests (fixtures captured from real `opencode run --format json`)
bun run typecheck
bun run build # bundles to dist/index.js, which is committed so installs need no build step
bun run start # run the server from sourceTo debug interactively, use bunx @modelcontextprotocol/inspector bun dist/index.js.
License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Paid remote MCP for Claude Code skill update gate MCP, structured receipts, audit logs, and reviewer
One MCP endpoint for Claude, GPT & Gemini: 100+ tools + no-code connectors + agent workers.
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
One identity across Claude Code, Codex, Cursor, Gemini, Windsurf: shared inbox and handoffs.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables Claude to delegate tasks to OpenAI expert models (GPT-5.3-Codex and GPT-5.5) as subagents, with orchestration patterns for safe and effective use.3MIT
- AlicenseAqualityBmaintenanceEnables Claude Code to delegate tasks to OpenCode subagents asynchronously, with tools for starting tasks, polling status, and fetching results.772 npm2MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to delegate prompts to an OpenCode agent session for cheaper executor-role work, supporting different providers and session persistence.17,832 npmMIT
- AlicenseAqualityCmaintenanceLets Claude Code delegate tasks to OpenRouter-backed Claude Code sessions in isolated child processes, keeping Anthropic and OpenRouter credentials separate. It adds a model catalog, per-job cost tracking, and API-key management for running tasks on 400+ OpenRouter models.76 npmMIT