Ensiklopedia VibeKoding: Principles of AI Agent Protocols: MCP and A2A.Ensiklopedia VibeKoding: Principles of AI Agent Protocols: MCP and A2A.
How do AI Agents "talk" to the external world? Just as the internet needs the HTTP protocol, AI Agents also need standardized communication protocols. This chapter introduces the two most mainstream Agent protocols: MCP and A2A, which respectively solve the problems of AI-to-tool and Agent-to-Agent communication.How do AI Agents "talk" to the external world? Just as the internet needs the HTTP protocol, AI Agents also need standardized communication protocols. This chapter introduces the two most mainstream Agent protocols: MCP and A2A, which respectively solve the problems of AI-to-tool and Agent-to-Agent communication.
------
In computing, a protocol is a set of standardized rules and conventions that enable different systems and programs to "understand" and "communicate" with each other.In computing, a protocol is a set of standardized rules and conventions that enable different systems and programs to "understand" and "communicate" with each other.
Imagine this scenario: you send a package to a friend and need to write the address. If everyone wrote addresses in a different format, the courier wouldn't be able to deliver anything. A protocol is the standard that defines "how to write an address" β province, city, district, street, house number. Write it this way, and anyone can understand it.Imagine this scenario: you send a package to a friend and need to write the address. If everyone wrote addresses in a different format, the courier wouldn't be able to deliver anything. A protocol is the standard that defines "how to write an address" β province, city, district, street, house number. Write it this way, and anyone can understand it.
The same goes for computers. For two programs to communicate, they must agree on:The same goes for computers. For two programs to communicate, they must agree on:
| Protocol | Purpose | You Use It Every Day |
|---|---|---|
| HTTP | Web page transfer protocol | Opening web pages in a browser |
| HTTPS | Encrypted HTTP | Online banking, payment pages |
| TCP/IP | Internet foundation protocol | All network communication |
| DNS | Domain name resolution | Translating google.com into an IP address |
| SMTP | Email sending protocol | Sending emails |
| WebSocket | Bidirectional real-time communication | Chat apps, online games |
| SSH | Secure remote login | Connecting to servers |
| FTP | File transfer protocol | Uploading/downloading files |
These protocols form the cornerstone of the internet. Without them, you couldn't browse the web, send emails, or watch videos.These protocols form the cornerstone of the internet. Without them, you couldn't browse the web, send emails, or watch videos.
The core value of protocols lies in standardization and interoperability:The core value of protocols lies in standardization and interoperability:
For example, the HTTP protocol allows Chrome to access Nginx servers, and enables a Python crawler to fetch data from a Java website. Chrome and Nginx don't need to "know" each other β they just need to both follow the HTTP protocol.For example, the HTTP protocol allows Chrome to access Nginx servers, and enables a Python crawler to fetch data from a Java website. Chrome and Nginx don't need to "know" each other β they just need to both follow the HTTP protocol.
For AI Agents to actually "get work done," they need to:For AI Agents to actually "get work done," they need to:
This requires standardized protocols that define "how AI invokes tools" and "how Agents communicate with each other." This is where MCP and A2A come from.This requires standardized protocols that define "how AI invokes tools" and "how Agents communicate with each other." This is where MCP and A2A come from.
------
Before diving into specific protocols, let's look at the communication layers in the Agent ecosystem:Before diving into specific protocols, let's look at the communication layers in the Agent ecosystem:
| Layer | Protocol | Problem Solved | Analogy |
|---|---|---|---|
| 1 | Function Call | How AI calls local functions | The brain issuing commands |
| 2 | MCP | How AI connects to external tools and data sources | USB-C connector |
| 3 | A2A | How Agents collaborate and communicate | WeChat Work |
Layer 1 (Function Call): This is the most fundamental capability of large models β triggering function execution by outputting structured data (JSON). It's the foundation of "protocols," but is more of a capability than a formal standard. Layer 2 (MCP): Model Context Protocol, released by Anthropic in November 2024. It standardizes how AI connects to external tools and data sources, just as USB-C unified charging ports across all kinds of devices. Layer 3 (A2A): Agent-to-Agent Protocol, released by Google in April 2025. It enables different Agents to discover, communicate with, and collaborate with each other, just as WeChat Work lets colleagues send tasks and chat.Layer 1 (Function Call): This is the most fundamental capability of large models β triggering function execution by outputting structured data (JSON). It's the foundation of "protocols," but is more of a capability than a formal standard. Layer 2 (MCP): Model Context Protocol, released by Anthropic in November 2024. It standardizes how AI connects to external tools and data sources, just as USB-C unified charging ports across all kinds of devices. Layer 3 (A2A): Agent-to-Agent Protocol, released by Google in April 2025. It enables different Agents to discover, communicate with, and collaborate with each other, just as WeChat Work lets colleagues send tasks and chat.
This chapter focuses on the two formal protocols at layers 2 and 3: MCP and A2A.This chapter focuses on the two formal protocols at layers 2 and 3: MCP and A2A.
------
| Item | Details |
|---|---|
| Full Name | Model Context Protocol |
| Proposed By | Anthropic |
| Release Date | November 25, 2024 |
| Official Documentation | [modelcontextprotocol.io](https://modelcontextprotocol.io) |
| License | MIT License |
| GitHub | [github.com/modelcontextprotocol](https://github.com/modelcontextprotocol) |
Context is key to how large models understand tasks. The core idea behind MCP is: enabling AI to dynamically obtain the context information it needs, rather than stuffing everything into the Prompt. For example, when AI needs to read a file, you don't need to copy and paste the file content β it can access the file system directly through MCP.Context is key to how large models understand tasks. The core idea behind MCP is: enabling AI to dynamically obtain the context information it needs, rather than stuffing everything into the Prompt. For example, when AI needs to read a file, you don't need to copy and paste the file content β it can access the file system directly through MCP.
In 2024, with the release of Claude 3.5 Sonnet, Anthropic identified a problem: every tool required separate integration.In 2024, with the release of Claude 3.5 Sonnet, Anthropic identified a problem: every tool required separate integration.
Imagine:Imagine:
Each integration requires writing similar code repeatedly: authentication, error handling, data transformationβ¦Each integration requires writing similar code repeatedly: authentication, error handling, data transformationβ¦
Anthropic wrote in their official blog:Anthropic wrote in their official blog:
> "We're introducing the Model Context Protocol (MCP), an open protocol that standardizes how applications provide context to LLMs."> "We're introducing the Model Context Protocol (MCP), an open protocol that standardizes how applications provide context to LLMs."
Core goal: Let tool developers write code once, and have it usable by all MCP-compatible AI applications.Core goal: Let tool developers write code once, and have it usable by all MCP-compatible AI applications.
Three Core Capabilities:Three Core Capabilities:
| Capability | Description | Example |
|---|---|---|
| Tools | Functions AI can invoke | Check weather, send email |
| Resources | Data AI can read | File contents, database records |
| Prompts | Predefined prompt templates | Code review template, writing template |
MCP is like the USB-C connector:MCP is like the USB-C connector:
Tool developers only need to implement an MCP Server once, and all MCP-compatible AI applications (Claude, Cursor, Windsurf, etc.) can use it directly.Tool developers only need to implement an MCP Server once, and all MCP-compatible AI applications (Claude, Cursor, Windsurf, etc.) can use it directly.
| Scenario | Description | Example |
|---|---|---|
| Local File Operations | Let AI read/modify local files | Read codebases, analyze log files |
| Database Queries | Let AI query databases directly | SQL queries, data analysis |
| API Calls | Let AI call third-party services | GitHub API, Slack, email |
| Dev Tool Integration | Let AI use development tools | Git operations, terminal commands |
Real-World Examples:Real-World Examples:
------
| Item | Details |
|---|---|
| Full Name | Agent-to-Agent Protocol |
| Proposed By | |
| Release Date | April 9, 2025 |
| Official Documentation | [google.github.io/A2A](https://google.github.io/A2A) |
| License | Apache 2.0 |
| GitHub | [github.com/google/A2A](https://github.com/google/A2A) |
Google announced A2A at Cloud Next 2025, closely tied to its enterprise AI strategy. Google believes that the future of enterprise AI is not a single super Agent, but multiple specialized Agents collaborating β some responsible for data analysis, some for code generation, some for document processing. These Agents need a standardized way to communicate with each other, and A2A was born.Google announced A2A at Cloud Next 2025, closely tied to its enterprise AI strategy. Google believes that the future of enterprise AI is not a single super Agent, but multiple specialized Agents collaborating β some responsible for data analysis, some for code generation, some for document processing. These Agents need a standardized way to communicate with each other, and A2A was born.
MCP solved the problem of "how AI connects to tools," but another question remained: how do multiple Agents collaborate?MCP solved the problem of "how AI connects to tools," but another question remained: how do multiple Agents collaborate?
Imagine this scenario:Imagine this scenario:
A user says: "Help me develop a login feature"A user says: "Help me develop a login feature"
Agent A analyzes the requirements and needs to delegate the task to Agent B; Agent B writes the code and needs Agent C to test it. How do they communicate with each other?Agent A analyzes the requirements and needs to delegate the task to Agent B; Agent B writes the code and needs Agent C to test it. How do they communicate with each other?
Google wrote in their official blog:Google wrote in their official blog:
> "A2A is an open protocol that enables AI agents to communicate with each other, facilitating collaboration across different frameworks and vendors."> "A2A is an open protocol that enables AI agents to communicate with each other, facilitating collaboration across different frameworks and vendors."
Core goal: Enable Agents built by different vendors and frameworks to collaborate seamlessly.Core goal: Enable Agents built by different vendors and frameworks to collaborate seamlessly.
Three Core Concepts:Three Core Concepts:
| Concept | Description | Analogy |
|---|---|---|
| Agent Card | Describes an Agent's capabilities | Employee badge |
| Task | A unit of work to be executed | Work ticket |
| Message | Communication content between Agents | Chat history |
A2A is like WeChat Work:A2A is like WeChat Work:
Different Agents are like different colleagues β A2A enables them to collaborate on complex projects.Different Agents are like different colleagues β A2A enables them to collaborate on complex projects.
| Scenario | Description | Example |
|---|---|---|
| Software Development | Multi-Agent collaboration on development tasks | Requirements β Code β Testing β Deployment |
| Enterprise Workflows | Agents from different departments collaborating | HR Agent + Finance Agent + Legal Agent |
| Intelligent Customer Service | Multiple specialized Agents dividing work | Reception β Answers β Transfer β Records |
| Data Analysis | Multiple Agents collaborating on data analysis | Collection β Cleaning β Analysis β Visualization β Reporting |
Real-World Examples:Real-World Examples:
------
| Dimension | MCP | A2A |
|---|---|---|
| Proposed By | Anthropic (2024.11) | Google (2025.04) |
| Positioning | AI-to-tool connection | Agent-to-Agent collaboration |
| Communication Scope | Client-Server | Peer-to-Peer |
| Data Format | JSON-RPC 2.0 | HTTP + JSON |
| Analogy | USB-C connector | WeChat Work |
MCP and A2A are not competitors, but complements:MCP and A2A are not competitors, but complements:
| Scenario | Choice |
|---|---|
| Let AI call local functions or tools | Function Call |
| Use third-party tools (databases, APIs, file systems) | MCP |
| Build a multi-Agent collaboration system | A2A |
| Need both tool integration and multi-Agent collaboration | MCP + A2A |
------
MCP Ecosystem (as of early 2025):MCP Ecosystem (as of early 2025):
A2A Ecosystem (newly released):A2A Ecosystem (newly released):
Agent protocols are currently in a "Warring States" period:Agent protocols are currently in a "Warring States" period:
An analogy to the development of the internet:An analogy to the development of the internet:
------
| Protocol | One-Line Takeaway | Release Date | Proposed By | Use Case | |----------|-------------------|--------------|-------------|----------| | MCP | The "USB-C" for AI connecting to tools | 2024.11 | Anthropic | Tool integration, data source connection | | A2A | The "WeChat Work" for Agent collaboration | 2025.04 | Google | Multi-Agent collaboration, task delegation | Key Insights: 1. MCP solves the problem of "how AI acquires external capabilities" 2. A2A solves the problem of "how multiple AIs collaborate" 3. The two are complementary and may be used together in the future 4. Choose the protocol based on the specific scenario β there is no silver bullet| Protocol | One-Line Takeaway | Release Date | Proposed By | Use Case | |----------|-------------------|--------------|-------------|----------| | MCP | The "USB-C" for AI connecting to tools | 2024.11 | Anthropic | Tool integration, data source connection | | A2A | The "WeChat Work" for Agent collaboration | 2025.04 | Google | Multi-Agent collaboration, task delegation | Key Insights: 1. MCP solves the problem of "how AI acquires external capabilities" 2. A2A solves the problem of "how multiple AIs collaborate" 3. The two are complementary and may be used together in the future 4. Choose the protocol based on the specific scenario β there is no silver bullet
------