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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file a2a_adapter-0.2.13.tar.gz.
File metadata
- Download URL: a2a_adapter-0.2.13.tar.gz
- Upload date:
- Size: 93.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b594bde9d1b1f344df0b10a8c3b8ac5021bf046c28ae796112766343f3a208ed
|
|
| MD5 |
6279cb578be5d3a702f2c0af166cc4de
|
|
| BLAKE2b-256 |
e137917c322120df144fadcaff241fe4a308d9b61f54cccb6b8c8e5a69ec53f5
|
Provenance
The following attestation bundles were made for a2a_adapter-0.2.13.tar.gz:
Publisher:
publish.yml on hybroai/a2a-adapter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a2a_adapter-0.2.13.tar.gz -
Subject digest:
b594bde9d1b1f344df0b10a8c3b8ac5021bf046c28ae796112766343f3a208ed - Sigstore transparency entry: 2405538181
- Sigstore integration time:
-
Permalink:
hybroai/a2a-adapter@66a798db3524ccebc7e42a78d0b438ef94505bd2 -
Branch / Tag:
refs/tags/v0.2.13 - Owner: https://github.com/hybroai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@66a798db3524ccebc7e42a78d0b438ef94505bd2 -
Trigger Event:
release
-
Statement type:
File details
Details for the file a2a_adapter-0.2.13-py3-none-any.whl.
File metadata
- Download URL: a2a_adapter-0.2.13-py3-none-any.whl
- Upload date:
- Size: 101.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
73fbc4d45b240a475c4671dd0cbdd2d0deec125135d4beee24f314e61390975a
|
|
| MD5 |
c4e2062780caf87dc4dba90bb1dc6a68
|
|
| BLAKE2b-256 |
eca8c91cb74c0605cee0a6d90342d9f0edc89b9253677f9f0ff84abac4a399d8
|
Provenance
The following attestation bundles were made for a2a_adapter-0.2.13-py3-none-any.whl:
Publisher:
publish.yml on hybroai/a2a-adapter
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
a2a_adapter-0.2.13-py3-none-any.whl -
Subject digest:
73fbc4d45b240a475c4671dd0cbdd2d0deec125135d4beee24f314e61390975a - Sigstore transparency entry: 2405538216
- Sigstore integration time:
-
Permalink:
hybroai/a2a-adapter@66a798db3524ccebc7e42a78d0b438ef94505bd2 -
Branch / Tag:
refs/tags/v0.2.13 - Owner: https://github.com/hybroai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@66a798db3524ccebc7e42a78d0b438ef94505bd2 -
Trigger Event:
release
-
Statement type: