A2A Adapter
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
- Quick Start - end-to-end setup and testing guide
- Examples - runnable examples for each adapter
- Architecture - SDK delegation, request flow, and internals
- Changelog - release notes and migration history
- Contributing - development setup and contribution guide
Star History
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)
| File | Size | Uploaded | |
|---|---|---|---|
| a2a_adapter-0.2.13.tar.gz | 93.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| 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 logRelease 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