Skip to main content

Overview

The A2A (Agent-to-Agent) protocol enables standardized agent discovery and inter-agent communication. aixyz implements A2A protocol version 0.3.0 with an agent card for discovery and a JSON-RPC endpoint for task execution.

Endpoints

Agent Card

The agent card is automatically generated from your aixyz.config.ts. Other agents fetch this card to discover your agent’s capabilities.
Example response:

JSON-RPC Endpoint

The /agent endpoint accepts JSON-RPC 2.0 requests. The primary method is tasks/send:

Capabilities

The agent card’s capabilities field is configured via the capabilities export from your agent file. If omitted, defaults to { streaming: true, pushNotifications: false }.
app/agent.ts
When streaming is false, the executor uses agent.generate() instead of agent.stream(), returning a single artifact with the full response. See agent.ts — Capabilities for the full reference.

Using the A2A Plugin

The A2APlugin wires up both endpoints on your server:
This registers:
  • A GET handler at /.well-known/agent-card.json serving the agent card
  • A POST handler at /agent routing JSON-RPC requests to ToolLoopAgentExecutor

Sub-Agent Routing

Pass multiple entries with a name to mount sub-agents under their own paths:
app/server.ts
Each sub-agent gets its own agent card at /{name}/.well-known/agent-card.json and its own JSON-RPC endpoint at /{name}/agent. When using app/agents/, the build pipeline generates these calls automatically.

Payment Integration

When an agent exports an accepts configuration with scheme: "exact", the /agent endpoint is gated behind x402 payment. Clients must include a valid X-Payment header. Agents without accepts are served without payment requirements.

x402 Payments

How payment gating works on A2A endpoints.

MCP Protocol

Expose tools via MCP alongside A2A.