Malhar Ujawane

Blog

Explainer·(updated October 31, 2026)

What is the A2A protocol? Agent2Agent vs MCP, explained

The A2A (Agent2Agent) protocol lets AI agents from different vendors discover each other and delegate tasks. How it works and how it differs from MCP.

What is the A2A protocol? Agent2Agent vs MCP, explained

The A2A (Agent2Agent) protocol is an open standard that lets one AI agent find another agent, learn what it can do, and hand it a task over HTTP, without either side knowing how the other is built. An agent publishes a JSON Agent Card describing its skills, and clients send it messages that create tasks with a tracked lifecycle and results called artifacts. Google announced A2A in April 2025, it moved to the Linux Foundation that June, and version 1.0 shipped in March 2026.

What problem does A2A solve?

MCP standardized how an agent reaches tools and data. It didn’t cover what happens when the thing you want to call is itself an agent: something with its own model, its own tools, its own judgment, and work that might take minutes or need a human’s input halfway through. A tool call is a function with a schema. A request to another agent is closer to delegating a job to a contractor.

Google’s launch post (April 9, 2025) framed A2A as complementary: “A2A is an open protocol that complements Anthropic’s Model Context Protocol (MCP),” with MCP providing tools and context to agents and A2A handling agent-to-agent communication. It launched with more than 50 technology partners, including Atlassian, Salesforce, SAP, ServiceNow and LangChain, and listed five design principles: embrace agentic capabilities, build on existing standards, secure by default, support long-running tasks, and be modality agnostic.

The specification describes the goal as communication between “independent, potentially opaque AI agent systems.” Opaque is the important word. A2A doesn’t ask a remote agent to expose its prompts, tools or memory, only its skills and an endpoint.

How does the A2A protocol work?

There are four concepts to learn.

Agent Card. A JSON document a server publishes at /.well-known/agent-card.json. The 1.0 spec requires name, description, version, supportedInterfaces (each with a URL, a protocol binding and a protocol version), capabilities, default input and output modes, and skills. Each skill needs an id, name, description and tags. The card also declares security schemes, so a client knows how to authenticate before it sends anything.

Message. One turn of communication, with a role (ROLE_USER or ROLE_AGENT) and a list of parts. A part can be text, a file or structured JSON data.

Task. The unit of work. Sending a message can create a task with an id, a contextId that groups related tasks, a status and a history. The states in the 1.0 spec are submitted, working, completed, failed, canceled, rejected, input-required and auth-required. The last two are interrupted states: the remote agent is waiting for more input or credentials, which is how a long-running delegation pauses for a human without breaking.

Artifact. An output the agent produced, made of parts: a document, an image, structured data.

The core operations are SendMessage, SendStreamingMessage, GetTask, ListTasks, CancelTask and SubscribeToTask, plus management of push notification configs. Streaming uses Server-Sent Events, with status and artifact update events as the task progresses. Push notifications are, in the spec’s words, “server-initiated HTTP POST requests to a client-provided webhook URL,” for tasks that run longer than anyone wants to hold a connection open.

What does an A2A call look like on the wire?

The best way I know to understand a protocol is to write both ends with no SDK. This script runs a toy A2A server on localhost with Python’s standard library, then acts as a client: it fetches the Agent Card, reads the endpoint from it, and sends a JSON-RPC SendMessage. The field names follow the 1.0 spec; the “agent” behind the endpoint is three lines of arithmetic.

# a2a_wire.py: a toy A2A server and client on localhost, stdlib only.
# Shapes follow the A2A 1.0 spec: Agent Card at /.well-known/agent-card.json,
# JSON-RPC 2.0 method "SendMessage", a Task with a state and artifacts.
import json, threading, urllib.request, uuid
from http.server import BaseHTTPRequestHandler, HTTPServer

PORT = 8765
CARD = {
    "name": "Invoice Agent",
    "description": "Totals freelance invoices in rupees with GST.",
    "supportedInterfaces": [{"url": f"http://127.0.0.1:{PORT}/a2a",
                             "protocolBinding": "JSONRPC", "protocolVersion": "1.0"}],
    "version": "0.1.0",
    "capabilities": {"streaming": False, "pushNotifications": False},
    "defaultInputModes": ["text/plain"],
    "defaultOutputModes": ["text/plain"],
    "skills": [{"id": "invoice-total", "name": "Invoice total",
                "description": "hours x rate plus 18% GST", "tags": ["billing"]}],
}

class Agent(BaseHTTPRequestHandler):
    def log_message(self, *a): pass
    def reply(self, obj):
        body = json.dumps(obj).encode()
        self.send_response(200); self.send_header("Content-Type", "application/json")
        self.end_headers(); self.wfile.write(body)
    def do_GET(self):
        if self.path == "/.well-known/agent-card.json":
            self.reply(CARD)
    def do_POST(self):
        req = json.loads(self.rfile.read(int(self.headers["Content-Length"])))
        text = req["params"]["message"]["parts"][0]["text"]
        hours, rate = (float(x) for x in text.split())     # the "agent" behind the API
        total = hours * rate * 1.18
        self.reply({"jsonrpc": "2.0", "id": req["id"], "result": {"task": {
            "id": str(uuid.uuid4())[:8], "contextId": "ctx-1",
            "status": {"state": "TASK_STATE_COMPLETED"},
            "artifacts": [{"artifactId": "a1", "parts": [{"text": f"total INR {total:,.0f}"}]}]}}})

