adk-server
HTTP server and A2A protocol for Rust Agent Development Kit (ADK-Rust) agents.
Overview
adk-server provides HTTP infrastructure for the Rust Agent Development Kit (ADK-Rust):
- REST API - Standard HTTP endpoints for agent interaction
- A2A Protocol - Agent-to-Agent communication (JSON-RPC 2.0)
- SSE Streaming - Server-Sent Events for real-time responses
- Web UI - Built-in chat interface for testing
- RemoteA2aAgent - Connect to remote agents as sub-agents
Installation
[]
= "0.1.8"
Or use the meta-crate:
[]
= { = "0.1.8", = ["server"] }
Quick Start
Basic Server
use ;
use Arc;
let config = new;
let app = create_app;
let listener = bind.await?;
serve.await?;
Security Configuration
Configure CORS, timeouts, and other security settings:
use ;
use Duration;
// Development mode (permissive CORS, detailed errors)
let config = new
.with_security;
// Production mode (restricted CORS, sanitized errors)
let config = new
.with_allowed_origins
.with_request_timeout
.with_max_body_size; // 5MB
A2A Server
use create_app_with_a2a;
let app = create_app_with_a2a;
// Exposes:
// GET /.well-known/agent.json - Agent card
// POST /a2a - JSON-RPC endpoint
// POST /a2a/stream - SSE streaming
Remote Agent Client
use RemoteA2aAgent;
let remote = builder
.description
.agent_url
.build?;
// Use as sub-agent
let coordinator = new
.sub_agent
.build?;
API Endpoints
| Endpoint | Method | Description |
|---|---|---|
/ |
GET | Web UI |
/api/chat |
POST | Send message |
/api/chat/stream |
POST | Stream response |
/.well-known/agent.json |
GET | A2A agent card |
/a2a |
POST | A2A JSON-RPC |
/a2a/stream |
POST | A2A streaming |
Features
- Axum-based async HTTP
- CORS support
- Embedded web assets
- Multi-agent routing
- Health checks
Related Crates
- adk-rust - Meta-crate with all components
- adk-runner - Execution runtime
- adk-cli - CLI launcher
License
Apache-2.0
Part of ADK-Rust
This crate is part of the ADK-Rust framework for building AI agents in Rust.