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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

a2a_adapter-0.2.13.tar.gz (93.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a2a_adapter-0.2.13-py3-none-any.whl (101.2 kB view details)

Uploaded Python 3

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

Hashes for a2a_adapter-0.2.13.tar.gz
Algorithm Hash digest
SHA256 b594bde9d1b1f344df0b10a8c3b8ac5021bf046c28ae796112766343f3a208ed
MD5 6279cb578be5d3a702f2c0af166cc4de
BLAKE2b-256 e137917c322120df144fadcaff241fe4a308d9b61f54cccb6b8c8e5a69ec53f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2a_adapter-0.2.13.tar.gz:

Publisher: publish.yml on hybroai/a2a-adapter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for a2a_adapter-0.2.13-py3-none-any.whl
Algorithm Hash digest
SHA256 73fbc4d45b240a475c4671dd0cbdd2d0deec125135d4beee24f314e61390975a
MD5 c4e2062780caf87dc4dba90bb1dc6a68
BLAKE2b-256 eca8c91cb74c0605cee0a6d90342d9f0edc89b9253677f9f0ff84abac4a399d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for a2a_adapter-0.2.13-py3-none-any.whl:

Publisher: publish.yml on hybroai/a2a-adapter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.13 This release

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page