claude-opencode-delegate MCP server
Commit Sep 23, 2026Allows Claude to delegate coding tasks to various OpenCode models like Grok, DeepSeek, and Qwen while maintaining orchestration and review.
Also known as aashahin/claude-opencode-delegate
- Stars
- 6
- Tools
- 4
- Downloads, 30 days
- —
- Latest version
- —
- Last commit
- Sep 23, 2026
- License
- MIT
What is claude-opencode-delegate MCP?
claude-opencode-delegate allows Claude to delegate coding tasks to various OpenCode models like Grok, DeepSeek, and Qwen while maintaining orchestration and review. It exposes 4 tools, such as list_models, delegate, delegate_async.
Summary generated from the project's README
About claude-opencode-delegate MCP server
Delegating coding tasks to specialized models like Grok, DeepSeek, or Qwen while keeping Claude as the central orchestrator is what this server enables. It allows developers to use Claude Code or Claude Desktop to command various OpenCode providers to implement features, write tests, or provide second opinions on code diffs. Claude remains in control by planning the work, briefing the delegated model, and reviewing the resulting changes or test outputs.
The server functions by shelling out to the existing OpenCode CLI, meaning it utilizes your current OpenCode authentication, configurations, and permission rules without requiring separate API keys. It is compatible with Claude Code via a plugin or as a standard MCP server for Claude Desktop on Linux, macOS, and Windows. Users can manage tasks through specific tools like delegate, delegate_async, and task_result to handle both immediate requests and long-running background jobs.
This setup is ideal for developers who want to harness the specific strengths of different LLMs for different parts of a development workflow. By using the opencode-worker subagent or the /opencode command, you can fan out tasks across multiple models simultaneously to compare results or handle documentation and testing in parallel.
What you can do with it
- 1Implement features with specific modelsAsk Claude to use a specific model from your OpenCode installation to write new code and then review the output.
- 2Perform parallel coding tasksDirect Claude to assign different models to handle documentation and testing tasks at the same time.
- 3Compare model implementationsHave multiple models implement the same parser in separate worktrees to determine which one performs better.
- 4Get secondary code reviewsRequest a second opinion on a code diff using a read-only model via OpenCode.
Written from the project's README. Every use case is checked against a quote from it.
claude-opencode-delegate MCP tools 4
Detected from the READMElist_modelsdelegatedelegate_asynclist_sessions
Configuration
OPENCODE_DELEGATE_CWD
Automated checks
Ran Nov 14, 2026Full report →Not verified yet. A server needs a score of 80, no serious finding, and enough data for us to check. How checks work · What to fix for more points
- Source repository linked and reachableaashahin/claude-opencode-delegate is public and reachablegithub.com/aashahin/claude-opencode-delegate ↗Pass
- Package names this repository as its sourceNot checked
- Build provenance (Sigstore attestation)Not checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-09-23github.com/aashahin/claude-opencode-delegate ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNot checked
- No critical advisory in the package or its dependenciesNot checked
- No hidden instructions to the model4 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubclaude-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 back
It 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.
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-delegate
This 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.js
Claude 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 |
|---|---|
list_models |
Lists the opencode models output. Takes an optional filter. |
delegate |
Runs a task and waits for it. Returns the response, session_id, token usage, tools used, and git changes. |
delegate_async |
Same as delegate, but returns a task_id right away. Use it for long jobs and parallel fan-out. |
task_result / task_list / task_cancel |
Collect results (with wait_s), list tasks, or stop a background task. |
list_sessions |
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 | |
|---|---|---|
OPENCODE_BIN |
auto-detected | Path to the opencode executable. |
OPENCODE_DELEGATE_DEFAULT_MODEL |
opencode-go/muse-spark-1.3-contributor |
Model used when model is omitted. Set it to "" to use opencode's own default. |
OPENCODE_DELEGATE_READ_MODEL |
opencode/muse-spark-1.3-contributor-free |
Model used when model is omitted and auto is false (reading files, reviews, questions). Free by default. |
OPENCODE_DELEGATE_AUTO |
true |
Default for auto. |
OPENCODE_DELEGATE_TIMEOUT |
1800 |
Seconds before a run is killed. |
OPENCODE_DELEGATE_MAX_OUTPUT |
40000 |
Maximum number of response characters returned to Claude. |
OPENCODE_DELEGATE_CWD |
the server's cwd | Base directory for cwd. |
OPENCODE_DELEGATE_PREFERRED_PROVIDERS |
(none) | Comma-separated provider order used when a model is offered by several providers, e.g. xai,opencode-go. Without it, the model maker's own provider beats resellers. |
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 source
To debug interactively, use bunx @modelcontextprotocol/inspector bun dist/index.js.
License
MIT
claude-opencode-delegate MCP questions
What tools does claude-opencode-delegate MCP provide?
It exposes 4 tools, including list_models, delegate, delegate_async, list_sessions.
Does this server use its own API keys?
No, it shells out to the opencode CLI and uses your existing OpenCode authentication, configuration, and permission rules.
Can I use this with Claude Desktop?
Yes, it can be used as a plain MCP server on Linux, macOS, or Windows by adding it to your Claude Desktop configuration file.
How do I specify which model to use?
You can use exact IDs or loose names like 'grok 4.7' or 'deepseek v4 flash' in your prompts.