devin-subagent
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., "@devin-subagent Have Devin fix the failing login test on branch devin/fix-login."
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.
devin-subagent
An MCP server that makes Devin a native subagent for Claude Code and Codex: the lead agent starts a Devin session with one tool call, waits with one long call, and gets Devin's last message back verbatim, even if the connection to Devin drops in between.
Keyless by default. Talks to the Devin CLI over ACP (
devin acp --cloud, ordevin acp --process-model in-processfor local runs) and uses your existingdevinlogin. No API key is needed.Status from the session itself.
session/listgives the status,session/loadreplays the history to read the last message without starting a turn.Rules layer. Every task gets "push only to your own branch, only once at the end" and "the first line of the last message is
SORU:orBİTTİ:". Branches must start withdevin/. Pushes outside the prefix are reported asVIOLATION(never reverted).
Note: Devin makes commits and pushes under the identity of the Devin account owner (the user logged in to the
devinCLI), not under the identity of whoever runs Claude Code or Codex.
Requirements
Node.js 20 or newer.
The Devin CLI on
PATH, logged in (devinmust work in a terminal). Rundevinonce and log in if needed.gitonPATH(for the remote-branch comparison).
Related MCP server: devin-mcp-bridge
Install
There are two install paths: the Claude Code plugin (nothing to build), or a manual MCP setup for Claude Code or Codex from a local build.
1. Claude Code plugin via the marketplace (zero steps)
/plugin marketplace add MrMerkus/devin-subagent
/plugin install devin-subagent@devin-subagentOr, from a local checkout: claude --plugin-dir ./plugin.
The plugin ships the compiled server as a single file, so nothing is built or downloaded at install time and no node_modules are needed. The plugin contains:
plugin/.mcp.json: the MCP server, started asnode ${CLAUDE_PLUGIN_ROOT}/server/index.js. The marketplace entry'ssourceis./plugin, so${CLAUDE_PLUGIN_ROOT}is the installed copy of theplugin/directory.plugin/server/index.js: the bundled MCP server (built fromsrc/withnpm run bundle).plugin/agents/devin.md: a thindevinagent whose only tools are this MCP server's tools. Use it assubagent_type: "devin".
The agent's model is haiku by default. To change it, edit model: in agents/devin.md (for example sonnet, or inherit to use the lead's model), or copy the file to .claude/agents/devin.md in your project and edit it there.
The agent does not summarize: the MCP writes the result to sonuc.md and the agent returns that path plus Devin's last message verbatim. If Devin asks a question (question) or ends its turn without a marker (idle), the agent ends its report with SORU: and stops (it adds no extra SORU: line when Devin's message already starts with one). When you name a model, the agent always passes it to devin_run; "same model" means the model named earlier. Wake it with SendMessage; it forwards your answer with devin_message and waits again.
2. Manual MCP setup (Claude Code or Codex)
Build a local checkout:
git clone https://github.com/MrMerkus/devin-subagent.git
cd devin-subagent
npm ci && npm run buildClaude Code (use the absolute path of your checkout):
claude mcp add --scope user devin -- node /abs/path/devin-subagent/dist/index.jsCodex: see Codex below.
Permissions
Allow the MCP tools without prompting, in .claude/settings.json (or ~/.claude/settings.json). This also avoids the auto-mode "Unsanctioned Communication" denial that was observed in a real run when the lead sends messages to Devin. See plugin/permissions.example.json:
{
"permissions": {
"allow": ["mcp__plugin_devin-subagent_devin", "mcp__devin"]
}
}mcp__plugin_devin-subagent_devin covers the plugin install, mcp__devin covers claude mcp add devin.
devin_wait blocks for up to wait_default_seconds (600 s). If your client's MCP tool timeout is shorter, raise it (Claude Code: MCP_TOOL_TIMEOUT in milliseconds) or pass a smaller seconds.
Codex
After the build above, add to ~/.codex/config.toml (use the absolute path of your checkout):
[mcp_servers.devin]
command = "node"
args = ["/abs/path/devin-subagent/dist/index.js"]
startup_timeout_sec = 60
# devin_wait blocks for minutes; keep this above wait_default_seconds.
tool_timeout_sec = 900Known limitations
devin_runhas no base-branch field yet. Put the base branch in the task text (for example "start from branchmain").acu_capis advisory in ACP mode:devin acpmay ignore it and keep the account's own limit (see Configuration).The npm registry package is not published yet; install with the plugin or from a local build.
Tools
Tool | What it does |
| Starts a session and returns in one response: |
| Blocks until the status changes (default 600 s) and returns it with the branch tip, VIOLATION lines and the last message. Disconnects are retried internally; when the retry cap is exceeded the result is |
| Read-only: status and last message. Sends nothing to the session. |
| Sends a message (e.g. the answer to a |
| Cancels the current turn and waits (up to 5 s) for Devin to end it; |
| Recent sessions with a coarse status. |
Statuses:
Status | Meaning |
| Devin is working (the report includes the current tip of the branch). |
| The last message starts with |
| The turn finished and the last message has no marker (full text returned). |
| The turn finished and the last message starts with |
| The session failed, or the connection could not be re-established within the cap. |
| Stopped with |
How the status is decided, in order:
The
session/list_metasays the turn is over:statusEnumisfinished,error,stoppedorblockedwith nopendingRequest, orsessionStatusissuspendedorfinished. This wins over a prompt that still looks in flight, because in cloud mode thesession/promptresponse can be lost when the connection drops. A prompt left in flight this way is dropped (and a local lock released).The transcript is loaded with
session/loadand the last agent message decides:BİTTİ:isdone,SORU:or a non-nulluserActionRequiredisquestion, anything else isidle.done,questionandidleare never returned without the message: if the history has no final agent message yet (it can lag behind the listing), or the last agent message is older than the last prompt, the history is loaded again with backoff (1 s, doubling up topoll_interval_seconds) until the wait window ends, and then the result isrunningwithtimed_out: true. A history that does not show the last prompt yet counts as stale (running) only for 120 s after the prompt and only while the listing'supdatedAtis not later than the prompt, so a cloud history that omits a prompt cannot keep a sessionrunningforever.Otherwise the session is
running: a prompt is in flight,currentActivityis set (read fromsession/listand fromsession/update_meta["cognition.ai/session"]), orstatusEnumhas another value. Unknown values and fields are tolerated.
Real traces after a finished turn showed statusEnum: "blocked" with currentActivity: "finish_executing_actions", and later sessionStatus: "suspended" with statusEnum: "finished". The running and question signals are still inferred.
VIOLATION: a branch outside branch_prefix that appeared or moved between the start and the end of the run. It is reported, never reverted, and labelled "possibly by another actor" because the remote does not say who pushed. Deleted branches are not reported. When the remote cannot be read, the result says remote_check: "unavailable" with remote_check_error, and violations is null (not checked).
devin_wait and devin_status return two content blocks: a JSON report, then the last message verbatim. The same information is written to <state_dir>/results/<id>/sonuc.md; for done, question and idle it contains Devin's last message verbatim.
Configuration
Optional JSON file at $DEVIN_SUBAGENT_CONFIG, else $XDG_CONFIG_HOME/devin-subagent/config.json (default ~/.config/devin-subagent/config.json). All keys are optional:
{
"backend": "acp",
"devin_command": ["devin"],
"acu_cap": 10,
"bypass_approval": false,
"branch_prefix": "devin/",
"default_model": null,
"poll_interval_seconds": 15,
"wait_default_seconds": 600,
"wait_max_seconds": 3600,
"request_timeout_seconds": 120,
"reconnect": { "max_attempts": 5, "max_seconds": 300, "initial_backoff_ms": 1000 },
"state_dir": "~/.local/state/devin-subagent",
"task_rules": []
}acu_cap: default ACU cap;devin_run(acu_cap)overrides it. In ACP mode it is advisory: it is sent ascognition.ai/maxAcuLimitinsession/new_meta, butdevin acphas been seen to ignore it and keep the account's own limit. The MCP does not enforce a cap itself.devin_runand the reports return the session's effectivemax_acu_limitas reported by Devin, andacu_cap_notesays whether it matchesacu_cap.bypass_approval: whenfalse(default), permission requests from Devin are always answered with a reject option.repomust be anhttps://orssh://URL,user@host:path,owner/nameor an existing local directory. Values starting with-and transport helpers such asext::are rejected, and git runs with-c protocol.ext.allow=neverand--before the remote.branch_prefix:devin_runrejects branches that do not start with it; pushes to other branches are reported asVIOLATION.task_rules: extra rule lines appended to every task.state_dir(or$DEVIN_SUBAGENT_STATE_DIR): run records,sonuc.mdfiles and the local-run lock.
API v3 backend (optional, not implemented in v0.1)
"backend": "api" selects the Devin API v3 backend, which needs DEVIN_API_KEY in the environment. The key is only read from the environment and is never written to any file. In v0.1 this backend is only an interface: every tool returns a "not implemented" error. Enabling it depends on the maintainer's approval.
How it works
Transport: JSON-RPC 2.0 over the
devin acpchild process's stdio, one JSON object per line.initializeneeds no login step (authMethods: []).devin_run: records the remote branch heads (git ls-remote --heads), thensession/new+session/promptwith the task and the rules. The prompt runs in the background.devin_wait: pollssession/list(cheap) and readscognition.ai/statusEnum,currentActivityandpendingRequest. Only when the turn looks finished, it callssession/load(which replays the whole history and is not called in a tight loop) to read the lastagent_message_chunk, then compares the remote branch heads with the ones recorded at the start.Requests from Devin to the client are always answered: permission requests with a reject option (or
cancelled), anything else with JSON-RPC error-32601 "not supported".
Development
npm ci
npm run build
npm testAfter changing src/, run npm run bundle to rebuild the plugin's single-file server (plugin/server/index.js, built with esbuild) and commit it. npm test fails when the committed bundle is stale.
The tests never start the real devin: they run against test/fake-acp.mjs, a fake ACP agent that speaks the same protocol over stdio and keeps its sessions in a state file so they survive restarts (like cloud sessions survive a dropped connection).
License
MIT, see LICENSE.
Available Tools
6 toolsdevin_listList Devin sessionsARead-only
Lists recent sessions with a coarse status (use devin_status for the last message).
Inputs: mode, limit.
devin_messageMessage a Devin sessionA
Sends a message to the session (e.g. the answer to a SORU:). The session keeps its own model. Then call devin_wait.
Inputs: id (required), text (required).
devin_runStart a Devin sessionA
Starts a Devin session on a task and returns at once with id, URL, model, branch and push permission. The branch must start with "devin/". Rules are appended to the task: push only to that branch, once at the end; the first line of the last message is SORU: or BİTTİ:. Then call devin_wait (one long call, no polling loops).
Inputs: mode (required), repo (required), task (required), branch (required), +4 more.
devin_statusRead a Devin session's statusARead-only
Read-only: returns the status and the last message without sending anything to the session.
Inputs: id (required).
devin_stopStop a Devin sessionBDestructive
Cancels the session's current turn.
Inputs: id (required).
devin_waitWait for a Devin sessionARead-only
Blocks until the session status changes (or seconds pass) and returns it: running (with branch tip), question, idle (turn finished without a marker; full text), done (turn finished and the last message starts with BİTTİ:), error, stopped. The last message follows the JSON block verbatim. Disconnects are retried internally. Do not call it in a tight loop.
Inputs: id (required), seconds.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool maps to a distinct action in the session lifecycle (start, block-wait, snapshot status, list, message, cancel), and the descriptions explicitly contrast the overlapping pair devin_wait vs devin_status (blocking vs read-only). The wait/status distinction still requires careful reading and is the one place misselection is plausible.
All tools share a predictable `devin_` prefix and are short snake_case, which is easy to scan. Minor deviations: most are verbs (wait, run, list, message, stop) but `devin_status` is a noun, and `devin_list` omits its object (sessions).
Six tools is a tight, well-scoped set for orchestrating a single subagent session: launch, observe, converse, and cancel. No tool appears redundant or gratuitous.
The start/monitor/message/stop lifecycle is fully covered, including both blocking and non-blocking observation. Minor gaps: no way to fetch the full transcript or diff/branch contents, and `devin_list` only gives coarse status.
Maintenance
Related MCP Connectors
Hand off work between AI agents in any tool. Start Devin or Cursor cloud and share memory.
Sync coding-agent sessions and resume them in any other agent: Claude Code, Codex, Cursor, more.
Start and manage Reason cloud coding agents, projects and sessions from any MCP client.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables Claude Code to delegate implementation tasks to Devin.4MIT
- AlicenseAqualityBmaintenanceBridges MCP (Claude Code) to ACP (Devin), enabling Claude Code to delegate autonomous tasks to Devin with permission and filesystem sandbox controls.2MIT
- AlicenseBqualityBmaintenanceEnables any MCP host to delegate work to multiple coding-agent CLIs such as Codex, Claude Code, and Antigravity as subagents, preserving native sessions and supporting team-based supervision and agent-to-agent messaging.1711 npmApache 2.0
- AlicenseAqualityAmaintenanceUse Codex as a subagent inside Claude Code: async dispatch into a long-lived codex app-server, results pushed back into the Claude session automatically, steer/interrupt mid-task, and Codex's built-in code review.61MIT