Installation
Requirements
- Rust 1.93+ (stable)
- A working internet connection for downloading crates
Adding to Your Project
The easiest way to use a2a-rust is through the umbrella SDK crate, which re-exports everything you need:
[dependencies]
a2a-protocol-sdk = "0.2"
tokio = { version = "1", features = ["full"] }
The SDK crate re-exports a2a-protocol-types, a2a-protocol-client, and a2a-protocol-server so you only need one dependency.
Individual Crates
If you prefer fine-grained control, depend on individual crates:
# Types only (no I/O, no async runtime)
a2a-protocol-types = "0.2"
# Client only
a2a-protocol-client = "0.2"
# Server only
a2a-protocol-server = "0.2"
This is useful when:
- You're building a client only and don't need server types
- You're building a server only and don't need client types
- You want to minimize compile times and dependency trees
Feature Flags
All features are off by default to minimize compile times and dependency trees.
a2a-protocol-types
| Feature | Description |
|---|---|
signing | JWS/ES256 agent card signing (RFC 8785 canonicalization) |
a2a-protocol-client
| Feature | Description |
|---|---|
tls-rustls | HTTPS via rustls (no OpenSSL required) |
signing | Agent card signing verification |
tracing | Structured logging via the tracing crate |
websocket | WebSocket transport via tokio-tungstenite |
grpc | gRPC transport via tonic |
a2a-protocol-server
| Feature | Description |
|---|---|
signing | Agent card signing |
tracing | Structured logging via the tracing crate |
sqlite | SQLite-backed task and push config stores via sqlx |
websocket | WebSocket transport via tokio-tungstenite |
grpc | gRPC transport via tonic |
otel | OpenTelemetry metrics via opentelemetry-otlp |
a2a-protocol-sdk (umbrella)
| Feature | Description |
|---|---|
signing | Enables signing across types, client, and server |
tracing | Enables tracing across client and server |
tls-rustls | Enables HTTPS in the client |
grpc | Enables gRPC across client and server |
otel | Enables OpenTelemetry metrics in the server |
Enable features in your Cargo.toml:
[dependencies]
a2a-protocol-sdk = { version = "0.2", features = ["tracing", "signing"] }
# Or with individual crates:
a2a-protocol-server = { version = "0.2", features = ["tracing", "sqlite"] }
a2a-protocol-client = { version = "0.2", features = ["tls-rustls"] }
Verifying the Installation
Create a simple main.rs to verify everything compiles:
use a2a_protocol_sdk::prelude::*; fn main() { // Create a task status let status = TaskStatus::new(TaskState::Submitted); println!("Task state: {:?}", status.state); // Create a message with a text part let part = Part::text("Hello, A2A!"); println!("Part: {:?}", part); // Verify agent capabilities builder let caps = AgentCapabilities::none() .with_streaming(true) .with_push_notifications(false); println!("Capabilities: {:?}", caps); }
Run it:
cargo run
If this compiles and runs, you're ready to go.
Next Steps
- Quick Start — Run the echo agent example in 5 minutes
- Your First Agent — Build an agent from scratch