Installation

Requirements

  • Rust 1.88+ (stable; CI tests the MSRV and current stable)
  • A working internet connection for downloading crates
  • protoc (Protocol Buffers compiler) — bundled automatically: the grpc/proto build scripts use a vendored protoc (protoc-bin-vendored), so a clean cargo build --features grpc works with no system install. Set the PROTOC environment variable only to override with your own binary (or on a platform the vendored binaries don't cover).

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.14"
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.14"

# Client only
a2a-protocol-client = "0.14"

# Server only
a2a-protocol-server = "0.14"

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

Features are off by default to minimize compile times and dependency trees, with two exceptions. tls-rustls is on by default for a2a-protocol-client and a2a-protocol-sdk, because the A2A spec serves agents over HTTPS and the client (and the bundled push sender) must reach them out of the box. tracing is on by default for a2a-protocol-client, a2a-protocol-server and a2a-protocol-sdk, so a default build logs through whatever tracing subscriber the application installs. default-features = false removes a crate's defaults — on the SDK too, which takes the client and server without theirs: an SDK built that way has no rustls and no logging.

a2a-protocol-types

FeatureDescription
signingJWS/ES256 agent card signing (RFC 8785 canonicalization)
protoCanonical protobuf message types and the JSON⇄proto conversions (turned on by grpc)

a2a-protocol-client

FeatureDescription
tls-rustlsHTTPS via rustls (no OpenSSL required)
signingForwards a2a-protocol-types/signing; the client neither signs nor verifies cards on its own (call verify_agent_card yourself)
tracingStructured logging via the tracing crate
websocketWebSocket transport via tokio-tungstenite
grpcgRPC transport via tonic (plaintext)
grpc-tlsgRPC over TLS — grpc + tonic's rustls connector (independent of tls-rustls); needed for https:// gRPC endpoints and for the default dialling of a bare non-loopback host:port target
testingA scripted hostile peer (testing::ScriptedPeer) that stalls, cuts off, mis-frames or refuses on each binding, for testing code that calls agents

a2a-protocol-server

FeatureDescription
signingForwards a2a-protocol-types/signing; the server itself neither signs nor verifies the card it serves
tracingStructured logging via the tracing crate
tls-rustlsHTTPS delivery for the bundled push-notification sender
sqliteSQLite-backed task and push config stores via sqlx
postgresPostgreSQL-backed task and push config stores via sqlx
websocketWebSocket transport via tokio-tungstenite
grpcgRPC transport via tonic
grpc-tlsTLS on the gRPC listener (GrpcDispatcher::with_tls); implies grpc
otelOpenTelemetry metrics via opentelemetry-otlp
conformanceA harness that grades an AgentExecutor against the protocol's invariants
axumAxum framework integration (A2aRouter)
auth-jwtJWT bearer-token authentication (JwtAuthInterceptor)

a2a-protocol-sdk (umbrella)

FeatureDescription
signingEnables signing across types, client, and server
tracingEnables tracing across client and server
tls-rustlsEnables HTTPS in the client and TLS push delivery in the server
grpcEnables gRPC across client and server
grpc-tlsEnables gRPC over TLS in the client and on the server's gRPC listener
websocketEnables WebSocket across client and server
sqliteEnables SQLite stores in the server
postgresEnables PostgreSQL stores in the server
otelEnables OpenTelemetry metrics in the server
axumEnables Axum integration in the server
auth-jwtEnables JWT bearer-token authentication in the server

Enable features in your Cargo.toml:

[dependencies]
a2a-protocol-sdk = { version = "0.14", features = ["tracing", "signing"] }

# Or with individual crates:
a2a-protocol-server = { version = "0.14", features = ["tracing", "sqlite"] }
a2a-protocol-client = { version = "0.14", 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