Golang SDK for A2A Protocol
a2a-go is an established Go project in the AI payments / x402 ecosystem, focused on a2a, a2a-client, a2a-protocol, a2a-server. It currently has 421 GitHub stars and 83 forks, and sits alongside related tools like a2a-elixir, a2a-php, capiscio-sdk-python, apcore-a2a, a2a, blocklace-a2a.
The official Golang SDK for the A2A protocol, from the a2aproject org: client and server building blocks for agent-to-agent communication in Go.
Go is the language of payment middleware and high-throughput services, so a first-party A2A SDK here is strategically important: it lets Go services join agent networks as citizens, not just as HTTP endpoints. If you are running Go infrastructure and want your services discoverable and callable by other agents (paid or not), this is the standards-track way in.
Best for: Go teams integrating with the A2A ecosystem — pair with an x402 middleware to charge for what you expose.
a2asrv) and consuming it (a2aclient).Note: The SDK version is distinct from the A2A specification version. The supported protocol version is exported in the codebase as
a2a.Version
Requires Go 1.25.0 or newer:
go get github.com/a2aproject/a2a-go/v2
Visit pkg.go for a full documentation.
For a simple example refer to the helloworld example.
For a full documentation visit pkg.go.dev/a2asrv.
Create a transport-agnostic A2A request handler:
var options []a2asrv.RequestHandlerOption = newCustomOptions()
var agentExecutor a2asrv.AgentExecutor = newCustomAgentExecutor()
requestHandler := a2asrv.NewHandler(agentExecutor, options...)
Wrap the handler into a transport implementation:
grpcHandler := a2agrpc.NewHandler(requestHandler)
// or
jsonrpcHandler := a2asrv.NewJSONRPCHandler(requestHandler)
// or
restHandler := a2asrv.NewRESTHandler(requestHandler)
Register handler with a server, for example:
import "google.golang.org/grpc"
...
server := grpc.NewServer()
grpcHandler.RegisterWith(server)
err := server.Serve(listener)
// or
http.Handle("/", restOrJSONRPCHandler)
err := http.ListenAndServe(":8080", nil)
For a full documentation visit pkg.go.dev/a2aclient.
Resolve an AgentCard to get an information about how an agent is exposed.
card, err := agentcard.DefaultResolver.Resolve(ctx)
Create a transport-agnostic client from the AgentCard:
var options a2aclient.FactoryOption = newCustomClientOptions()
client, err := a2aclient.NewFromCard(ctx, card, options...)
The connection is now open and can be used to send requests to a server:
msg := a2a.NewMessage(a2a.MessageRoleUser, a2a.NewTextPart("..."))
resp, err := client.SendMessage(ctx, &a2a.SendMessageRequest{Message: msg})
The SDK ships with a command-line tool for working with A2A agents - send messages, inspect tasks, resolve agent cards, or setup simple a2a servers.
# Install
go install github.com/a2aproject/a2a-go/v2/cmd/a2a@latest
# Discover an agent
a2a discover https://agent.example.com
# Send a message
a2a send https://agent.example.com "Hello, what can you do?"
# Expose a local script as an A2A agent
a2a serve --exec "./my-script.sh" --port 8080
See cmd/README.md or run a2a help for the full command reference.
You can find a variety of more detailed examples in the a2a-samples repository.
Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines on how to get involved.
Before starting work on a new feature or significant change, please open an issue to discuss your proposed approach with the maintainers. This helps ensure your contribution aligns with the project's goals and prevents duplicated effort or wasted work.
This project is licensed under the Apache 2.0 License. See the LICENSE file for more details.
Elixir implementation of the Agent-to-Agent (A2A) protocol (https://a2a-protocol.org).
A2A PHP SDK - PHP implementation of the AI A2A (Agent-to-Agent) Protocol (v0.2.5-0.3.0)
Runtime security middleware for A2A (Agent-to-Agent) protocol agents. Provides always-on validation, signature verification, and rate limiting for AI agent interactions.
apcore-a2a acts as a thin, protocol-specific layer on top of `apcore-python`. It maps A2A concepts to apcore primitives
🌐 Build seamless Agent-to-Agent communication with the A2A framework, offering real-time interactions and cross-platform support in TypeScript.
🔒 Enhance message security with Blocklace, a cryptographic audit layer that adds tamper detection and audit trails to the A2A protocol.
Your AI trading terminal assistant for US stocks, commodities, forex, and crypto.
Publishes localhost services to the agentic web through self-hostable, trustless relays with x402 payments.
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Building blocks for Agentic payments (x402, MPP, AP2) for TypeScript, Rust, Go, Python, Ruby, PHP, Lua, Kotlin and Swift.
Go implementation of the x402 payment protocol
URL shortener