a2aproject/a2a-js

Official JavaScript SDK for the Agent2Agent (A2A) Protocol

What it solves

Building and connecting AI agents requires a standardized protocol for communication, task execution, and streaming. The A2A JavaScript SDK provides a complete TypeScript implementation of the Agent2Agent (A2A) Protocol v1.0, enabling developers to build interoperable servers that expose agent capabilities and clients that discover and drive them.

How it works

On the server side, developers implement business logic using an AgentExecutor and orchestrate requests through a DefaultRequestHandler that supports JSON-RPC, HTTP+JSON/REST, and gRPC transports. On the client side, a ClientFactory automatically discovers agent capabilities and selects the best available transport. The SDK also includes options for persistent storage via Kysely, webhook push notifications, interceptors, and a backward-compatibility layer for v0.3 peers.

Who it’s for

This library is designed for TypeScript and JavaScript developers building agentic applications, multi-agent systems, or services that need to communicate using the standardized Agent2Agent Protocol.

Highlights

  • Implements the official Agent2Agent Protocol Specification v1.0.
  • Supports three wire transports: JSON-RPC, HTTP+JSON/REST, and gRPC (Node.js only).
  • Persistent storage options for tasks and push notifications using PostgreSQL, MySQL, SQLite, or Cloudflare D1.
  • Built-in opt-in backward compatibility layer for interacting with v0.3 protocol peers.
  • Extensible via client/server interceptors, plugins, and custom protocol extensions.

Related

  • Project
  • Project
  • Project
  • Project
  • Project