AI Agent Protocol Layer: MCP, A2A, AG-UI, and Function Calling
Part 4 of the AI Agent Tech Stack series. See also: Core Architecture · Design Patterns · Framework Comparison · Production Practices.
1. MCP (Model Context Protocol)
MCP is an open protocol by Anthropic that standardizes how LLMs interact with external tools and data sources. Think of it as "USB for AI".
- Tools — callable functions (search, calculate, API calls)
- Resources — readable data sources (files, databases)
- Prompts — predefined prompt templates
Key value: build once, use everywhere. One MCP server works with Claude, ChatGPT, LangGraph, PydanticAI, and any MCP-compatible client.
Reference: MCP Docs · GitHub org
2. A2A (Agent-to-Agent Protocol)
A2A by Google solves agent-to-agent communication. While MCP handles Agent ↔ Tool, A2A handles Agent ↔ Agent.
- Agents publish capabilities via Agent Cards
- Cross-framework, cross-vendor agent interop
- Task lifecycle management (create → execute → complete)
Reference: A2A Protocol Specification
3. AG-UI (Agent-User Interaction Protocol)
AG-UI by CopilotKit handles Agent ↔ Frontend real-time communication.
- Real-time UI state updates from agents
- Streaming text, tool call visualization, state sync
Reference: AG-UI Docs
4. Function Calling (Native)
Built into OpenAI and Anthropic APIs. The LLM outputs structured JSON tool calls, the application executes them, and returns results to the LLM.
Simpler than MCP but tightly coupled to a single provider. MCP is the standardized evolution of this concept.
Protocol Comparison
| Protocol | Problem Solved | Author | Maturity |
|---|---|---|---|
| MCP | Agent ↔ Tool/Data | Anthropic | Mature, widely adopted |
| A2A | Agent ↔ Agent | Early, growing fast | |
| AG-UI | Agent ↔ Frontend | CopilotKit | Early |
| Function Calling | LLM ↔ Function | OpenAI | Mature, native support |
How They Fit Together
These protocols are complementary, not competing:
- Function Calling — the low-level mechanism (LLM generates tool calls)
- MCP — the standardized tool/data interface (portable across clients)
- A2A — the inter-agent communication layer (agent discovery + delegation)
- AG-UI — the frontend bridge (real-time UI updates from agents)