MCP server (agentrelay-mcp)
A local stdio process on each developer’s laptop. Runs as a child process of Claude Code or Codex CLI via the Model Context Protocol. Exposes seven tools to the agent. One per developer — nothing shared.
Relay service
One hosted service per team. Stores Agent Cards, handoff threads, and the inbox. Built on Hono, Drizzle, and Postgres. Deployed via Docker. All state lives here; the MCP server is stateless.
System diagram
The following diagram shows how a handoff travels from Bob’s agent to Frank’s agent:Components
MCP server
Theagentrelay-mcp package (on npm) is the local half. Claude Code and Codex CLI both speak the Model Context Protocol, so the same binary works for both clients. The MCP server connects to the relay using your developer API key and exposes these tools to your agent:
The MCP server also enforces Layer 1 of the trust model: every inbound handoff is wrapped with a provenance preamble before your agent sees it, treating teammate content as data rather than instructions.
Relay
The relay is a stateless HTTP service backed by Postgres. It has four sub-components:- A2A API server. Exposes the standard A2A JSON-RPC endpoints (
message/send,tasks/get,tasks/list,tasks/update,tasks/cancel) plus system endpoints for registration and inbox listing. - Agent Card registry. One row per developer. Cards are served at the A2A well-known URL (
/.well-known/agent-card.json?id=<handle>) and describe each agent’s identity, skills, and repo ownership. - Inbox store. An append-only log of handoffs and messages, indexed by recipient. The MCP server polls this via
tasks/list. - Notification dispatcher. Fires a Slack DM when a new handoff lands in someone’s inbox. Decoupled from the relay’s hot path, with email and desktop notifications planned for later versions.
Agent Cards
Each registered developer has an Agent Card — a JSON descriptor served from the relay. Cards follow the A2A spec and include identity, skills, and the developer’s relay endpoint:agentrelay-mcp — can look up teammates and send handoffs through the relay.
A2A protocol mapping
AgentRelay doesn’t invent a new protocol. Everything maps directly to the Linux Foundation A2A spec:
This means third-party A2A-compliant agents can interact with an AgentRelay relay without any custom integration.
Handoff lifecycle
A handoff moves through three states from the moment it’s sent to the moment it’s resolved:accept_handoff. The full context — summary, artifacts, file diffs — is loaded into their session. Back-and-forth messages via send_message happen in this state.
Completed: Either side calls complete_handoff, which updates the A2A task status to completed. The thread is closed and the handoff falls out of the active inbox.
Notification flow
When a handoff lands in someone’s inbox, the relay’s notification dispatcher sends a Slack DM via an incoming webhook. The webhook URL is encrypted at rest with a key separate from the API key. This is the out-of-band signal that wakes the recipient up when their agent isn’t running — it’s not part of the handoff delivery itself, which happens through the A2A inbox polling.What AgentRelay is not
A few explicit non-goals help clarify what the system is designed for:- Not real-time co-editing. AgentRelay moves tasks, not cursors.
- Not a Slack or Linear replacement. Notifications go through those tools, not against them.
- Not multi-org. One relay serves one team. v0.1 doesn’t span organizations.
- Not LLM-routed. The relay uses deterministic, rule-based routing. No LLM decides who gets a message.
Learn more
Trust model
How the four-layer trust model stops prompt-injected handoffs from causing damage
Deploy the relay
Step-by-step Docker deployment for your team
A2A protocol
How AgentRelay maps to the Linux Foundation A2A spec
API reference
The full A2A JSON-RPC surface exposed by the relay