vtcode-a2a
Agent2Agent (A2A) Protocol support for VT Code. Provides client and server implementations for the A2A protocol, enabling inter-agent communication.
Agent2Agent (A2A) Protocol support for VT Code.
Modules
| Module | Purpose |
|---|---|
agent_card |
Agent discovery and capability advertisement |
client |
A2A protocol client |
cli |
CLI interface for A2A commands |
errors |
A2A-specific error types |
rpc |
JSON-RPC message types and protocol constants |
server |
Authenticated HTTP server (feature-gated: a2a-server) |
task_manager |
Task lifecycle management |
types |
Core A2A protocol types (Message, Task, Part, etc.) |
webhook |
Push notification support |
Features
| Feature | Description |
|---|---|
a2a-server |
Enables the HTTP server module (axum, tower, tower-http) |
Usage
use ;
let card = vtcode_default;
let client = new;
Server security
The agent card endpoint is public for discovery. The /a2a and
/a2a/stream endpoints require an Authorization: Bearer <token> header.
A2aServerState::new generates a random token; use auth_token() to pass it
to a client, or use new_with_auth_token to provide one explicitly. Cross-origin
browser access is disabled by default.
Webhook destinations must use HTTPS, or HTTP to the exact localhost host or
an IP loopback address. Webhook requests do not follow redirects.
use ;
use A2aServerState;
let state = new;
let client = new?.with_bearer_token;
The vtcode a2a CLI reads the token from VTCODE_A2A_TOKEN. Keeping the
token in the environment avoids exposing it in process arguments.