a2acode
Put Claude Code, Codex, opencode — any coding agent that speaks Zed's Agent Client Protocol (ACP) — behind the A2A protocol, and keep what most adapters throw away: the tools it runs, the diffs it writes, the approvals it needs, and what it costs. Other agents discover it through its agent card, delegate coding work, and get the run streamed back as it happens — with every permission prompt routed to the caller as an A2A input-required pause.

Try it in ten seconds, no clone and no API key (the echo backend mirrors the prompt):
uvx a2acode serve --backend echo &
# once the "Uvicorn running" line appears:
uvx a2acode call "fix the failing test"
Most adapters that put a coding agent behind A2A flatten everything to text in, text out. a2acode keeps the structure the agent produces: the tools it runs, the files it changes, what it costs, the approvals it needs, and how to continue on the next turn. It bridges two Linux Foundation interop standards — ACP (how editors and clients talk to coding agents) on the agent side, A2A (how agents delegate to each other) on the caller side — so any ACP agent becomes a peer any A2A orchestrator can call.
How it maps to A2A
| The coding agent produces |
A2A surface it lands on |
| Assistant text |
A streamed artifact (append / last_chunk) |
| Its reasoning |
A separate thinking artifact, never the answer |
| A tool call (Bash, Edit) |
A working status update for the action |
| That tool's outcome |
A working status update: ✓ Bash / ✗ Bash: … |
| Its plan for the turn |
A plan artifact, replaced as steps progress |
| A file edit (diff) |
A named artifact carrying the diff |
| A permission request |
An input-required pause the caller answers |
| Run result |
Cost, turns, usage, stop reason on the completion |
| Session id |
Mapped to the A2A contextId so follow-ups resume |
The mapping is all in executor.py. Backends only emit normalized events; they never touch the protocol.
Where this fits
Anthropic now ships its own ways to run Claude Code beyond the terminal: Claude Code on the web, background agents, cloud-hosted Routines, and the Managed Agents API. These are the right choices when you want Anthropic to host the run and you live in their ecosystem, and they are typically tied to Anthropic infrastructure and a GitHub-centric flow.
a2acode solves a different problem: making any coding agent a first-class peer on a vendor-neutral A2A mesh. An orchestrator built on any framework discovers it through its agent card and delegates coding work the same way it would to any other A2A agent. The run happens on infrastructure you control, in a workspace you point it at. Reach for a2acode when:
- another agent (not a human at a prompt) is the caller, and it speaks A2A;
- you want the run on your own infrastructure and data boundary, not a vendor VM;
- you do not want to bet on one vendor's coding agent: ACP makes the backend a launch-command choice, so swapping Claude Code for Codex, Gemini CLI, or opencode does not touch the protocol surface your callers depend on.
ACP already standardizes the editor↔agent side and a dozen agents speak it; a2acode is the piece that exposes an ACP agent to remote autonomous callers over A2A, with permission round-trips and cost preserved as first-class protocol citizens — the part ACP leaves out because it assumes a human in an editor. The practical user is the platform team building that mesh, not the individual developer.
a2a-serve, from the A2A project, also puts ACP coding agents behind A2A. It does much more than the bridge: it runs the agent in Docker containers (one per member, one shared by guests), and adds Telegram/Discord/email front ends, relays and tailnets, and pairing codes. a2acode is narrower — one Python package you can uvx, no Docker, nothing between the caller and the agent but the protocol mapping. Pick a2a-serve if you want the sandbox, the access model and the networking in the same tool; pick a2acode if you already have those and want a bridge you can read in an afternoon, a Claude Agent SDK backend next to the ACP one, and permission answers bound to the exact prompt they name (requestId, option:<id>, answers to AskUserQuestion).
Requirements
- Python 3.11+
- uv
- An ACP agent adapter for the
acp backend, launched as a subprocess. Every preset launches one with npx, so Node is the only prerequisite besides that agent's own credential:
--agent |
Launches |
Credential |
claude |
@zed-industries/claude-agent-acp |
Anthropic API key |
codex |
@zed-industries/codex-acp |
OpenAI credential |
gemini |
@google/gemini-cli --acp |
Code Assist Standard or Enterprise |
Or point --agent-command at any other ACP agent.
On the gemini preset: Google stopped serving the Gemini CLI to consumer accounts on 18 June 2026 — the individual Code Assist tier and AI Pro/Ultra access — and points them at Antigravity instead. A session on one of those fails with "This client is no longer supported for Gemini Code Assist for individuals". This is not specific to ACP or to a2acode: it is the whole CLI, on those tiers. Organization Code Assist Standard and Enterprise subscriptions are unaffected, which is why the preset stays.
Quick start
a2acode is on PyPI, so uvx runs it without a clone or an install step (uv tool install a2acode or pipx install a2acode keep it around). The echo backend needs no API key and no Claude install, so you can exercise the whole path offline first:
uvx a2acode serve --backend echo &
# once the "Uvicorn running" line appears:
uvx a2acode call "fix the failing test"
task 189b1c63-1a7b-4908-87c4-c8f3bba8f6b5
context 0b2a901e-2b6f-4c56-bba2-d0da546936e9
· Echo
· ✓ Echo
fix the failing test
[completed] $0.0 · 1 turns
Then point it at a real project. The default backend is acp, fronting Claude Code through its ACP adapter:
uvx a2acode serve --cwd /path/to/project # acp + claude by default
uvx a2acode call "add a /health endpoint" --url http://localhost:9100/
Swap the agent without touching anything else:
uvx a2acode serve --agent gemini --cwd /path/to/project
uvx a2acode serve --agent-command "npx -y some-other-acp-agent"
Continue the same conversation by passing the context from a previous turn:
uvx a2acode call "now add a test for it" --context <context-id>
Continuity needs the agent to support ACP's session/load. When it does not, the turn still runs, but on a fresh session — and the task says so in a status update rather than answering as if it remembered.
Container
Every release publishes a linux/amd64 and linux/arm64 image to GHCR, holding the same wheel as the PyPI release with all three extras installed — so which backend and which task store it runs is a flag, not a rebuild. It runs as a non-root user and works in your project by way of whatever you mount over /workspace.
A container has to listen on every interface to be reachable at all, so the default command binds 0.0.0.0 where the uvx quick start binds loopback. That makes where you publish the port the boundary: whoever reaches it can run a coding agent in your workspace. Publish it to your own loopback while you try it out —
docker run --rm -p 127.0.0.1:9100:9100 \
-v "$PWD:/workspace" \
-e ANTHROPIC_API_KEY \
ghcr.io/kanywst/a2acode:latest
— and on any network wider than that, mount a token file and require it, which also makes the card advertise the scheme:
docker run --rm -p 9100:9100 \
-v "$PWD:/workspace" -v "$PWD/token:/run/token:ro" \
-e ANTHROPIC_API_KEY \
ghcr.io/kanywst/a2acode:latest \
serve --host 0.0.0.0 --auth-token-file /run/token
See Caller authentication for what that check covers. As the second example shows, anything you pass replaces the default command, so --host has to come with it.
/.well-known/agent-card.json stays exempt from that check — discovery precedes the credential — which makes it the liveness and readiness probe. There is no separate health endpoint to configure.
Two things worth knowing before deploying it. The image carries Node but not any ACP agent adapter, which the acp backend fetches with npx on the first run: an environment with no npm registry access needs its adapter baked into a layer of your own. And the mounted workspace is written as uid 1000, so pass --user if your project's files belong to someone else.
Commands
| Command |
Description |
a2acode serve |
Start the A2A server |
a2acode call TEXT |
Send a message and print the streamed events |
a2acode card |
Fetch and print the agent card |
The agent card is served at /.well-known/agent-card.json and advertises Claude Code's abilities as discrete skills (generation, refactor, debug, review, test, explain).
Attachments
An A2A message is not only text. A caller can attach the failing log, the patch to review, or a screenshot, and the parts reach the agent as content rather than as a note that something was attached: text files are inlined into the prompt, images go to ACP agents that advertise image support as real image blocks, and URL parts arrive as links the agent can fetch. Inlined content is capped per part and per message, and anything trimmed is marked as truncated so the agent knows it is reading a fragment.
Backends
A backend turns a prompt into a stream of normalized events. Three ship today:
acp (default): drives any agent that speaks Zed's Agent Client Protocol as a subprocess. --agent claude|gemini|codex selects a launch preset; --agent-command drives any other ACP agent. This is the vendor-neutral path. The subprocess is kept alive per conversation, so a follow-up turn skips the process launch, the ACP handshake, and the session reload and talks straight to the agent that already holds the conversation.
claude: drives Claude Code directly through the Claude Agent SDK, no subprocess. Install with uv tool install 'a2acode[claude]' (or uv sync --extra claude from a clone). Use it when you want the SDK-native path (e.g. --max-budget-usd) rather than ACP.
echo: no dependencies, mirrors the input. For wiring checks and tests.
The split keeps the A2A layer independent of how the agent is invoked: backends emit normalized events and never import a2a.*; the executor maps those events onto the protocol and never imports an agent SDK. Adding a backend never touches the server or the protocol mapping.
Authentication
Each agent authenticates the way its own tooling does, inherited from the server's environment: the acp backend passes the environment through to the adapter subprocess (e.g. ANTHROPIC_API_KEY, GEMINI_API_KEY), and the claude backend uses whatever the Claude CLI is configured with. When the server answers on behalf of other agents, a Claude credential has to be an Anthropic API key (or Bedrock / Vertex); Anthropic does not permit subscription credentials for third-party serving. The claude backend can cap per-run cost with --max-budget-usd.
Signed agent cards
A caller that discovers this server only has the agent card to go on. Sign it so the caller can confirm the card came from you and was not swapped in transit:
uvx a2acode serve --sign-key card-signing.pem --sign-kid my-key-1 --sign-alg ES256
The card is then served with a JWS signature over its canonical form. --sign-key is a path to a file holding the key: a PEM private key for asymmetric algorithms (ES256, RS256), or a shared secret for HS256. --sign-kid is the key id a verifier uses to look up the matching public key. Unsigned is still the default.
Caller authentication
A signed card proves who the server is; this proves the caller is allowed in. Require a bearer token and the server rejects any task request that does not carry it:
uvx a2acode serve --auth-token-file caller-token.txt
When --auth-token-file is set, callers must send Authorization: Bearer <token>; a request without a valid token gets 401 Unauthorized. The agent card stays public so a caller can still fetch it to discover the requirement, and the card advertises the bearer scheme in securitySchemes. Without the flag the server stays open, as before.
A2A keeps the credential at the HTTP layer, so this composes with whatever your gateway already does: terminate TLS, validate OAuth, or rate-limit in front, and let the server enforce the token behind it.
Permissions
A tool that needs approval pauses the task in the A2A input-required state instead of being skipped. The caller answers with a follow-up message on the same task:
uvx a2acode call "sudo reboot"
# ... [input-required] Permission requested for Bash: $ sudo reboot
# reply: a2acode call "allow" --task <id> --context <id> --request <id>
uvx a2acode call "allow" --task <id> --context <id> --request <id>
An answer of allow, yes, y, ok, approve, accept, or grant — the whole answer, nothing around it — approves. Anything else denies, which is what makes it safe to answer in prose. The agent session stays alive across the pause, so it resumes exactly where it stopped. Over ACP this is the agent's session/request_permission call answered from the A2A caller's reply; with the claude backend it routes through the Claude SDK's can_use_tool.
A denial carries the words it was written with, so no, run pytest -x instead can redirect the turn rather than merely refuse it. How far the reason travels is the agent protocol's call: the claude backend hands it to the agent, and so does a denied ACP terminal, but ACP's answer to an ordinary tool permission carries only the option chosen and has nowhere to put text.
Some gates are not yes/no. Claude Code's end-of-plan gate offers three choices — accept the edits that follow, allow this once and keep gating, or keep planning — so the pause lists whatever the agent offered, each with the kind that says what picking it would mean, and the caller answers option:<id> with the one it wants. The id is what binds; the kind is the agent's label for it. Anything else still resolves to allow or deny as above; naming an option takes the prefix because the agent chooses both an option's id and its polarity, and a bare answer would let it label a permissive choice with the word a caller reaches for to refuse.
Not every gate is a request to act. When Claude has a clarifying question it calls AskUserQuestion, which asks and does nothing else, so approving it says nothing on its own — the answer is the outcome. The pause carries the questions and their choices, and the reply's metadata carries what was picked, keyed by question: