返回全部文章AI 与智能体

MCP、A2A,以及 AI 智能体之间如何对话

On this page

Two protocol layers

MCPagent to tools and data
A2Aagent to agent
Interoperabilityswap implementations, keep contracts
Standardsfewer bespoke integrations

Where each protocol sits

One standardises capability access, the other delegation.

Where each protocol sits — flow diagramWhere each protocol sits. Flow diagram with 5 steps. Shapes: pill = input, rounded rect = process, diamond = decision, double border = output, dashed = loop. Steps in order: Step 1, Agent (input), the orchestrator; Step 2, MCP → tool / data source (process), schemas + typed results; Step 3, A2A → peer agent (process), tasks + messages; Step 4, structured result (output), same shape either way; Step 5, shared trace (loop), one audit log. Then loops back to step 1: loop.Agentthe orchestratorMCP → tool / data sourceschemas + typed resultsA2A → peer agenttasks + messagesstructured resultsame shape either wayshared traceone audit log
  • input
  • process
  • output
  • loop

MCP vs. A2A

MCPA2A
Connectsagent ↔ toolsagent ↔ agents
Payloadtool schemas + resultstasks + messages
Concerncapability accessdelegation
AnalogyUSB-C for toolshandoff protocol

One request across MCP and A2A

Both protocols return typed results, so the caller sees one shape.

One request across MCP and A2A — sequence diagramOne request across MCP and A2A. Sequence diagram with 4 participants: user (actor), agent (system), MCP (external), peer agent (external). Time flows downward. Messages in order: user calls agent: goal + context (list[Message]); agent calls MCP: tool.run(args) (MCP request); MCP returns to agent: ToolResult (typed); agent calls peer agent: A2A task (delegation); peer agent returns to agent: task result (structured); agent returns to user: final answer.useragentMCPpeer agentgoal + contextlist[Message]tool.run(args)MCP requestToolResulttypedA2A taskdelegationtask resultstructuredfinal answer
MCP handles capability access; A2A handles delegation. The caller receives the same typed result shape either way.

早期的 AI 智能体彼此孤立:每个都有自己的硬接线工具,只能在自己的系统内工作。这一点正在迅速改变。新的开放协议不断涌现,让智能体能够发现工具、连接数据、并与其他智能体协作,而不管它们是谁造的。有两个名字反复出现:MCP 和 A2A。下面讲清它们是什么、为什么重要。

为什么智能体需要协议

没有标准,每一条连接都得手工打造。想让智能体 A 使用工具 B,就得有人为这一对写定制代码。把规模扩大到几十个智能体、几百个工具,就变得无法管理。

协议通过定义一种共同语言来解决这个问题。按标准打造的工具,能与任何“说”这种语言的智能体协作。智能体可以发现有哪些工具可用,而不必为每一个预先编程。这和让 Web 运转起来的思路一样:共享协议让截然不同的系统能够互操作。

MCP:把智能体连接到工具和数据

MCP(Model Context Protocol,模型上下文协议)标准化了应用向 AI 模型提供上下文和工具的方式。可以把它理解为一种通用连接器。

开发者不必为每个数据源写定制集成,而是通过 MCP 暴露一种能力——文件系统、数据库、搜索服务、业务 API 等等。任何兼容 MCP 的智能体随后都能发现并使用它。

这在实际中带来什么:

  • 智能体可以询问连接的系统提供哪些能力。
  • 它能以一致、结构化的方式调用这些能力。
  • 开发者只写一次集成,就能在多个智能体平台上通用。

有用的心智模型是“AI 工具的 USB-C”:一个标准插头,取代一抽屉各家的专有线缆。

A2A:智能体与智能体对话

A2A(Agent2Agent 协议)解决的是另一个问题:独立的智能体之间如何协调。当一个智能体需要另一个帮忙——比如来自不同厂商的专业智能体——A2A 定义了它们如何:

  • 发现彼此的能力。
  • 协商任务如何交接。
  • 以结构化方式交换消息和结果。
  • 跟踪长时间运行任务的状态。

MCP 关注的是智能体使用工具,A2A 关注的是智能体与其他智能体协作。两者是互补关系,而非竞争关系。

一张简单的图景

想象一个旅行规划智能体,需要订机票并查天气。

  • 通过 MCP,它连接到一个机票搜索服务和日历,发现各自能做什么。
  • 通过 A2A,它把一份详细的行程任务交给别人开发的专业行程智能体,然后接收结果。

这两条连接它都不需要定制代码。它说的是共享协议。

为什么标准对每个人都重要

你不必自己在造智能体,才会关心这个。标准影响:

  • 选择。 开放协议减少锁定。你可以更换工具或智能体,而不必推倒重来。
  • 能力。 连接成本低时,智能体能触达的工具多得多。
  • 安全。 通用格式让定义权限、记录行动、审计智能体行为更容易。
  • 成本。 可复用的集成意味着每种组合都少写定制代码。

对企业来说,实际效果是智能体系统更容易组装,也更不容易把你困在单一厂商的生态里。

需要注意的地方

协议前景看好,但还年轻。有几点现实需要记在心里:

  • 标准仍在演进,细节可能变化。
  • 支持某个协议,并不保证集成就是安全、实现良好的。
  • 把智能体连接到强大的工具,会放大它能做的事——也包括它能做错的事。权限和监督依然重要。
  • 互操作性只有在底层智能体可靠时才有意义。协议修不好糟糕的推理。

结论

MCP 和 A2A 试图给智能体世界一套共同语言:一个负责把智能体连到工具和数据,另一个负责把智能体彼此相连。如果它们获得广泛采用,智能体系统会变得能力更强、更可替换、也更容易治理。对任何关注 AI 领域的人来说,这些协议都值得理解——它们是基础设施,不是一阵风潮。

Connect your agents without writing code

Everything above, running in Ball — no code, no install. Try it in your browser.

Try Ball free
Get the free AI agent kit

Only used to send Ball resources. No spam.

Try Ball in your browser — no install, no signup needed.

Try Ball in your browser — no install, no signup needed.

正在阅读英文?可在菜单中切换语言。