Skip to content

A2a Adapter

Open Source A2A Protocol Adapter SDK for Different Agent Frameworks and Harnesses

Install

$pip install a2a-adapter

Install command taken from the project's README or registry entry. Always review code before running it.

A2A Adapter

Make any AI agent an A2A Protocol server: a few lines of Python for your own agent, or one command for a local agent like Claude Code or Pi.

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.

Two Ways to Use It

Python SDK CLI
Use it when You're writing an agent (or wrapping a framework) and want it to speak A2A You want to put an existing local agent such as Claude Code or Pi on A2A, without writing code
Install pip install a2a-adapter in your project's virtualenv uv tool install a2a-adapter (or pipx install a2a-adapter)
Run serve_agent(adapter, port=9000) in your code a2a-adapter claude --port 9010

Both need Python 3.11+ and serve the same A2A server, with an auto-generated Agent Card at /.well-known/agent-card.json.

1. Use It as an SDK

Add A2A support to your own agent code. Install a2a-adapter into your project's virtual environment, with extras for the framework you use:

pip install a2a-adapter              # core
pip install "a2a-adapter[langchain]" # or [crewai], [langgraph], [all]

Wrap your agent in an adapter and serve it:

from a2a_adapter import CallableAdapter, serve_agent

async def my_agent(inputs: dict) -> str:
    return f"Echo: {inputs['message']}"

adapter = CallableAdapter(func=my_agent, name="Echo Agent")
serve_agent(adapter, port=9000)

Your agent is now an A2A server at http://localhost:9000, with its Agent Card at http://localhost:9000/.well-known/agent-card.json. To mount it in an existing ASGI app instead, use to_a2a(adapter).

Supported 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 quickstart.py
Custom class BaseA2AAdapter Optional custom_adapter.py

2. Use It as a CLI

Start a classic local agent (Claude Code, Codex, Pi, or OpenClaw) as an A2A server with one command.

Install the CLI as an isolated tool, so the a2a-adapter command lands on your PATH:

uv tool install a2a-adapter    # or: pipx install a2a-adapter

Similar plugs

Orca is the ADE for working with a fleet of parallel agents. Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

CLI proxy that reduces LLM token consumption by 60-90% on common dev commands. Single Rust binary, zero dependencies

Documented system prompts from Anthropic - Claude Fable 5.1, Opus 5.5, Claude Design, Claude Code. OpenAI - ChatGPT GPT-6-Astra, Codex. Google - Gemini 3.8 Flash, 3.1 Pro,…

Wrap Antigravity, ChatGPT Codex, Claude Code, Grok Build, Muse Code, Devin as an OpenAI/Gemini/Claude/Codex compatible API service, allowing you to enjoy the free Gemini…