agent-mcp
# agent-mcp
One MCP server that lets Claude Code, Codex and agy (the Antigravity CLI)
start, steer, resume, cancel and review runs on each other, with the model
picked per role.
**Status:** phase 1. Not published to npm or the MCP registry; install it
from source.
```mermaid
flowchart LR
caller["Caller: Claude Code, Codex or agy"] -->|MCP over stdio| server["agent-mcp"]
server --> policy["Policy: workspace, environment, role, MCP allowlist, depth, guards"]
policy --> runs["Run manager: queue, timeout, cancel, verdict, run store"]
runs --> codex["codex app-server or exec"]
runs --> agy["agy stream-json"]
runs --> claude["claude stream-json"]
```
## What you get
- Seven MCP tools: `agents_list`, `run_start`, `run_status`, `run_result`,
`run_send`, `run_cancel` and `runs_list` ([reference](docs/tools.md)).
- Three kinds of run: `ask` and `review` are read-only, `implement` edits a
linked git worktree.
- A verdict on every run, based on the exit status and on what actually
changed in the workspace.
- A command line for the same runs: `agent-mcp run` and `agent-mcp runs`.
- Two Agent Skills, [delegate](skills/agent-mcp-delegate/SKILL.md) and
[review](skills/agent-mcp-review/SKILL.md), and a Claude Code plugin.
## Requirements
- Node 22 or newer, and git.
- At least one of the three CLIs, installed and logged in with a
subscription. API keys are never passed to a child.
- Linux. Other systems are untested; reaping orphaned runs and the herdr
probe work on Linux only.
## Install from source
```sh
npm install && npm run build
npm link
agent-mcp doctor
```
`npm link` puts `agent-mcp` on your `PATH`, which the client registrations
below rely on. With Nix, see [docs/install.md](docs/install.md).
Then write a config file with at least one role, because there are no default
models: start from `examples/config.example.json`, replace the placeholder
model names, and see [docs/config.md](docs/config.md).
## Quick start per client
Each `--print` shows the change and writes nothing. `--yes` applies it.
Claude Code:
```sh
agent-mcp install claude --print
agent-mcp install claude --yes
claude mcp add --scope user agent-mcp -- agent-mcp serve
```
`install claude` only links the skills; the last command registers the
server.
Codex:
```sh
agent-mcp install codex --print
agent-mcp install codex --yes
```
agy:
```sh
agent-mcp install agy --print
agent-mcp install agy --yes
```
## Security model
- A child starts with an allow-listed environment; API-key variables are
always removed.
- `review` and `ask` are capped to read-only, whatever the role or request
says.
- `implement` needs a linked git worktree on an unprotected branch with an
empty index.
- Each role lists the MCP servers its child may use. If a backend can't
enforce the list, the run is refused.
- Delegation depth is limited (default 2).
- A run fails its verdict if HEAD or the branch moves, if anything is staged,
or if a read-only run changes the workspace.
- A result is advice. It approves nothing.
The verdict detects problems after the fact; it is not a sandbox. Read
[docs/security.md](docs/security.md), including what is not protected.
## Supported versions
| Backend | Tested version |
| --- | --- |
| Codex CLI | 0.172.0 |
| agy | 1.5.18 |
| Claude Code | 2.1.332 |
On any other version `run_start` answers `backend_unverified` until
`agent-mcp doctor --probe` has passed for that exact version. The probe
spends one model turn.
## Vendor terms
agent-mcp is not affiliated with or endorsed by Anthropic, OpenAI or Google.
It runs each vendor's unmodified, official CLI on your machine, under the login
you made in that CLI. It never reads, stores or forwards credentials, and it
does not share, resell or proxy any account. You are responsible for following
each vendor's terms. This is not legal advice; checked on 2026-11-30.
- **Claude Code.** Anthropic allows signing in to the unmodified Claude Code
binary with your own subscription, and says usage limits assume "ordinary,
individual usage". Products built for other people should use API keys
([legal and compliance](https://code.claude.com/docs/en/legal-and-compliance)).
- **Codex.** Signing in with ChatGPT is supported; OpenAI recommends API keys
for automation ([authentication](https://learn.chatgpt.com/docs/auth)).
- **agy.** Off by default. Google's [Antigravity terms](https://antigravity.google/terms)
say using third-party tools to access the service is a breach that can lead
to suspension of your Antigravity and Gemini CLI accounts. Turn it on with
`"backends": {"agy": {"enabled": true}}` only if you accept that risk.
Before any public release, written confirmation is sought from each vendor.
## Documentation
- [Install](docs/install.md)
- [Tools, resources and prompts](docs/tools.md)
- [Configuration](docs/config.md)
- [Security](docs/security.md)
- [Writing an adapter](docs/adapters.md)
- [Contributing](CONTRIBUTING.md), [security reports](SECURITY.md) and
[changelog](CHANGELOG.md)
MIT licence.
TDQS
Scored across 7 tools
Each tool maps to a distinct lifecycle step: discovering backends, starting, polling, fetching results, messaging, cancelling, and listing runs. The only mild overlap is run_status vs run_result, but descriptions clearly separate polling for state/events from retrieving a finished run's answer and changed files.
All seven tools follow a uniform noun_verb convention: agents_list, runs_list, run_start, run_status, run_result, run_send, run_cancel. Singular 'run' for per-run operations and plural for collection listings is a coherent, predictable rule.
Seven tools is a tight, well-scoped set that covers the whole subagent lifecycle without redundant or filler operations. Each tool earns its place by mapping to one phase of the run model.
The surface covers discovery, execution, polling, result retrieval, steering, cancellation, and history, which supports the core workflow end to end. Minor gaps exist around inspecting a run's configuration/metadata after the fact or retrieving past event history beyond the polling window, but agents can work around these with run_result and run_status.