A2A Adapter is a Python library and CLI that exposes an existing AI agent as an Agent-to-Agent (A2A) Protocol server. It wraps agent CLIs, local agents, workflow engines, and Python agent frameworks, and it handles AgentCard generation, JSON-RPC, task lifecycle, and streaming through the official A2A SDK, so an adapter only needs to invoke the underlying agent.
From the command line you can expose an installed local agent from the current directory without writing Python, such as Claude Code or Codex. Options before -- configure the A2A server (port, host, working directory) and options after -- pass through to the agent CLI, while protocol and session flags such as Pi's --mode rpc and Codex's --json are owned by the adapter and cannot be overridden. The Python SDK produces the same server and an auto-generated AgentCard at /.well-known/agent-card.json for embedding A2A support in an application or wrapping a custom function.
| Framework or agent | Adapter | Streaming |
|---|---|---|
| Claude Code | ClaudeCodeAdapter | Yes |
| Codex | CodexAdapter | No |
| Pi | PiAdapter | Yes |
| OpenClaw | OpenClawAdapter | No |
| n8n | N8nAdapter | No |
| LangGraph | LangGraphAdapter | Yes |
| LangChain | LangChainAdapter | Yes |
| CrewAI | CrewAIAdapter | No |
| Ollama | OllamaAdapter | Yes |
| Hermes Agent | HermesAdapter | Yes |
| Python callable | CallableAdapter | Optional |
| Custom class | BaseA2AAdapter | Optional |
Features
- CLI exposure: serve Claude Code, Codex, Pi, or OpenClaw as A2A servers with one command and pass agent flags after --
- Python SDK: serve_agent with a CallableAdapter or framework adapter for embedding in applications
- Protocol handling: AgentCard generation, JSON-RPC, task lifecycle, and streaming delegated to the official A2A SDK
- Framework adapters: LangGraph, LangChain, CrewAI, Ollama, n8n, and Hermes Agent alongside the CLI agents
- Custom adapters: subclass BaseA2AAdapter for agents not covered by a built-in adapter
- Server options: --cwd to choose the working directory and --host for external reachability