srv = HTTPServer(("127.0.0.1", PORT), Agent)
threading.Thread(target=srv.serve_forever, daemon=True).start()

# Client agent: discover, then delegate.
card = json.load(urllib.request.urlopen(f"http://127.0.0.1:{PORT}/.well-known/agent-card.json"))
print("card:", card["name"], "| skills:", [s["id"] for s in card["skills"]])
endpoint = card["supportedInterfaces"][0]["url"]
rpc = {"jsonrpc": "2.0", "id": 1, "method": "SendMessage", "params": {"message": {
    "role": "ROLE_USER", "messageId": "m1", "parts": [{"text": "12.5 2500"}]}}}
print("->", json.dumps(rpc)[:100])
req = urllib.request.Request(endpoint, json.dumps(rpc).encode(), {"Content-Type": "application/json"})
task = json.load(urllib.request.urlopen(req))["result"]["task"]
print("<- state:", task["status"]["state"], "| artifact:", task["artifacts"][0]["parts"][0]["text"])
srv.shutdown()

Output (Python 3.13.11):

card: Invoice Agent | skills: ['invoice-total']
-> {"jsonrpc": "2.0", "id": 1, "method": "SendMessage", "params": {"message": {"role": "ROLE_USER", "me
<- state: TASK_STATE_COMPLETED | artifact: total INR 36,875

It’s the same invoice I used in the MCP explainer, on purpose. With MCP, the host’s model decides to call invoice_total with typed arguments and gets a result back in the same turn. With A2A, the client sends a message to a peer that owns the work, and gets back a task with a state. Here it completes at once. A real remote agent might return TASK_STATE_WORKING and stream updates, or stop at TASK_STATE_INPUT_REQUIRED and wait for the client to answer a question.

A real server also needs authentication declared in the card, input validation and error responses. This toy has none of those and should never leave localhost.

A2A vs MCP: what’s the difference?

The A2A project’s own A2A and MCP page has the shortest version: “A2A connects the agents to each other; MCP connects each agent to its own tools.” The spec’s appendix says MCP is about how agents “connect to and interact with tools, APIs, data sources,” while A2A is about how independent agents “communicate and collaborate with each other as peers.”

MCP A2A
Connects an agent to tools, data, prompts an agent to another agent
Unit of work a tool call with a result a task with a lifecycle and artifacts
Discovery tools/list after connecting Agent Card at a well-known URL
Long-running work experimental tasks since the 2025-11-25 spec core: task states, streaming, push
Remote side exposes its functions stays opaque, exposes skills
Wire JSON-RPC over stdio or Streamable HTTP JSON-RPC, gRPC or HTTP+JSON bindings

The project’s analogy is an auto repair shop. A customer talks to a shop manager agent, which coordinates with a parts supplier’s agent over A2A. The mechanic agent uses MCP to work its own diagnostic scanner and repair manuals. Both protocols, one system, at different seams.

How has A2A changed since launch?

The Linux Foundation launched the Agent2Agent project on June 23, 2025, describing A2A as “an open protocol created by Google” with support from more than 100 technology companies. The release history shows two breaking moves worth knowing if you read older tutorials. Version 0.3.0 (July 30, 2025) changed the Agent Card path from agent.json to agent-card.json. Version 1.0.0 (March 12, 2026) refactored the spec to separate the application protocol from its transport mappings, which is why method names in 1.0 read SendMessage and GetTask rather than the slash-style names in early examples.

What I would do

  1. Use MCP for tools you own or control. Most “agents” people want to connect are really tools behind an API, and a tool call is simpler, cheaper and easier to test.
  2. Reach for A2A at an organizational boundary: another team’s or vendor’s agent that owns its own work, runs for a while, or needs to ask questions back. That’s where task states and opacity earn their complexity.
  3. Treat every remote agent’s output as untrusted input to your model. An artifact from another company’s agent can carry instructions as easily as a web page can, the problem I covered in AI browsers and prompt injection.
  4. Pin the protocol version in supportedInterfaces and test against it. A2A has had breaking changes in under a year.
  5. If the agents are all yours and in one process, skip protocols and use an orchestrator-worker design in code. A2A solves interoperability, not coordination. The design questions in multi-agent systems still apply.

FAQ

Who created the A2A protocol?

Google announced it on April 9, 2025 with more than 50 partners. The Linux Foundation became its home and launched the Agent2Agent project on June 23, 2025, to keep it vendor neutral.

Does A2A replace MCP?

No. Both the Google launch post and the A2A docs describe them as complementary. MCP connects an agent to its tools and data; A2A connects agents to other agents.

What is an Agent Card in A2A?

A JSON document an A2A server publishes at /.well-known/agent-card.json, listing the agent’s name, description, version, endpoints and protocol bindings, capabilities, input and output modes, skills and security schemes.

What transport does A2A use?

The 1.0 spec defines three bindings: JSON-RPC 2.0 over HTTP, gRPC, and HTTP+JSON (REST style). Streaming uses Server-Sent Events, and long tasks can report back through push notifications to a webhook.

Sources

Get new posts in your inbox

© 2026 Malhar Ujawane. Built with Astro.