claude-opencode-mcp-v2
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., "@claude-opencode-mcp-v2Delegate to the coder: fix the failing auth tests, then show me the diff"
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-mcp
claude-opencode-mcp-v2 is a port of putuandy/claude-opencode-mcp (MIT) to the OpenCode 2.x HTTP API (
/api/*, tested on 2.0.22). It does not work with OpenCode 1.x. Differences: one shared server for all workspaces, SSE-based completion, diffs from the server, agents namedresearcher/reviewer/coder/tester(the olddeepseek-*names are still accepted). See docs/v2-migration.md and research/FINDINGS.md. Status: alpha.
An MCP server that lets Claude Code delegate software-engineering tasks to OpenCode agents — with the model and provider you choose — while keeping every agent inside the same workspace/worktree.
Claude Code (orchestrator)
│ MCP
▼
claude-opencode-mcp (this bridge)
│ workspace + task + agent
▼
OpenCode (agent runtime: tools, sessions, permissions)
│
▼
your model provider (anything configured in OpenCode)
│
▼
your repository — the same working tree Claude Code is usingClaude Code stays in charge: it decomposes the work, picks agents, reviews the results and integrates changes. OpenCode does the repository exploration, editing and test execution. The bridge is deliberately thin.
Features
Seven focused MCP tools —
delegate_task,create_session,send_message,get_session,get_diff,abort_session,list_agents.Same worktree — the delegated OpenCode server runs with your project as its working directory; the agent reads and edits the real files.
Persistent sessions — follow-up messages keep the agent's context across separate MCP calls.
Four agent profiles — researcher, reviewer, coder, tester, each with permissions enforced by OpenCode (not by prompt wording).
Workspace boundaries — canonical paths, allowed roots, path-traversal rejection, and a per-run probe that proves the server is serving the right directory.
Safety defaults —
.env/credential protection,git commit/git pushdenied, external directories denied, noaskrules that could hang a headless run.Structured results — every tool returns JSON with stable error codes, and
get_diffgives Claude Code the exact changes a coding session made.Reliability — timeouts, cancellation, health checks, crash detection, graceful shutdown, request IDs and a rotating log file.
Related MCP server: mcp-opencode
Requirements
Component | Version |
Node.js | 20 or newer |
recent 2.x | |
2.x (tested against 2.0.22; 1.x is not supported) | |
Model provider | Any provider configured in OpenCode. None is assumed: your OpenCode default model, or one you set per agent |
Install
The package is published on npm (alpha channel):
npm install -g claude-opencode-mcp-v2@alphaor run it on demand with npx -y claude-opencode-mcp-v2@alpha (recommended for
.mcp.json). It installs two executables, claude-opencode-mcp-v2 (the MCP
server) and claude-opencode-v2 (same binary).
The bridge finds OpenCode in PATH, in node_modules/.bin, in
~/.opencode/bin, or at an explicit OPENCODE_BIN / opencode.binary.
From source
git clone https://github.com/choruzo/claude-opencode-mcp-v2.git
cd claude-opencode-mcp-v2
npm install
npm run build
npm install -g .Claude Code setup
Option A — project .mcp.json (recommended)
Create .mcp.json in your project root:
{
"mcpServers": {
"opencode": {
"command": "npx",
"args": ["-y", "claude-opencode-mcp-v2@alpha"],
"type": "stdio",
"timeout": 600000
}
}
}timeout is milliseconds and is a per-tool-call wall-clock limit. Delegated
runs are long; without it Claude Code falls back to MCP_TOOL_TIMEOUT.
Claude Code also moves main-conversation tool calls to a background task after
two minutes, which is fine — the result arrives when the run finishes.
Option B — claude mcp add
claude mcp add opencode --scope project -- npx -y claude-opencode-mcp-v2@alphaOr for one machine only:
claude mcp add opencode --scope user -- npx -y claude-opencode-mcp-v2@alphaVerify:
claude mcp list # opencode ... ✔ ConnectedInside Claude Code, /mcp shows the server and its seven tools.
The bridge reads
CLAUDE_PROJECT_DIR, which Claude Code sets for stdio MCP servers, so delegation defaults to the project you launched Claude Code in.
OpenCode setup
The bridge starts and stops its own headless OpenCode server, so you do not need
to run opencode serve yourself. You only need OpenCode 2.x installed and at
least one provider authenticated.
Install OpenCode 2.x and check the version
opencode --version # 2.xAuthenticate a provider (once), or define it in your OpenCode config
opencode auth loginList the models you can use — the ids you will put in the bridge config are
provider/model:opencode models # nan/deepseek-v4-flash # nan/glm5.3-flash # ...(Optional) validate the project
cd my-project claude-opencode-v2 initinitonly creates.claude-opencode/and validates the environment; it never modifies source code and is not required for delegation.
The OpenCode server started by the bridge also loads your global OpenCode config (
~/.config/opencode), including its MCP servers and providers.
If you prefer to control OpenCode yourself, start opencode serve and point
the bridge at it with opencode.url (plus opencode.password or
OPENCODE_SERVER_PASSWORD, user opencode); see
docs/configuration.md.
Choose a model per agent
Nothing is assumed: if you configure nothing, every agent uses your own default
model in OpenCode. To pick models, create ~/.config/claude-opencode-mcp/config.json
(all projects) or .claude-opencode/config.json in a project:
{
"agents": {
"researcher": { "model": "nan/deepseek-v4-flash" },
"reviewer": { "model": "nan/deepseek-v4-flash" },
"tester": { "model": "nan/deepseek-v4-flash" },
"coder": { "model": "nan/glm5.3-flash" }
}
}Use the exact provider/model ids from opencode models. Order of precedence:
the model argument of a tool call, then agents.<name>.model, then
defaults.model, then your OpenCode default. A bare id (no provider/) is looked up
in OpenCode's catalog and must match exactly one provider. Full reference:
docs/configuration.md and
docs/agent-configuration.md.
Quick start
Restart Claude Code, then ask:
Use the
opencodeMCP server to haveresearchermap this repository: entry points, main modules, and where authentication lives.
Then something that edits:
Have
coderadd input validation tosrc/api/users.ts, run the tests, and report what changed. Then show me the diff withget_diff.
And a full workflow:
Ask the agents to inspect the authentication system, identify potential issues, implement a fix, and review the changes.
Claude Code typically orchestrates: researcher → coder
→ reviewer → tester, calling get_diff between steps.
Tools
All tools return JSON in content[0].text (mirrored in structuredContent).
Errors return isError: true with { "error": { "code", "message", ... } }.
delegate_task
Run one task in a fresh session and wait for the agent's answer.
{
"task": "Review the authentication implementation for bugs and security issues.",
"agent": "reviewer",
"cwd": "/Users/andy/projects/my-app",
"paths": ["src/auth", "src/middleware", "tests/auth"],
"model": "deepseek/deepseek-v4-pro",
"timeout": 600000,
"allow_edits": false
}Returns { status, session_id, agent, cwd, model, summary, findings, files_changed, duration_ms, truncated, error? }.
pathsare exploration hints, not a boundary — the agent may inspect the whole workspace.allow_edits/allow_bashgrant or revoke edits and shell commands for the run (safe permission profiles; sensitive files and git history stay protected).findingsare parsed from a## Findingssection:- [severity: high] Title (path/to/file:42) — detail.
create_session
{ "cwd": "/abs/path", "agent": "researcher", "model": null, "title": "auth investigation", "allow_edits": true }Returns { session_id, cwd, agent, model, title, status, can_edit, can_run_bash, created_at }.
Permission overrides set here persist for the session.
send_message
Continue a session; the agent keeps its context and permission level.
{ "session_id": "ses_...", "message": "Now implement the fix.", "allow_edits": true }allow_edits / allow_bash may change the level from this message onward.
get_session
Returns the stored session state plus live OpenCode status
(opencode.status is idle, busy or retry when a server is running).
get_diff
Returns the changes associated with a session:
OpenCode's own session diff when the server reports one, otherwise
a git diff against a baseline captured when the session was created, so pre-existing uncommitted work is not attributed to the agent.
Returns { source, files, diff, truncated, note? }.
abort_session
Stops a running delegation. Safe to call when the session is idle.
list_agents
Lists the built-in agents plus project-local agents from
.claude-opencode/agents/, with read_only, can_edit, can_run_bash flags.
Agents
Agent | Purpose | Edit default | Shell default |
| architecture, exploration, dependency analysis, recommendations | deny | deny |
| code review, bugs, regressions, security, architecture | deny | deny |
| implementation, refactoring, running tests and fixing failures | allow | allow (no |
| run tests, inspect failures, root causes, suggested fixes | deny | allow (no |
The orchestrator is not limited to those defaults: every tool that starts or
continues a run accepts allow_edits and allow_bash (true grants, false
revokes, omitted keeps the default). Grants map to safe permission profiles, so
allow_edits: true still protects .env/credential files and allow_bash: true
still denies git history changes. A researcher with write access is one call:
{
"agent": "researcher",
"task": "Investigate the caching layer, then implement and test the fix.",
"allow_edits": true,
"allow_bash": true
}Agent prompts live in agents/ and are loaded into the OpenCode
server configuration at startup. Project-local copies in
.claude-opencode/agents/*.md override the prompt, description, model and
temperature; permissions always come from the bridge policy (configurable
through security.* and the per-call overrides).
See docs/agent-configuration.md for frontmatter details and custom agents.
Workspace model
Resolution order for every call:
explicit
cwdargumentCLAUDE_PROJECT_DIR(set by Claude Code)the MCP server process working directory
workspace.defaultCwdfrom configuration
The first two are required: if they are present but invalid, the call fails instead of silently using a different directory.
Validation happens before any session is created:
the path must exist, be a directory, and be readable;
it is canonicalized with
realpath;when
workspace.allowedRootsis set, the canonical path must live inside one of those roots (traversal is rejected);the git root is detected for diff isolation.
During the first request for a workspace the bridge reads back directory from
the OpenCode server and compares it with the requested path, so a misrouted
request can never reach the wrong repository.
A single OpenCode 2 server is started (or opencode.url is used) and shared by
all workspaces; each session is bound to its directory through location.directory.
Security
Control | Default | Where |
Workspace must exist, be readable, be a directory | always | bridge |
| disabled (empty) | config |
Path hints cannot escape the workspace | always | bridge |
| on, even when edits are granted | OpenCode permissions |
| denied, even when shell is granted | OpenCode permissions |
Paths outside the workspace | denied | OpenCode |
Subagent spawning ( | denied | OpenCode permissions |
Interactive questions ( | denied (headless) | OpenCode permissions |
| never emitted by the bridge | OpenCode permissions |
The bridge also listens to OpenCode's event stream and auto-rejects any permission request that would otherwise wait for a human, so a delegated run can never hang on approval.
Caveats, stated plainly:
A shell-enabled agent (
coder,tester) can technically write files through shell commands. The bridge denies theedittools for the tester and forbids git history changes for both, but shell access is inherently powerful..envprotection applies to the file tools. A shell-enabled agent could stillcata file throughbash; the OpenCode project permission model has the same property.When connecting to an external OpenCode server (
opencode.url), the bridge cannot inject agent permissions. It verifies the agents exist and refuses to run otherwise.
Details and hardening options: docs/security.md.
Configuration
Global file: ~/.config/claude-opencode-mcp/config.json (honours
XDG_CONFIG_HOME).
Project file: <project>/.claude-opencode/config.json (overrides global).
Extra file: CLAUDE_OPENCODE_CONFIG=/path/to/config.json (highest precedence).
{
"opencode": {
"url": null,
"autoStart": true,
"hostname": "127.0.0.1",
"port": 0,
"startupTimeout": 30000,
"binary": null,
"username": null,
"password": null
},
"workspace": {
"allowedRoots": [],
"defaultCwd": null
},
"defaults": {
"agent": "researcher",
"provider": null,
"model": null
},
"timeouts": {
"execution": 600000
},
"security": {
"protectEnvFiles": true,
"denyGitPush": true,
"denyGitCommit": true,
"externalDirectory": "deny",
"extraProtectedPatterns": []
},
"limits": {
"summaryChars": 6000,
"sessionChars": 20000,
"diffChars": 60000
},
"agents": {
"researcher": { "model": "deepseek/deepseek-v4-pro" }
}
}defaults.modelacceptsprovider/modelor a bare model id (completed withdefaults.providerif set, otherwise looked up in OpenCode's catalog; ambiguous ids are rejected). Whennull, your own default model from OpenCode is used.Provider credentials stay in OpenCode (
opencode auth login) or environment variables; they are never duplicated in this config.For auto-started servers the bridge passes
OPENCODE_SERVER_USERNAME/OPENCODE_SERVER_PASSWORDthrough and authenticates its own requests. For external URLs it only uses credentials you configure.
Full reference: docs/configuration.md.
Sessions
Sessions are OpenCode sessions; the bridge keeps a small registry at
~/.local/state/claude-opencode-mcp/sessions.json(override withCLAUDE_OPENCODE_STATE_DIR) soget_session,get_diffandsend_messagesurvive a bridge restart.Records older than 14 days are pruned at startup.
If an OpenCode server restarts, persisted sessions are still addressable;
get_sessionreports live status when a server is running.Logs:
~/.local/state/claude-opencode-mcp/bridge.log(rotated at 5 MB). SetCLAUDE_OPENCODE_LOG=debug|info|warn|error|silent.
Troubleshooting
Symptom | Fix |
|
|
| run |
| authenticate a provider ( |
| The provider credentials are missing or expired; re-run |
| add the four agents to that server's config or stop using |
| raise |
| add the project to |
Tool call seems to hang in Claude Code | Claude Code backgrounds long calls after 2 minutes; progress notifications are sent, and the bridge always resolves or aborts — check |
Claude Code kills the call at 60s | set |
More: docs/troubleshooting.md.
Development
npm install
npm run lint # Biome
npm run typecheck
npm test # unit + integration (no OpenCode needed)
npm run buildReal end-to-end tests need an OpenCode 2.x install with a provider authenticated:
npm run test:e2e # checkpoints: workspace, agents, sessions, diff, abort, stdio
CLAUDE_OPENCODE_E2E_WORKFLOW=1 npm run test:e2e # full researcher → coder → reviewer → tester workflowLayout:
src/
index.ts CLI entry (MCP server + `init`)
cli/ `claude-opencode-v2 init`
config/ configuration loading and merging
workspace/ resolver, validator, task context
security/ path policy + OpenCode permission profiles
opencode/ binary resolution, manager, client, agents, sessions, runner
mcp/ MCP server and the seven tools
agents/ built-in agent prompts
tests/ unit, integration, e2e
docs/ documentationSee docs/development.md and docs/architecture.md.
Documentation
Contributing
Bug reports, feature requests, and pull requests are welcome. Start with CONTRIBUTING.md; for vulnerabilities use SECURITY.md instead of a public issue.
License
MIT — see LICENSE.
Available Tools
7 toolsabort_sessionAbort a running delegated sessionADestructive
Stop a long-running or unwanted delegated task. Safe to call when the session is already idle.
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Session id returned by delegate_task/create_session. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare destructiveHint=true, so the destructive nature is covered structurally. The description adds a useful nuance—that calling it on an idle session is safe—which goes beyond the annotation. However, it does not disclose whether aborting is irreversible, whether a running computation is killed, or what happens to partial results.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences, no filler, and the core action is stated first. The safety note is useful and earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter destructive action with no output schema, the description is nearly complete: it states purpose and a safe-call condition. It could be slightly richer by explaining the post-abort state of the session, but an agent can invoke this tool correctly with what is provided.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, and the single parameter session_id is already fully documented as the session id returned by create_session. The tool description adds no further parameter guidance, so the baseline score of 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Stop') with a clear resource ('a long-running or unwanted delegated task'), and the title names the action and object. It is immediately distinguishable from siblings like create_session and get_session.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear signals about when to use it: for long-running or unwanted delegated tasks. It also provides a useful safety condition ('Safe to call when the session is already idle'). It does not explicitly name alternatives or describe when not to use it, but the context is sufficient for most selection decisions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
create_sessionCreate a persistent OpenCode agent sessionA
Create a persistent delegation session in a workspace without running a task yet. Follow up with send_message to keep the agent's context between calls.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | Workspace directory for the session. | |
| agent | No | Agent to use (default: researcher). See list_agents. | |
| model | No | Override the model as "provider/model" (default: the agent or user default). | |
| title | No | Human-readable session title. | |
| allow_bash | No | Grant (true) or revoke (false) shell commands for this session. | |
| allow_edits | No | Grant (true) or revoke (false) file edits for this session. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations supply only openWorldHint=true, so safety/lifecycle behavior is mostly unspecified. 'Persistent' and 'keep the agent's context between calls' disclose server-side state retention, which is real added value, but nothing is said about session lifetime, default permissions, or the effect of the allow_bash/allow_edits grants.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, zero filler. The purpose is front-loaded and the follow-up instruction is packed into the second sentence without redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a six-parameter session-creation tool with thin annotations and no output schema, the description omits what the call returns (a session identifier presumably needed for send_message) and says nothing about permissions defaults. Purpose and next step are covered, but the agent lacks enough to use the result confidently.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so all six parameters (cwd, agent, model, title, allow_bash, allow_edits) are already documented in the schema with defaults and cross-references to list_agents. The description adds no parameter-level detail beyond that, so the baseline 3 applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb+resource: creating a persistent delegation session in a workspace. The clause 'without running a task yet' usefully separates it from the task-executing sibling delegate_task, though it never names that sibling explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly directs the follow-up step ('Follow up with send_message to keep the agent's context between calls'), which is the key lifecycle guidance. It does not state the converse case for delegate_task or list any exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delegate_taskDelegate task to OpenCode agentA
Delegate a software-engineering task to an OpenCode agent (DeepSeek by default) that runs in the same workspace. The agent explores the repository itself and returns a concise summary plus structured findings. Every agent can be granted or denied edits and shell access per call with allow_edits / allow_bash; grants still enforce the bridge security policy (sensitive-file protection for edits, no git history changes for shell). Returns { status, session_id, summary, findings, files_changed }.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Workspace directory. Defaults to CLAUDE_PROJECT_DIR / the server working directory. | |
| task | Yes | The task to delegate, written as a clear instruction. | |
| agent | No | Agent to use (default: researcher). See list_agents. | |
| model | No | Override the model as "provider/model" (default: the agent or user default). | |
| paths | No | Starting path hints relative to the workspace. Hints only, not a restriction. | |
| timeout | No | Execution timeout in milliseconds (default from bridge config). | |
| allow_bash | No | Grant (true) or revoke (false) shell commands for this call. Omit to use the agent's default. | |
| allow_edits | No | Grant (true) or revoke (false) file edits for this call. Omit to use the agent's default. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The only annotation is openWorldHint=true, so the description carries the burden and does so well: it discloses the security policy that still applies to grants (sensitive-file protection for edits, no git history changes for shell), that grants are per call, and what the agent returns. This is behavioral context the annotations cannot supply.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, front-loaded with the core action and the return contract, with no filler. Dense but each clause earns its place; the security caveat could be tightened slightly.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For an 8-parameter tool with no output schema, the description supplies the return keys and the permission model well. It omits how the returned session_id relates to the sibling tools (e.g. whether the session can be continued via send_message), which is a meaningful gap given the sibling set.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3, but the description adds real meaning beyond the schema by explaining that allow_edits/allow_bash are per-call grants that remain subordinate to the bridge security policy, and that paths are hints not restrictions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource ('Delegate a software-engineering task to an OpenCode agent') and describes the execution model (runs in the same workspace, explores the repository itself). Clearly distinguishable from the session-management siblings like create_session and send_message.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies when to use it (offload a self-contained engineering task to a sub-agent) and notes per-call permission grants, but never names an alternative or a when-not condition. With siblings like send_message and get_diff available, the agent must infer that this is for new delegated work rather than continuing an existing session.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_diffInspect changes made in a sessionBRead-only
Return the file changes made by a delegated session, as reported by OpenCode (GET /api/session/{id}/diff).
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Session id returned by delegate_task/create_session. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
readOnlyHint=true already tells the agent this is a safe read, so the bar is lower. The description adds that the diff is sourced from OpenCode via a specific endpoint, which is useful context, but says nothing about diff format, size limits, or behavior for sessions that made no changes.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
One tight sentence with the core action front-loaded; the trailing endpoint parenthetical earns its place by naming the data source, though it could be trimmed.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a one-parameter read operation with no output schema, the definition covers the essentials. However, the actual return shape of a 'diff' is never characterized, which is the one thing an agent calling get_diff would most want to predict.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the single session_id parameter is fully described there, so the description does not need to compensate. It adds no format or sourcing detail beyond what the schema already states.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb and resource: 'Return the file changes made by a delegated session', with the source pinned down ('as reported by OpenCode'). It distinguishes itself well enough from get_session (metadata) and list_agents, though it never names a sibling explicitly.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No when-to-use guidance, no prerequisites stated, and no alternatives named. The only routing hint is indirect, coming from the schema note that session_id comes from delegate_task/create_session.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_sessionGet delegated session stateARead-only
Return the stored state of a delegated session plus its live OpenCode status when a server is running. Use get_diff to inspect file changes.
| Name | Required | Description | Default |
|---|---|---|---|
| session_id | Yes | Session id returned by delegate_task/create_session. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnlyHint annotation already covers the safety profile, and the description adds useful behavioral nuance: the stored session state is always returned, while live OpenCode status is only included when a server is running. This conditional behavior is valuable context beyond the annotation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences with no filler. The main purpose is front-loaded, and the sibling reference to get_diff earns its place by clarifying tool boundaries.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple read-only tool with one well-documented parameter, the description provides sufficient invocation context. It could name the fields contained in 'stored state' or describe the no-server behavior more explicitly, but those are minor gaps given the schema and readOnlyHint.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% and the session_id parameter is already well-described as the ID returned by delegate_task/create_session. The description itself adds no further parameter meaning, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Return') and names the exact resource: the stored state of a delegated session plus live OpenCode status. It also distinguishes itself from get_diff by telling the agent to use get_diff for file changes, which prevents confusion among siblings.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It gives clear context for what get_session returns and points to get_diff as the alternative when inspecting file changes. It does not explicitly enumerate when not to use get_session, but the comparison to get_diff provides enough routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_agentsList available delegated agentsARead-only
List the agents that delegate_task and create_session can use, including project-local agents from .claude-opencode/agents.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Workspace used to discover project-local agents (optional). |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The readOnlyHint annotation already covers the key safety behavior Photon, so the description does not need to restate that. It adds useful context by mentioning project-local agent discovery from .claude-opencode/agents and the role of cwd. It does not describe output format or failure behavior, but no contradiction exists and the annotation lowers the burden.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence that leads with the core action and resource, then adds the most important scoping detail about project-local agents. Every part earns its place; there is no filler or redundancy.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
This is a simple, read-only listing tool with no required parameters and no complex schema. The description plus the cwd parameter documentation is sufficient for an agent to know what the tool does and when to call it. The absence of an output schema is acceptable given the straightforward 'list' semantics.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The only parameter, cwd, is already fully described in the schema with 'Workspace used to discover project-local agents (optional).' The description adds a small amount of context by linking cwd to the .claude-opencode/agents discovery mechanism, but schema coverage is 100%, so the baseline applies.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description names a specific verb ('List') and resource ('agents that delegate_task and create_session can use'), making the tool's purpose immediately clear. It also distinguishes this listing tool from the action-oriented siblings like delegate_task and create_session. The inclusion of project-local agents adds useful scope.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when this tool is useful: before delegating or creating a session, to discover available agent names. It names the consumer tools explicitly and clarifies the optional cwd behavior for project-local discovery, but it does not state formal exclusions or contrast directly with sibling listing tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
send_messageSend a follow-up message to a sessionA
Continue an existing delegated session with another message. The agent keeps its previous context and its permission level; allow_edits / allow_bash can change that level for this and later messages.
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | Follow-up instruction or question. | |
| allow_bash | No | Grant (true) or revoke (false) shell commands from this message onward. Omit to keep the session's current level. | |
| session_id | Yes | Session id returned by delegate_task/create_session. | |
| allow_edits | No | Grant (true) or revoke (false) file edits from this message onward. Omit to keep the session's current level. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With only openWorldHint in annotations, the description carries the behavioral burden and does add real value: it discloses that the agent retains prior context and permission level, and that allow_edits/allow_bash mutate that level persisting into later messages. It does not describe errors on invalid/expired sessions or what the call returns.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two tight sentences, zero waste, and the core action (continue an existing session) is front-loaded before the permission-state detail.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a 4-param stateful tool with no output schema and only an openWorldHint annotation, the description covers continuation semantics, context retention, and permission persistence adequately. Minor gaps remain around failure modes and return value, but nothing essential for correct invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already documents all four parameters, including the 'from this message onward' semantics of the allow_* flags. The description largely restates that, adding only the framing that the level change persists across messages – the baseline 3 for fully covered schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb (continue/send) and resource (existing delegated session), and the phrasing 'Continue an existing delegated session' contrasts cleanly with the sibling delegate_task, which starts a new one. An agent can distinguish it from create_session and delegate_task without reading schemas.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
'Continue an existing delegated session with another message' establishes the context of use, and the session_id schema note ties it to delegate_task/create_session. It never explicitly says when NOT to use it (e.g. for a new task use delegate_task), so it falls short of full routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v2.0.0-alpha.1- First observed
abort_session - First observed
create_session - First observed
delegate_task - First observed
get_diff - First observed
get_session - First observed
list_agents - First observed
send_message
TDQS
Scored across 7 tools
Most tools map cleanly to distinct resources and actions (get_session/get_diff/abort_session/list_agents). The only fuzzy boundary is delegate_task vs. create_session+send_message, since a one-shot task is essentially create+send combined, but the descriptions explicitly distinguish one-shot vs. persistent session workflows.
Every tool follows a clean verb_noun pattern (delegate_task, create_session, send_message, get_session, get_diff, abort_session, list_agents). No style mixing or vague verbs.
Seven tools is well-scoped for a delegation bridge: session lifecycle, message continuation, diff inspection, abort, and agent discovery. Each tool earns its place with no redundant surface.
The session lifecycle is well covered (create, send, get, diff, abort, delegate, list_agents). Minor gaps: no list_sessions to enumerate existing sessions and no explicit close/delete, though abort_session partially fills the teardown role.
Maintenance
Related MCP Connectors
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Shared control plane for AI coding agents — tasks, memory, decisions, file locks. 12 tools.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
- AxisOAuthdev.useaxis
Coding agents from Claude Code, Cursor and Codex claim jobs and lock files on one shared board.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to delegate prompts to an OpenCode agent session for cheaper executor-role work, supporting different providers and session persistence.22,031 npmMIT
- AlicenseAqualityCmaintenanceEnables Codex/ChatGPT to coordinate OpenCode agents, managing tasks, sessions, parallel execution, and project context through 25 local tools.254 npm1MIT
- FlicenseCqualityCmaintenanceEnables Claude Desktop to act as a planning agent while delegating coding tasks to OpenCode CLI, returning execution status, file diffs, and output, with support for continuing sessions and opening workspaces in IDEs.151-
- AlicenseNot gradedqualityCmaintenanceEnables Claude Code and Claude Desktop to delegate coding tasks to any model available in OpenCode while Claude remains the orchestrator, planning work, reviewing diffs, and running tests. Supports synchronous and async delegation, model selection, session continuation, and permission-aware execution.2MIT