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

FeatureDescription
signingJWS/ES256 agent card signing (RFC 8785 canonicalization)

a2a-protocol-client

FeatureDescription
tls-rustlsHTTPS via rustls (no OpenSSL required)
signingAgent card signing verification
tracingStructured logging via the tracing crate
websocketWebSocket transport via tokio-tungstenite
grpcgRPC transport via tonic

a2a-protocol-server

FeatureDescription
signingAgent card signing
tracingStructured logging via the tracing crate
sqliteSQLite-backed task and push config stores via sqlx
websocketWebSocket transport via tokio-tungstenite
grpcgRPC transport via tonic
otelOpenTelemetry metrics via opentelemetry-otlp

a2a-protocol-sdk (umbrella)

FeatureDescription
signingEnables signing across types, client, and server
tracingEnables tracing across client and server
tls-rustlsEnables HTTPS in the client
grpcEnables gRPC across client and server
otelEnables 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