The rising panorama of AI agent growth is overloaded with acronyms: MCP, A2A, UCP, AP2, A2UI, and AG-UI, simply to call just a few. In the event you’ve ever checked out this record of protocols and felt such as you have been observing a wall of competing requirements, you aren’t alone. That will help you perceive their worth, we’re going to reveal what every one does to avoid wasting you from writing and sustaining customized integration code for each single device, API, and frontend part your agent touches.
We’ll put these protocols into follow by utilizing Agent Growth Equipment (ADK) to construct a multi-step provide chain agent for a restaurant. This situation works effectively as a check case as a result of ordering wholesale substances requires checking stock databases, speaking with distant provider brokers, executing safe transactions, and rendering interactive dashboards.
We’ll begin with a naked LLM that hallucinates all the pieces, then add protocols one after the other till it could verify actual stock, get specialist quotes, place orders, authorize funds, and render interactive, streaming dashboards.
1. Mannequin Context Protocol (MCP)
Let’s have a look at the primary hurdle you hit when constructing an agent: connecting it to your programs and your knowledge. In case your kitchen supervisor agent must verify stock or e-mail a provider, you’ll usually have to put in writing customized integration code for that particular API. If a service has a dozen endpoints, you are writing and sustaining a dozen customized instruments only for that service.
The Mannequin Context Protocol (MCP) eliminates this busywork by supplying you with a single commonplace connection sample for a whole lot of servers. Servers promote their instruments, and your agent discovers them routinely. And since the MCP servers are maintained by the groups who constructed these programs, your agent all the time will get the newest device definitions with out you writing or updating any integration code.
ADK offers first-class assist for this by way of McpToolset. As a substitute of writing a bunch of API requests from scratch, our kitchen supervisor can now learn from an actual PostgreSQL database utilizing the MCP Toolbox for Databases, search for recipes by way of the Notion MCP, and take motion by emailing suppliers utilizing the Mailgun MCP.
from google.adk.brokers import Agent
from google.adk.instruments.mcp_tool import McpToolset
from google.adk.instruments.mcp_tool.mcp_session_manager import StdioConnectionParams
from google.adk.instruments.toolbox_toolset import ToolboxToolset
from mcp import StdioServerParameters
# 1. Stock database - MCP Toolbox for Databases (PostgreSQL, SQLite, BigQuery, and many others.)
inventory_tools = ToolboxToolset(server_url=TOOLBOX_URL)
# 2. Kitchen SOPs and recipes - Notion MCP (learn menus, ingredient lists, provider contacts)
notion_tools = McpToolset(connection_params=StdioConnectionParams(
server_params=StdioServerParameters(
command="npx", args=["-y", "@notionhq/notion-mcp-server"],
env={"NOTION_TOKEN": NOTION_TOKEN}),
timeout=30))
# 3. E-mail suppliers about orders - Mailgun MCP (ship confirmations, observe supply)
mailgun_tools = McpToolset(connection_params=StdioConnectionParams(
server_params=StdioServerParameters(
command="npx", args=["-y", "@mailgun/mcp-server"],
env={"MAILGUN_API_KEY": MAILGUN_API_KEY}),
timeout=30))
kitchen_agent = Agent(
mannequin="gemini-3-flash-preview",
title="kitchen_manager",
instruction="You handle a restaurant kitchen. Verify stock, search for recipes, e-mail suppliers.",
instruments=[inventory_tools, notion_tools, mailgun_tools],
)
Python
You’ll be able to browse the complete ecosystem of MCP integrations in ADK to see what’s obtainable.
2. Agent2Agent Protocol (A2A)
With MCP dealing with knowledge entry, the subsequent problem is experience. Your kitchen supervisor can verify stock, but it surely would not know in the present day’s wholesale costs, provider high quality grades, or supply home windows. That data lives with completely different distant brokers, probably constructed by completely different groups, on completely different frameworks, working on completely different servers. In some circumstances, the uncooked knowledge would possibly by no means be uncovered by API however may very well be uncovered by way of an agentic interface. And not using a commonplace protocol, you’d have to put in writing and keep customized integration code for every one, and redeploy each time a distant agent adjustments.
The Agent2Agent (A2A) protocol standardizes how brokers uncover and talk with one another. Every A2A agent publishes an Agent Card at a widely known URL (/.well-known/agent-card.json) that describes its title, capabilities, and endpoint. See the A2A protocol docs for the complete specification.
Our kitchen supervisor agent fetches these playing cards to be taught what every distant agent does, then routes queries to the best one at runtime. Including a brand new distant agent is so simple as including a brand new URL, eliminating the necessity for handbook code change or re-deployments.
ADK’s RemoteA2aAgent routes to at least one distant agent per flip. When a question spans a number of distant brokers, comparable to checking value, high quality, and supply directly, you should use the a2a-sdk instantly, which is the strategy we use right here.
# An A2A agent serves an Agent Card at /.well-known/agent-card.json:
# {
# "title": "pricing_agent",
# "description": "Checks in the present day's wholesale market costs for meals objects.",
# "abilities": [{"id": "pricing", "name": "Price Check",
# "description": "Check current wholesale market prices"}],
# "url": "http://pricing-agent:8001/",
# "model": "1.0.0"
# }
# EXPOSE: Flip any ADK agent into an A2A service
from google.adk.a2a.utils.agent_to_a2a import to_a2a
app = to_a2a(pricing_agent, port=8001)
# DISCOVER: Resolve the Agent Card and create a shopper - only a URL
from a2a.shopper.client_factory import ClientFactory
shopper = await ClientFactory.join("http://pricing-agent:8001")
card = await shopper.get_card()
print(f"{card.title} - {card.description}")
# -> "pricing_agent - Checks in the present day's wholesale market costs for meals objects."
# CALL: Ship a message by way of the A2A protocol
from a2a.shopper.helpers import create_text_message_object
msg = create_text_message_object(content material="What's in the present day's wholesale value for salmon?")
async for response in shopper.send_message(msg):
... # response is a Process (with artifacts) or a direct Message
Python
Attempt the A2A samples to see discovery and communication patterns in motion.
3. Common Commerce Protocol (UCP)
Your agent can now uncover suppliers and get quotes. However when it is time to really place an order, each provider has a unique API. In case your agent must supply substances from 5 wholesale distributors, you are integrating 5 completely different checkout flows.
The Common Commerce Protocol (UCP) standardizes the procuring lifecycle into modular capabilities via strongly typed request and response schemas that stay constant throughout any underlying transport. As a substitute of constructing customized integrations for each provider, your agent interacts with them via a unified sample. This stays true whether or not the connection is established by way of REST, Mannequin Context Protocol (MCP), Agent2Agent (A2A), or Embedded Protocols (EP) for browser-based flows.
Our kitchen supervisor agent can uncover a provider’s catalog utilizing the identical well-known URL sample we noticed in A2A (/.well-known/ucp), then assemble a typed checkout request and full the order. As a result of UCP additionally helps commonplace REST API, it really works with no matter HTTP shopper your mission already makes use of. No proprietary SDK required.
import httpx, uuid
from ucp_sdk.fashions.discovery.profile_schema import UcpDiscoveryProfile
from ucp_sdk.fashions.schemas.procuring.checkout_create_req import CheckoutCreateRequest
from ucp_sdk.fashions.schemas.procuring.varieties.line_item_create_req import LineItemCreateRequest
from ucp_sdk.fashions.schemas.procuring.varieties.item_create_req import ItemCreateRequest
from ucp_sdk.fashions.schemas.procuring.payment_create_req import PaymentCreateRequest
# DISCOVER: Parse the provider's UCP profile
async with httpx.AsyncClient() as c:
profile = UcpDiscoveryProfile.model_validate(
(await c.get("http://example-wholesale:8182/.well-known/ucp")).json())
# ORDER: Construct a typed checkout request
checkout_req = CheckoutCreateRequest(
foreign money="USD",
line_items=[
LineItemCreateRequest(quantity=10, item=ItemCreateRequest(id="salmon")),
LineItemCreateRequest(quantity=3, item=ItemCreateRequest(id="olive_oil")),
],
cost=PaymentCreateRequest(),
)
# SEND: Create checkout + full (with required UCP headers)
# UCP-Agent header ought to level to your agent's functionality profile
headers = {"UCP-Agent": 'profile="https://kitchen.instance/agent"',
"Idempotency-Key": str(uuid.uuid4()), "Request-Id": str(uuid.uuid4())}
async with httpx.AsyncClient() as c:
checkout = (await c.publish("http://example-wholesale:8182/checkout-sessions",
json=checkout_req.model_dump(mode="json", by_alias=True, exclude_none=True),
headers=headers)).json()
headers["Idempotency-Key"] = str(uuid.uuid4()) # New Idempotency-Key per operation
order = (await c.publish(
f"http://example-wholesale:8182/checkout-sessions/{checkout['id']}/full",
headers=headers)).json()
Python
The UCP samples repository consists of an AI-powered procuring assistant constructed with ADK that mixes UCP with A2A for end-to-end procuring workflows.
4. Agent Funds Protocol (AP2)
Within the earlier part, our kitchen supervisor gained the flexibility to put orders with suppliers. However who approved that spending? There is not any report of what limits have been set, which retailers are permitted, or when the authorization expires.
The Agent Funds Protocol (AP2) provides that lacking layer with typed mandates that present non-repudiatable proof of intent and implement configurable guardrails on each transaction. UCP handles what you order and who you order from, whereas AP2 handles who permitted the acquisition and offers the audit path. They work collectively: AP2 plugs into UCP as an extension, including cryptographic proof of authorization to the checkout move.
As a substitute of an uncontrolled transaction, you configure guardrails in your agent to observe. You outline an IntentMandate to specify allowed retailers and set a spending restrict for auto-approval. The agent then generates a PaymentMandate certain to a selected cart and quantity. If the order exceeds the restrict, the mandate stays unsigned till a supervisor explicitly approves it. A PaymentReceipt closes the audit path.
The next code snippet makes use of actual AP2 varieties from the official repo to point out the complete authorization move, from intent via signed mandate to receipt.
from ap2.varieties.mandate import IntentMandate, PaymentMandate, PaymentMandateContents
from ap2.varieties.payment_request import PaymentCurrencyAmount, PaymentItem, PaymentResponse
from ap2.varieties.payment_receipt import PaymentReceipt, Success
# The restaurant proprietor configures guardrails
intent = IntentMandate(
natural_language_description="10 lbs salmon, 3 bottles olive oil",
retailers=["Example Wholesale"], # ONLY these suppliers
requires_refundability=True, # have to be refundable
user_cart_confirmation_required=False, # auto-approve underneath restrict
intent_expiry="2026-02-23T20:00:00Z", # expires in 1 hour
)
# Agent creates a PaymentMandate binding cost to the intent
mandate = PaymentMandate(payment_mandate_contents=PaymentMandateContents(
payment_mandate_id="abc123",
payment_details_id="order-001",
payment_details_total=PaymentItem(
label="10 lbs salmon + 3 bottles olive oil",
quantity=PaymentCurrencyAmount(foreign money="USD", worth=294.00)),
payment_response=PaymentResponse(request_id="order-001", method_name="CARD"),
merchant_agent="Instance Wholesale",
))
# Supervisor indicators (simulated - actual AP2 makes use of JWT/biometric on safe gadget)
mandate.user_authorization = "signed_hash_abc123"
# PaymentReceipt closes the audit path
receipt = PaymentReceipt(
payment_mandate_id="abc123", payment_id="PAY-001",
quantity=PaymentCurrencyAmount(foreign money="USD", worth=294.00),
payment_status=Success(merchant_confirmation_id="ORD-A1B2C3"),
)
# IntentMandate -> PaymentMandate (signed) -> PaymentReceipt
# Full audit path: what was meant, approved, and paid
Python
AP2 is in v0.1 and its varieties are supplied as a separate package deal, not constructed into ADK core. Discover the protocol and reference implementation within the AP2 repo.
5. Agent-to-Person Interface Protocol (A2UI)
At this level, our kitchen supervisor can verify stock, get quotes, place orders, and authorize funds. However each outcome comes again as plain textual content and typically textual content is not sufficient. When your agent must current a list dashboard, an order kind, or a provider comparability, you’d usually should construct a separate frontend part for every one. Each new UI requirement means extra frontend code to put in writing and keep.
The Agent-to-Person Interface Protocol (A2UI) solves this by letting the agent dynamically compose novel layouts from a hard and fast catalog. It makes use of a declarative JSON format made up of simply 18 protected part primitives, comparable to rows, columns, and textual content fields.
A2UI separates the UI construction from the underlying knowledge. The agent sends a flat record of parts referencing one another by ID, adopted by a separate knowledge payload. A renderer on the shopper aspect turns this JSON into native UI utilizing frameworks like Lit, Flutter, or Angular.
# That is what the agent sends. A renderer (Lit, Flutter, Angular) turns it into native UI.
a2ui_messages = [
# 1. Create a rendering surface
{"beginRendering": {"surfaceId": "default", "root": "card"}},
# 2. Send the component tree (flat list, ID references - not nested)
{"surfaceUpdate": {"surfaceId": "default", "components": [
{"id": "card", "component": {"Card": {"child": "col"}}},
{"id": "col", "component": {"Column": {"children": {"explicitList": ["title", "price", "buy"]}}}},
{"id": "title", "part": {"Textual content": {"usageHint": "h3", "textual content": {"path": "title"}}}},
{"id": "value", "part": {"Textual content": {"textual content": {"path": "value"}}}},
{"id": "purchase", "part": {"Button": {"little one": "btn-label", "motion": {"title": "buy",
"context": [{"key": "item", "value": {"path": "name"}}]}}}},
{"id": "btn-label", "part": {"Textual content": {"textual content": {"literalString": "Purchase Now"}}}},
]}},
# 3. Ship the info (separate from construction - replace knowledge with out resending parts)
{"dataModelUpdate": {"surfaceId": "default", "contents": [
{"key": "name", "valueString": "Fresh Atlantic Salmon"},
{"key": "price", "valueString": "$24.00/lb"},
]}},
]
Python
Now the agent can compose fully completely different interfaces from the identical 18 primitives relying on the request. Right here, three prompts to the identical agent produce a list guidelines, an order kind, and a provider comparability, all constructed from parts like CheckBox, TextField, DateTimeInput, and Card, with no further frontend code.
Throughout growth, ADK’s internet interface (adk internet) can render A2UI parts natively, so you’ll be able to check your agent’s UI output with out constructing a customized renderer.
Discover the A2UI samples for extra part patterns, or strive the A2UI Widget Builder to compose layouts interactively.
6. Agent-Person Interplay Protocol (AG-UI)
Conventional REST APIs return a response they usually’re achieved. Brokers are completely different. They stream textual content incrementally, name instruments in the midst of a response, and typically pause to attend for human enter. This makes connecting an agent to a frontend extra complicated than a normal API name.
You’ll be able to deal with this your self. ADK offers a local /run_sse endpoint that streams occasions instantly, and some dozen traces of frontend code is sufficient to parse the stream and render device calls. However that parsing code is boilerplate, and it breaks each time the occasion format adjustments.
The Agent-Person Interplay Protocol (AG-UI) eliminates that boilerplate. It acts as a middleware that interprets uncooked framework occasions right into a standardized SSE stream. Your frontend listens for typed occasions like TEXT_MESSAGE_CONTENT or TOOL_CALL_START with out caring which agent framework produced them.
To show our kitchen supervisor agent into an AG-UI streaming endpoint, we wrap it with the ag_ui_adk package deal and mount it to a FastAPI app:
from ag_ui_adk import ADKAgent, add_adk_fastapi_endpoint
from fastapi import FastAPI
# Wrap the agent, create the app, mount the endpoint
ag_ui_agent = ADKAgent(adk_agent=kitchen_mgr, app_name="kitchen", user_id="chef")
app = FastAPI()
add_adk_fastapi_endpoint(app, ag_ui_agent, path="/")
# Run with: uvicorn module:app
# The SSE stream emits typed occasions:
# RUN_STARTED
# TOOL_CALL_START toolCallName="check_inventory"
# TOOL_CALL_RESULT content material="3 lbs in inventory, REORDER NEEDED"
# TOOL_CALL_END
# TEXT_MESSAGE_CONTENT delta="Based mostly on "
# TEXT_MESSAGE_CONTENT delta="present stock..."
# RUN_FINISHED
Python
Discover the AG-UI examples to see extra streaming patterns in motion.
Placing It All Collectively: The Agent in Motion
With all six protocols in place, our naked LLM at first has grow to be fairly a succesful agent that may verify actual stock, uncover suppliers, place orders, authorize funds, and stream interactive dashboards. Here is what occurs when a person sends a request that invokes the entire agent’s performance:
“Verify our salmon stock, get in the present day’s wholesale value and high quality grade, and if we’re low order 10 lbs from Instance Wholesale and authorize the cost.”
The agent handles every stage of the request utilizing a unique protocol:
Stage 1: Collect info
- First, verify what’s in inventory. MCP queries the stock database for salmon (
check_inventory). - The inventory is low. What is the going price? A2A queries the distant pricing and high quality brokers (
ask_agent).
Stage 2: Full the transaction
- The worth appears proper, place the order. UCP sends a checkout request to Instance Wholesale (
place_order). - However who permitted this? AP2 secures the order with a cost mandate inside configured guardrails (
authorize_payment).
Stage 3: Current the outcomes
- Now present the person what occurred. A2UI composes interactive widgets from the outcomes.
- Stream all of it to the frontend. AG-UI delivers the device calls and textual content responses in actual time.
Six protocols, every fixing a unique drawback, all working via a single agent.
Ideas for working with these protocols
Know what drawback every protocol solves: MCP connects brokers to instruments and knowledge. A2A connects brokers to different brokers. UCP standardizes commerce. AP2 handles cost authorization. A2UI defines what to render. AG-UI defines find out how to stream it. Understanding these boundaries retains your structure clear.
Add protocols as you want them: You do not want all six in your agent on day one. Most brokers begin with MCP for knowledge entry. As your necessities develop (multi-agent communication, commerce, funds, wealthy UI, streaming), deliver within the protocol that solves that particular drawback.
Don’t begin from scratch: Earlier than constructing with a protocol, verify for an ADK integration, an official SDK, and pattern code. These protocols transfer quick, and the official tooling handles particulars you do not wish to reimplement your self.
Undertake requirements early: These protocols are nonetheless maturing, however the patterns they set up (discovery by way of well-known URLs, typed request/response schemas, commonplace occasion streams) make your agent appropriate with the rising ecosystem of instruments, companies, and different brokers.
Get Began Now
Each code pattern on this publish makes use of ADK. Arrange your first agent, join it to an MCP server, and begin including protocols from there. Browse the ADK Integrations to see what instruments and companies are already obtainable. Hyperlinks to every protocol’s documentation and samples are all through this information.
We are able to’t wait to see what you construct.







