a2a-rs
A Rust implementation of the Agent-to-Agent (A2A) Protocol v0.3.0, providing a type-safe, idiomatic way to build agent communication systems.
Features
- 🚀 A2A Protocol v0.3.0 - Full support for the latest A2A specification including:
- Enhanced push notification management with listing and deletion
- Task listing with comprehensive filtering and pagination
- Authenticated extended card support
- Protocol extensions framework
- Multi-transport support (JSONRPC, GRPC, HTTP+JSON)
- 🔄 Multiple Transport Options - HTTP and WebSocket support
- 📡 Streaming Updates - Real-time task and artifact updates
- 🔐 Authentication & Security - JWT, OAuth2, OpenID Connect support with agent card signatures
- 💾 Persistent Storage - SQLx integration for task persistence
- 🎯 Async-First Design - Built on Tokio with async/await throughout
- 🧩 Modular Architecture - Use only the features you need
- ✅ Type Safety - Leverages Rust's type system for protocol compliance
Quick Start
Add to your Cargo.toml:
[]
= "0.1.0"
# For HTTP client
= { = "0.1.0", = ["http-client"] }
# For HTTP server
= { = "0.1.0", = ["http-server"] }
# Full feature set
= { = "0.1.0", = ["full"] }
Client Example
use ;
use AsyncA2AClient;
async
Server Example
use ;
use ;
;
async
Architecture
This library follows a hexagonal architecture pattern:
- Domain: Core business logic and types
- Ports: Trait definitions for external dependencies
- Adapters: Concrete implementations for different transports and storage
Feature Flags
client- Client-side functionalityserver- Server-side functionalityhttp-client- HTTP client implementationhttp-server- HTTP server implementationws-client- WebSocket client implementationws-server- WebSocket server implementationauth- Authentication support (JWT, OAuth2, OpenID Connect)sqlx-storage- SQLx-based persistent storagesqlite- SQLite database supportpostgres- PostgreSQL database supportmysql- MySQL database supporttracing- Structured logging and tracingfull- All features enabled
Examples
See the examples directory for complete working examples:
Documentation
Full API documentation is available on docs.rs.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.