A2A and MCP: agents talking to agents and to tools
Tell the two protocols apart. MCP connects an agent to tools; A2A connects independent agents, often run by other teams. Read an agent card, and choose between a local sub-agent, an AgentTool and a remote A2A agent.
Chapter 4Custom agentsLesson 6 of 8ShowHide
Chapter 4 of 7 in Google Cloud Professional Agentic Architect
- A2A and MCP: agents talking to agents and to toolsYou're here
Prerequisites: Building agents with ADK
Two protocols, two boundaries
The ADK lesson composed agents inside one app: a sub-agent takes over the conversation, and an AgentTool is called like a function. Both run in your process, from code you own. Real systems also cross two other boundaries.
- Agent to tool. The agent calls a function with typed arguments and gets a
result: query a table, book a pickup. The Model Context Protocol
() standardises this. An MCP server publishes tools
with names, descriptions and parameter schemas; an agent lists them
(
tools/list) and calls them. - Agent to agent. The agent asks another agent, often run by another team or company, to do a piece of work. That agent has its own model, tools, instructions and state, and it may take minutes, ask a follow-up question or return files. The Agent2Agent protocol () standardises this.
The A2A project puts it this way. MCP is vertical: it deepens a single agent.
A2A is horizontal: it connects agents across a boundary. The line is about
what you are calling, not what each protocol can do: current MCP also has
experimental tasks (deferred results with status tracking, including an
input_required status) and elicitation, where a server asks the user for more
information through the client. Choose A2A when the other side is an agent that
someone else owns and publishes as an agent; choose MCP when you are exposing
or calling tools. A2A is an open project
under the Linux Foundation, contributed by Google, and its current specification is
version 1.0.
What A2A exchanges
An A2A client sends a message (a role and one or more parts: text, a file
or structured data) to a remote agent. The remote agent's work is a task,
which moves through states: submitted, working, input-required (it needs
an answer from the client), auth-required (it needs further credentials), and
finally completed, failed, canceled or rejected. Its artifacts are
the files or structured data the task produces. Long work can stream updates
over server-sent events (a long-lived HTTP response the server keeps writing
updates to), or send push notifications (the server calls a URL you registered
when the task changes), so the client does not have to keep asking.
The remote agent stays opaque: the client sees its advertised skills, never its prompts, tools or reasoning. That is the point. The finance team can change its model or tools without breaking yours, and keeps its internals private.
Your agent calls a partner's agent over A2A. What can your agent see of it?
Follow one support agent across both boundaries: two MCP tool calls, then a refund check by the finance team's fraud-review agent over A2A. Predict first: can the support agent see the fraud-review agent's tools? Then step through and watch what crosses each boundary.
Which protocol is vertical and which is horizontal, and what does that mean?
The agent card
A client finds out how to work with a remote agent from its
: a JSON document the A2A server
publishes, usually at https://{domain}/.well-known/agent-card.json. Here is a
shortened card for the finance team's fraud-review agent (A2A 1.0 field names):
{
"name": "Fraud review agent",
"description": "Reviews a refund request for fraud risk and returns approve, reject or escalate, with reasons.",
"version": "1.2.0",
"supportedInterfaces": [
{
"url": "https://fraud-review.example.com/a2a",
"protocolBinding": "JSONRPC",
"protocolVersion": "1.0"
}
],
"capabilities": { "streaming": true, "pushNotifications": false },
"defaultInputModes": ["text/plain", "application/json"],
"defaultOutputModes": ["application/json"],
"skills": [
{
"id": "review-refund",
"name": "Review a refund",
"description": "Assesses one refund request against order and payment history.",
"tags": ["fraud", "refunds"]
}
],
"securitySchemes": {
"google": {
"openIdConnectSecurityScheme": {
"openIdConnectUrl": "https://accounts.google.com/.well-known/openid-configuration"
}
}
},
"securityRequirements": [{ "schemes": { "google": { "list": ["openid"] } } }]
}- Identity:
name,descriptionandversionsay what the agent is. - Endpoint:
supportedInterfacesgives the URL, the protocol binding (the wire format and transport requests use: JSON-RPC, gRPC or HTTP+JSON) and the A2A protocol version that interface speaks. - Capabilities: whether it streams or sends push notifications.
- Skills: what it can do, described for the calling agent's model, much as a tool's description is.
- Security:
securitySchemesdefines the authentication methods, here OpenID Connect (an identity layer on OAuth 2.0 that issues signed ID tokens), andsecurityRequirementssays which of them the server requires. The card holds no secrets: the client obtains credentials separately, such as a token from the identity provider, and sends them with every request. The server authenticates each request against the requirements its card declares; the card only declares them, so the server's own code must enforce them.
Cards are also how agents are discovered at scale. Agent Registry, Google Cloud's catalogue of agents and MCP servers, indexes A2A agent cards alongside MCP servers, and agents deployed on Agent Runtime (Google Cloud's managed service for running agents) are registered there automatically. Gemini Enterprise, Google's workplace agent app, lets an administrator add an A2A agent by entering its card. Check which A2A version a product supports: Gemini Enterprise supports A2A 0.3's streaming mechanism, so a 1.0 agent also advertises a 0.3 interface, using the compatibility packages.
Local or remote: three designs for one scenario
The support agent needs three kinds of help:
| Need | Design | Why |
|---|---|---|
| A returns specialist your team owns, which should take over once a return starts | Sub-agent | Same code and release, and control should pass to it |
| A summariser your team owns, whose result comes back to the support agent | AgentTool | Same code, and the caller keeps control |
| The finance team's fraud-review agent | over A2A | Another team owns, deploys, scales and secures it |
| Sub-agent | AgentTool | Remote A2A agent | |
|---|---|---|---|
| Runs in | Your process | Your process | Another service |
| Owned by | You | You | Often another team |
| Coupling | Shared code and release | Shared code and release | Only the card and the protocol |
| Identity | Your app's | Your app's | Authenticated per request, as the card requires |
| Latency | In process | In process | A network call, possibly a long task |
Go remote when another team owns, scales or secures the agent, not merely because a capability sounds separate. Every remote hop adds latency, a deployment and an authentication path to keep working.
A2A in ADK
ADK can serve an agent over A2A and call a remote one. To serve the
fraud-review agent, the finance team wraps it in its agent.py:
from google.adk.a2a.utils.agent_to_a2a import to_a2a
a2a_app = to_a2a(fraud_review_agent, port=8001) # local test: uvicorn agent:a2a_app --port 8001to_a2a builds an agent card from the agent's name, description and tools
unless you pass your own. By default the card advertises http://localhost, so
a deployed agent passes its real host and protocol, or its own card. On the calling side, a remote agent joins your agent
like a sub-agent, but every turn crosses the network:
from google.adk.agents import LlmAgent
from google.adk.agents.remote_a2a_agent import RemoteA2aAgent
fraud_review = RemoteA2aAgent(
name="fraud_review",
description="Reviews refund requests for fraud risk. Use before approving a refund over 200 EUR.",
agent_card="https://fraud-review.example.com/.well-known/agent-card.json",
)
support_agent = LlmAgent(
name="support_agent",
model="gemini-flash-latest",
instruction="You help customers with orders and refunds.",
sub_agents=[fraud_review],
)The finance team can host its agent on Cloud Run (Google Cloud's serverless container service) or on Agent Runtime, both of which document A2A agents (in Preview at the time of writing).
Sources
Show 9 sourcesHide sources
| Source | Publisher | What it supports |
|---|---|---|
| "Tasks" (experimental) and "Elicitation" (opens in a new tab) | Model Context Protocol specification 2025-11-25 | deferred results with status tracking and an input_required status; servers can request more information from users through the client |
| A2A Protocol Specification (opens in a new tab) | A2A Project | agent card, task, message, part, artifact; task states; well-known path /.well-known/agent-card.json; protocol bindings JSON-RPC, gRPC and HTTP+JSON; security schemes; every request authenticated against the declared requirements |
| A2A and MCP (opens in a new tab) | A2A Project | MCP is vertical, A2A is horizontal; agents partnering versus using capabilities |
| README (opens in a new tab) | A2A Project | an open source project under the Linux Foundation, contributed by Google |
| "A2A quickstart: exposing" and "A2A quickstart: consuming" (opens in a new tab) | Google, Agent Development Kit documentation | to_a2a; RemoteA2aAgent with name, description and agent_card |
| Create an Agent2Agent agent (opens in a new tab) | Google Cloud | Agent Runtime A2A agents, Preview |
| A2A agents on Cloud Run (opens in a new tab) | Google Cloud | Preview |
| Agent Registry and the A2A protocol (opens in a new tab) | Google Cloud | indexes A2A agent cards; automatic registration on Agent Runtime |
| Register and manage an A2A agent (opens in a new tab) | Google Cloud | agent card entered as JSON; A2A v0.3 streaming; Preview |
Suggested videos
Show 3 videosHide videos
Stop using MCP for everything! (RAG vs. A2A vs. Sub-agents) (opens YouTube in a new tab)
Decides between RAG, MCP, sub-agents and A2A on one worked example, which is the lesson's 'local sub-agent vs AgentTool vs remote A2A' choice.
Note: May predate the A2A v1.0 details.
Introduction to Agent2Agent (A2A) Protocol (opens YouTube in a new tab)
Official A2A intro: agent cards, tasks and streaming, plus how A2A differs from MCP.
Note: Recorded before A2A v1.0, which renamed some fields and methods: check names against the v1.0 spec.
A2A and MCP explained: with ADK (opens YouTube in a new tab)
Code walkthrough of exposing an ADK agent over A2A and calling it through a remote agent, with a real agent card.
Note: Uses a pre-v1.0 A2A SDK. An optional deeper dive.
Review
What does MCP connect, and what does A2A connect?
Check yourself
The finance team runs a fraud-review agent as its own service, with its own model, tools and release schedule. Your support agent must ask it to review refund requests. What is the best design?
Go deeper
Hands-on lab: Getting Started with MCP & A2A with ADK →
Build one agent that uses MCP for tools and A2A for other agents. Codelab, runs in your own Google Cloud project with billing on.
LinkHands-on lab: Connect to Remote Agents with ADK and the Agent2Agent (A2A) SDK →
Expose ADK agents over A2A and call them as remote agents. About 1 h 30 min. Google Skills lab: sign-in and credits needed, temporary project provided.