a2a-rs is a Rust workspace for the A2A v1 protocol. It includes core protocol
types, async client and server libraries, protobuf definitions, and gRPC
bindings for building interoperable A2A agents and clients.
The workspace supports:
- JSON-RPC 2.0 over HTTP
- REST / HTTP+JSON
- gRPC via
tonic - SLIMRPC via
slim_bindings - Server-Sent Events for streaming responses
- Protobuf-based interop with other SDKs and runtimes
| Crate | Purpose |
|---|---|
a2a |
Core A2A types, errors, events, JSON-RPC types, and wire-compatible serde behavior |
a2a-client |
Async A2A client with transport abstraction and protocol negotiation from agent cards |
a2a-server |
Async server framework with REST and JSON-RPC bindings built on axum |
a2a-pb |
Protobuf schema, generated types, ProtoJSON-capable generated types, and native <-> protobuf conversion helpers |
a2a-grpc |
gRPC client and server bindings built on tonic |
a2a-slimrpc |
SLIMRPC client and server bindings built on slim_bindings |
a2acli |
Standalone A2A client CLI, published as agntcy-a2acli, for inspecting agent cards, sending messages, managing tasks, and handling push configs |
examples/helloworld |
Minimal runnable example agent |
| Binding | Client | Server |
|---|---|---|
| JSON-RPC | a2a-client |
a2a-server |
| HTTP+JSON / REST | a2a-client |
a2a-server |
| gRPC | a2a-grpc |
a2a-grpc |
| SLIMRPC | a2a-slimrpc |
a2a-slimrpc |
The gRPC support uses the schema in a2a-pb/proto/a2a.proto. The REST and
JSON-RPC bindings are intended to stay wire-compatible with other A2A SDKs,
including Go and C# implementations.
- Rust 1.85 or newer
- A stable
rustuptoolchain is recommended justis optional but useful for common development commandscargo-llvm-covis optional if you want HTML coverage reports
cargo build --workspace
cargo test --workspaceCommon project commands are also available through just:
just build
just test
just lint
just fmt-check
just ciInstall cargo-llvm-cov once:
cargo install cargo-llvm-covThen run:
just coverageThis writes the HTML report to target/llvm-cov/html/index.html.
The hello world example exposes an echo-style agent over REST and JSON-RPC.
cargo run -p helloworldWhen the example starts, the following endpoints are available:
- Agent card:
http://localhost:3000/.well-known/agent-card.json - JSON-RPC endpoint:
http://localhost:3000/jsonrpc - REST endpoint:
http://localhost:3000/rest
The example does not start a gRPC server, but the a2a-grpc crate provides the
client and server bindings needed to add one.
The workspace includes a standalone CLI client built on a2a-client. It
resolves the public agent card from a base URL, negotiates JSON-RPC or
HTTP+JSON, prints responses as JSON, and manages task push notification
configs.
cargo run --bin a2acli -- card
cargo run --bin a2acli -- send "hello from rust"
cargo run --bin a2acli -- stream "hello from rust"
cargo run --bin a2acli -- list-tasks
cargo run --bin a2acli -- push-config list task-123By default the CLI targets http://localhost:3000, which matches the bundled
hello world server. Override the target with --base-url https://host for any
compatible A2A server, use --binding jsonrpc or --binding http-json to pin
transport selection, and pass --bearer-token or repeated --header Name:Value
arguments when the server requires authentication.
Install from the workspace with cargo install --path a2acli, or from crates.io
after release with cargo install agntcy-a2acli.
Until the crates are published, depend on them directly from Git:
[dependencies]
a2a = { package = "agntcy-a2a", git = "https://github.com/agntcy/a2a-rs.git" }
a2a-client = { package = "agntcy-a2a-client", git = "https://github.com/agntcy/a2a-rs.git" }
a2a-server = { package = "agntcy-a2a-server", git = "https://github.com/agntcy/a2a-rs.git" }
a2a-pb = { package = "agntcy-a2a-pb", git = "https://github.com/agntcy/a2a-rs.git" }
a2a-grpc = { package = "agntcy-a2a-grpc", git = "https://github.com/agntcy/a2a-rs.git" }
a2a-slimrpc = { package = "agntcy-a2a-slimrpc", git = "https://github.com/agntcy/a2a-rs.git" }Typical usage is:
a2afor protocol types and serde modelsa2a-clientfor clients that negotiate REST or JSON-RPC from an agent carda2a-serverfor agent implementations onaxuma2a-grpcwhen you need gRPC transport supporta2a-slimrpcwhen you need SLIMRPC transport supporta2a-pbwhen you need direct access to protobuf messages or conversion helpers
a2a/: core protocol cratea2a-client/: client transports and factorya2a-server/: request handler, routers, streaming, and storesa2a-pb/: protobuf schema and conversion layera2a-grpc/: tonic-based bindingsa2a-slimrpc/: SLIMRPC bindingsa2acli/: standalone A2A client CLI and published binary packageexamples/helloworld/: runnable sample agent
See CONTRIBUTING.md for contribution guidelines, SECURITY.md for security
reporting, and CODE_OF_CONDUCT.md for community expectations.
Apache-2.0. See LICENSE.md.