Skip to main content

A2A Adapter

PyPI version License: Apache-2.0 Python 3.11+

Expose your AI agent as an A2A Protocol server in a few lines of Python.

a2a-adapter wraps agent CLIs, local agents, workflow engines, and Python agent frameworks behind the A2A (Agent-to-Agent) Protocol. It handles AgentCard generation, JSON-RPC, task lifecycle, and streaming through the official A2A SDK, so your adapter only needs to invoke the underlying agent.

Works with Claude Code, Codex, Pi, OpenClaw, n8n, LangGraph, LangChain, CrewAI, Ollama, Hermes Agent, and custom Python functions.

Install

pip install a2a-adapter

CLI Use Case

Use the CLI when you want to expose an already installed local agent from the current terminal directory without writing Python:

a2a-adapter pi --port 9012
a2a-adapter codex --port 9011
a2a-adapter claude --port 9010
a2a-adapter openclaw --port 9008

Options before -- configure the A2A server. Options after -- are passed to the underlying agent CLI:

a2a-adapter pi --port 9012 -- --model <model> --thinking high
a2a-adapter codex --port 9011 -- --model <model> --sandbox workspace-write
a2a-adapter claude --port 9010 -- --model <model>
a2a-adapter openclaw --port 9008 --agent-id main --thinking high

Use --cwd /path/to/project to choose another working directory and --host 0.0.0.0 when the server must be reachable outside the local machine. Pi source commands can be selected without a shell wrapper:

A2A_PI_COMMAND='npx tsx /path/to/pi/packages/coding-agent/src/cli.ts' \
  a2a-adapter pi --port 9012

Run a2a-adapter -help for the supported agents, or a2a-adapter <agent> -help for agent-specific usage. The adapter owns protocol and session flags such as Pi's --mode rpc and Codex's --json; those flags cannot be overridden after --.

Python SDK Use Case

Use the Python SDK when embedding A2A support in an application, wrapping a Python framework, or providing custom adapter configuration:

from a2a_adapter import CallableAdapter, serve_agent

adapter = CallableAdapter(func=lambda inputs: f"Echo: {inputs['message']}", name="Echo")
serve_agent(adapter, port=9000)

The SDK produces the same A2A server and auto-generated AgentCard:

http://localhost:9000/.well-known/agent-card.json

Supported Python SDK Adapters

Framework or agent Adapter Streaming Example
Claude Code ClaudeCodeAdapter Yes claude_code_agent.py
Codex CodexAdapter No codex_agent.py
Pi PiAdapter Yes pi_agent.py
OpenClaw OpenClawAdapter No openclaw_agent.py
n8n N8nAdapter No n8n_agent.py
LangGraph LangGraphAdapter Yes langgraph_server.py
LangChain LangChainAdapter Yes langchain_agent.py
CrewAI CrewAIAdapter No crewai_agent.py
Ollama OllamaAdapter Yes ollama_agent.py
Hermes Agent HermesAdapter Yes hermes_agent.py
Python callable CallableAdapter Optional v02_quickstart.py
Custom class BaseA2AAdapter Optional custom_adapter.py

Documentation

Star History

Star History Chart

License

Apache-2.0 - see LICENSE.

Built by HYBRO AI. Powered by the A2A Protocol.

Metadata

Release files for a2a-adapter 0.2.13

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a2a-adapter 0.2.13
File Size Uploaded
a2a_adapter-0.2.13.tar.gz 93.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for a2a-adapter 0.2.13
File Interpreter ABI Platform
a2a_adapter-0.2.13-py3-none-any.whl Python 3 none any Details

Total release size: 194.5 kB

Release files / a2a_adapter-0.2.13.tar.gz

Download URL a2a_adapter-0.2.13.tar.gz
Size 93.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b594bde9d1b1f344df0b10a8c3b8ac5021bf046c28ae796112766343f3a208ed
BLAKE2b-256 checksum
How to use checksums
e137917c322120df144fadcaff241fe4a308d9b61f54cccb6b8c8e5a69ec53f5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

Release files / a2a_adapter-0.2.13-py3-none-any.whl

Download URL a2a_adapter-0.2.13-py3-none-any.whl
Size 101.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73fbc4d45b240a475c4671dd0cbdd2d0deec125135d4beee24f314e61390975a
BLAKE2b-256 checksum
How to use checksums
eca8c91cb74c0605cee0a6d90342d9f0edc89b9253677f9f0ff84abac4a399d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 10, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.13 This release

2 release files

0.2.12

2 release files

0.2.10

2 release files

0.2.9

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page