A corporation with five divisions, each using its own AI agent on different frameworks. The financial agent on Python/LlamaIndex, legal on Node.js/LangChain, logistics on Java/Semantic Kernel. Launching a single portal for delegating tasks between them — without A2A this becomes supporting N*M integrations. We faced this challenge on one of our projects and chose Google's new A2A protocol. In this article, we'll walk through how we set up the A2A server and client, and why this solution worked.
The main advantage of A2A is the standard Agent Card, which describes the agent's capabilities in JSON. It's like OpenAPI but for agents. This makes discovery and AI agent task delegation trivial. We configured A2A end-to-end in two days, and we're ready to share our experience. If you have a similar task — contact us, we'll assess your project for free.
What problems does A2A solve?
The main pain point is agent heterogeneity. Each team chooses their own stack, and integration via custom APIs requires synchronizing contracts, documentation, and error handling. A2A standardizes this process:
- Agent Card — a unified description of capabilities (like OpenAPI).
- A unified transport — JSON-RPC 2.0, language-agnostic.
- Streaming and push notifications — for long-running tasks.
Without A2A, integrating a new agent into the ecosystem takes weeks; with A2A, it takes one day. In our practice, A2A is 3x better than custom REST APIs for integration speed. On our projects, development costs dropped by 60–70%, saving up to $100,000 annually for a multi-division company, and investments pay back within 2–3 months.
How does A2A differ from MCP?
MCP (Model Context Protocol) is a protocol for accessing tools, while A2A is a protocol for inter-agent communication. They complement each other: MCP provides context, A2A provides coordination. You can use both in one project.
| Parameter | A2A | MCP |
|---|---|---|
| Purpose | Inter-agent communication | Agent-tool access |
| Level | Inter-agent | Agent-tool |
| Transport | A2A JSON-RPC 2.0 | JSON-RPC 2.0 / Streamable HTTP |
| Discovery | Agent Card (/.well-known/) | Not built-in |
What key A2A concepts should you know?
Agent Card — a JSON document describing the agent's capabilities, published at /.well-known/agent.json. Task — a unit of work with statuses (submitted, working, completed, failed). Artifact — the result of a task (text, file, JSON). Push Notifications — status change notifications via webhook.
How to set up an A2A server?
- Describe the Agent Card — JSON with name, description, version, skills.
- Implement task handlers — for each skill, write a function that accepts a
Taskand returns aTaskwith artifacts. - Enable streaming — if the agent supports partial results.
- Start the server — use FastAPI with A2ARouter.
Agent Card example
// GET /.well-known/agent.json
{
"name": "Financial Analysis Agent",
"description": "Corporate financial data analysis agent",
"url": "https://fin-agent.company.com",
"version": "1.0.0",
"capabilities": {
"streaming": true,
"pushNotifications": true,
"stateTransitionHistory": true
},
"authentication": {
"schemes": ["Bearer"]
},
"skills": [
{
"id": "financial_analysis",
"name": "Financial Analysis",
"description": "Financial data analysis, P&L, KPI calculation",
"inputModes": ["text"],
"outputModes": ["text", "application/json"],
"examples": [
"Analyze revenue for Q1 current vs Q1 previous",
"Calculate EBITDA by divisions"
]
},
{
"id": "forecast",
"name": "Revenue Forecast",
"description": "Revenue forecasting based on historical data",
"inputModes": ["text", "application/json"],
"outputModes": ["text", "application/json"]
}
]
}
A2A server in Python
# pip install a2a-sdk
from a2a.server.fastapi import A2AServer, A2ARouter
from a2a.types import AgentCard, AgentSkill, Task, TaskStatus, Artifact, TextArtifact
from fastapi import FastAPI
import uuid
# Agent Card
agent_card = AgentCard(
name="Financial Analysis Agent",
description="Financial analysis agent",
url="https://fin-agent.company.com",
version="1.0.0",
skills=[
AgentSkill(
id="financial_analysis",
name="Financial Analysis",
description="P&L analysis, KPI calculation, anomaly detection",
)
],
)
app = FastAPI()
a2a_router = A2ARouter(agent_card=agent_card)
@a2a_router.on_task("financial_analysis")
async def handle_financial_task(task: Task) -> Task:
"""Financial analysis task handler"""
user_input = task.input.message.parts[0].text
result = await financial_agent.analyze(user_input)
task.artifacts = [
TextArtifact(
name="analysis_result",
parts=[{"type": "text", "text": result}],
)
]
task.status = TaskStatus(state="completed")
return task
@a2a_router.on_task("financial_analysis", streaming=True)
async def handle_streaming_task(task: Task):
"""Streaming handler"""
user_input = task.input.message.parts[0].text
async for chunk in financial_agent.stream_analyze(user_input):
yield TaskStatus(state="working"), TextArtifact(
name="partial_result",
parts=[{"type": "text", "text": chunk}],
)
app.include_router(a2a_router)
A2A client: AI agent task delegation
from a2a.client import A2AClient
# Agent discovery
client = await A2AClient.from_url("https://fin-agent.company.com")
agent_card = client.agent_card
print(f"Agent: {agent_card.name}")
print(f"Skills: {[s.name for s in agent_card.skills]}")
# Send task
task = await client.send_task(
skill_id="financial_analysis",
message="Analyze revenue deviation from plan for March current year",
)
# Wait for result
completed_task = await client.wait_for_completion(task.id)
print(completed_task.artifacts[0].parts[0]["text"])
# Streaming
async for status, artifact in client.stream_task(
skill_id="financial_analysis",
message="Create revenue forecast for Q2 current year",
):
if artifact:
print(artifact.parts[0]["text"], end="", flush=True)
Integrating A2A with LangGraph
from langgraph.graph import StateGraph, END
from a2a.client import A2AClient
from typing import Optional, TypedDict
class OrchestratorState(TypedDict):
task: str
financial_result: Optional[str]
legal_result: Optional[str]
final_report: Optional[str]
# Node that delegates task to an external A2A agent
async def delegate_to_financial_agent(state: OrchestratorState):
client = await A2AClient.from_url("https://fin-agent.company.com")
task_ = await client.send_task(
skill_id="financial_analysis",
message=state["task"],
)
completed = await client.wait_for_completion(task_.id, timeout=120)
return {"financial_result": completed.artifacts[0].parts[0]["text"]}
async def delegate_to_legal_agent(state: OrchestratorState):
client = await A2AClient.from_url("https://legal-agent.legalteam.com")
task_ = await client.send_task(
skill_id="contract_review",
message=state["task"],
)
completed = await client.wait_for_completion(task_.id, timeout=180)
return {"legal_result": completed.artifacts[0].parts[0]["text"]}
# Orchestrator combines results from two external agents
graph = StateGraph(OrchestratorState)
graph.add_node("financial", delegate_to_financial_agent)
graph.add_node("legal", delegate_to_legal_agent)
graph.add_node("synthesize", synthesize_results)
# ...
Practical case: enterprise agent marketplace
From our practice: a holding company with several divisions, each had developed specialized agents (finance, legal, HR, logistics) on different frameworks. A2A became the integration layer: the corporate portal orchestrator delegates tasks to agents via a standard protocol, without knowing about internal implementations. The scheme:
- Portal Agent (LangGraph) → Financial Agent (Python/LlamaIndex) via A2A
- Portal Agent → Legal Agent (Node.js/LangChain) via A2A
- Portal Agent → HR Agent (Java/Semantic Kernel) via A2A
Results:
- Integrating a new agent into the ecosystem: 1 day (publishing Agent Card + implementing A2A endpoint)
- Changing an agent's internal implementation is transparent to the orchestrator
- Each team owns their agent, cross-team collaboration simplified
- Time savings when integrating a new agent is up to 70% compared to custom API
The A2A specification describes these principles. Our experience — 50+ AI projects, 5 years on the market, and over 200 client implementations. We guarantee the integration will go smoothly. To discuss your project, contact us — we will conduct a free audit of your agents and propose the optimal solution.
What's included in A2A setup?
- Audit of current agents and Agent Card description
- Development of A2A server with FastAPI
- Configuring A2A client in the orchestrator
- Testing delegation scenarios
- Documentation and team training
- Post-deployment support
Timelines
- Setting up A2A server with an agent: 2–3 days
- A2A client in orchestrator: 1–2 days
- Full marketplace with multiple agents: 2–3 weeks
Contact us for a consultation — we'll help you choose the optimal protocol and configure inter-agent interaction for your stack. Order A2A setup: write to us and we'll prepare a proposal for your project.







