Open source · MIT licensed
a2a-rs is a framework for agents that work together. Write an agent as one trait, serve it over the transport its peers speak, and reach MCP tools and LLMs through the same ports. It implements the Agent2Agent protocol end to end, and the MIT license means you can build your product on it.
$
cargo add a2a-rs
- A2A 1.0The current spec, wire-compatible
- MCP 2026-07-28The latest revision, both directions
- 3 transportsConnectRPC, JSON-RPC 2.0, HTTP+JSON
- MITUse it, ship it, sell it
Everything between your agents
The protocol, the bridges, and the plumbing a multi-agent system needs, with every piece of infrastructure behind a port you can replace.
Up to spec with A2A 1.0
Messages, tasks, artifacts, push notifications, extended agent cards and card signatures, and every task state. The few divergences are opt-in, backward-compatible, and documented.
The latest MCP
MCP 2026-07-28, and 2025-11-25 for peers that still initialize. Expose an agent as MCP tools, or hand an agent an MCP server's tools. A slow call becomes an MCP task; a question asked mid-call reaches the agent.
Three transports, one agent
Serve ConnectRPC, JSON-RPC 2.0 and HTTP+JSON from the same agent. Clients negotiate from the agent card, and the spec bindings are crossed against the official A2A Rust SDK in both directions.
Made for many agents
Agent cards to discover what a peer can do, contexts that carry a
conversation across tasks, input-required hand-offs,
streams that resume without gaps, and push webhooks.
Production plumbing
SQLite or PostgreSQL storage, JWT, OAuth2 and OpenID Connect auth, retries and tracing. Each sits behind its own feature flag, so you compile only what you use.
MIT, yours to build on
Every crate here is MIT licensed: embed it in a commercial product, fork it, or build your own agent platform on top. No adapter is load-bearing, so nothing locks you in.
An agent is one trait
Implement Responder: given the message and the task, return a
reply and the state the task ends in. ResponderMessageHandler
creates the task, keeps its history, and announces every transition to
stream subscribers and push webhooks.
examples/quickstart.rs
Agent
use a2a_rs::adapter::business::Responder;
use a2a_rs::domain::{A2AError, Message, Part, Role, Task, TaskState};
/// Reply with the message in capitals, and finish the task.
struct Shout;
#[async_trait::async_trait]
impl Responder for Shout {
async fn respond(
&self,
message: &Message,
task: &Task,
) -> Result<(Message, TaskState), A2AError> {
let text: Vec<&str> = message.parts.iter().filter_map(|p| p.get_text()).collect();
let reply = Message::builder()
.role(Role::Agent)
.parts(vec![Part::text(text.join(" ").to_uppercase())])
.message_id(uuid::Uuid::new_v4().to_string())
.task_id(task.id.clone())
.context_id(message.context_id.clone())
.build();
Ok((reply, TaskState::Completed))
}
}
All of it runs as one program:
cargo run -p a2a-rs --example quickstart --features http-server,http-client.
An agent that acknowledges now and finishes later implements
AsyncMessageHandler instead.
The workspace
The protocol crate stands alone; the others extend it. Each is published to crates.io and released independently.
a2a-rs
The protocol: domain types, ports, the ConnectRPC, JSON-RPC 2.0 and HTTP+JSON transports, auth, and in-memory and SQLx storage.
a2acli
A command-line client that negotiates its transport from the agent card. Prebuilt for Linux, macOS and Windows; doubles as a cross-SDK interop harness.
a2a-mcp
A2A ↔ MCP in both directions, on MCP 2026-07-28 and 2025-11-25: expose an agent as MCP tools, or route an agent's tool calls to an MCP server. A slow call becomes an MCP task; a mid-call question reaches the A2A side.
a2a-llm
Provider-neutral chat completions for OpenAI-compatible endpoints and Gemini, and decision models that answer typed questions with probabilities instead of text.
a2a-ap2
The Agent Payments Protocol: typed, validated mandates, payment requests and receipts, and helpers to carry them in A2A messages and agent cards.
a2a-web-client
Building blocks for web frontends to A2A agents: a client with SSE streaming and polling fallback, view models, and optional Axum components.
Protocol coverage
The A2A v1.0 surface, and how it reaches the wire. The full list of divergences is in the spec compliance notes.
Operations
SendMessage·SendStreamingMessageBlocking until the task settles, or returning immediatelyGetTask·ListTasksFiltered by state and context, and pagedCancelTask·SubscribeToTaskWith gap-free resume between a2a-rs peers- Push notification configsCreate, get, list and delete, with webhook delivery and retries
GetExtendedAgentCardPlus agent card signatures- Security schemesHTTP bearer, API key, OAuth2, OpenID Connect, mTLS
Transports
| Binding | Server | Client |
|---|---|---|
| JSON-RPC 2.0 (spec) | ✓ | ✓ |
| HTTP+JSON (spec) | ✓ | — |
| ConnectRPC (a2a-rs default) | ✓ | ✓ |
| gRPC (spec) | — | — |
Clients negotiate from the agent card's supported interfaces: ConnectRPC when the agent offers it, JSON-RPC otherwise. Crossed against the official A2A Rust SDK's CLI and server over JSON-RPC and HTTP+JSON.
Hexagonal, so the edges are yours
Transports decode a request and hand it to TaskService, which
only talks to ports. You implement the message handler; everything else
has an in-tree adapter you can keep or replace.
Transports
ConnectRPCJSON-RPC 2.0HTTP+JSONauth guardSSE
Ports
AsyncMessageHandlerAsyncTaskLifecycleAsyncTaskQueryAsyncStreamingHandlerAsyncEventLogAsyncNotificationManagerAsyncPushNotifierAsyncConversationStoreAsyncContextStateStoreAuthenticator
Adapters
in-memorySQLitePostgreSQLstreaming fan-outwebhook senderJWTOAuth2OIDC
Building a multi-agent system? Start here.
a2a-rs is MIT licensed and published on crates.io, so it's free to use in commercial products and to build your own platform on. Issues and pull requests are welcome.