How A2A Works
The Problem
MCP connects agents to tools. But what about agent-to-agent communication?
Without A2A:
Agent A (LangGraph) -- cannot talk to -- Agent B (CrewAI)
With A2A:
Agent A (any framework) <-- A2A Protocol --> Agent B (any framework)Agent Cards (Discovery)
Every A2A agent publishes an Agent Card at /.well-known/agent.json:
{
"name": "security-auditor",
"description": "Scans code for security vulnerabilities",
"capabilities": ["security_audit", "dependency_scan", "owasp_check"],
"endpoint": "https://security-agent.example.com/a2a",
"authentication": { "type": "bearer" }
}Other agents discover capabilities by fetching Agent Cards.
Task Delegation
from a2a import A2AClient
client = A2AClient("https://security-agent.example.com/a2a")
# Send a task to the security agent
result = await client.send_task({
"type": "security_audit",
"input": {"code": "...", "language": "python"}
})
# result: {"vulnerabilities": [...], "risk_score": "low"}Streaming Responses
async for chunk in client.stream_task({"type": "code_review", "input": {...}}):
print(chunk) # Real-time updates from the remote agentMulti-Agent Architecture
Orchestrator Agent
|-- A2A --> Code Writer Agent (writes code)
|-- A2A --> Security Agent (reviews for vulnerabilities)
|-- A2A --> Test Agent (generates and runs tests)
|-- A2A --> Deploy Agent (deploys to production)A2A vs MCP
| Protocol | Connects | Direction |
|---|---|---|
| MCP | Agent <-> Tool | Agent calls tools |
| A2A | Agent <-> Agent | Agents collaborate |
They are complementary:
- MCP: Agent uses a GitHub tool to create a PR
- A2A: Agent asks another agent to review the PR
Key Stats
- 10,000+ GitHub stars
- By Google DeepMind
- Agent discovery via Agent Cards
- Task delegation with streaming
- Framework-agnostic
FAQ
Q: What is A2A? A: An open protocol by Google for AI agents to discover and communicate with each other, enabling multi-agent systems across different frameworks.
Q: Is A2A free? A: Yes, open protocol and SDK under Apache 2.0.
Q: A2A vs MCP? A: MCP connects agents to tools. A2A connects agents to other agents. Use both together for full agent ecosystems.