Home/AI/ML Notes/Basics of Agents/Agent Protocols: MCP & A2A
⌂ Main Page
Basics of Agents

Agent Protocols: MCP & A2A

Model Context Protocol, Agent-to-Agent protocol, and how the two compare.

A2A vs. MCP

MCP (Model Context Protocol) (created by Anthropic, now under the Linux Foundation)

Vertical integration: how agent talks to tools, context, APIs, resources (data sources, docs, images). Host apps typically connect to many servers simultaneously and uses the client as the isolation boundary between them. The host (AI app - Claude Desktop, IDE, agent runtime) spawns one or more MCP clients, each maintaining a 1:1 stateful connection to one MCP server. MCP servers expose three primitives (aka tools and resources):

Other aspects:

Sources: YouTube link, modelcontextprotocol.io, github.com/modelcontextprotocol.

A2A Protocol (created by Google, now Linux Foundation-governed)

Terminology: user => client agent (A2A client) <=> remote agent (A2A server). How multiple agents talk to each other - peer-to-peer communication between or horizontal integration of agents. Steps:

  1. Discovery - client finds a remote agent using its json agent card - typically fetched from a well-known; it describes the agent, what it can do (skills), how to talk to it, and what authentication it requires.

  2. Authentication - based on security scheme from same agent card.

  3. Communication - a) client talks to remote using JSON RPC 2.0 protocol over HTTPS, b) client sends tasks to remote agent who completes them [using tools] and who can request additional information, c) finally, remote agent communicates task completion and sends generated artifacts (doc, image, structured data) to client, d) streaming can be used over SSE if a task is long + push notifications (webhooks) are used for very long-running or disconnected scenarios where holding an SSE connection open isn't practical.

  4. Task are stateful objects with lifecycle states - pending, in-progress (working), completed, failed, input-required (task pauses until client sends more context) and rejected/canceled. Long-running, multi-turn task management - A2A's core contribution vs. plain RPC call.

  5. Modality agnosticism - message objects composed of Parts — parts can contain text, images, structured data, or other formats.

  6. A2A preserves privacy because remote agents don’t disclose anything about their inner workings (memory, tools, or proprietary logic) + interaction is based on established standards/protocols. A remote agent is a black box exposing only its card and task interface.

Source: https://www.youtube.com/watch?v=Tud9HLTk8hg, a2a-protocol.org, github.com/a2aproject/A2A.