How Autonomous Agents Operates

How Autonomous Agents Operate

自主智能体是如何运作的

Inside an Autonomous Agent: Discover via MCP, Coordinate via A2A, Transact via MPP An autonomous agent completing a real task rarely uses one protocol — it typically discovers a tool through MCP, hands off part of the work to another agent through A2A. It pays for a service through MPP, all within a single request chain. Tracing that flow end-to-end shows how these three protocols function together as layers of one stack rather than competing standards.

自主智能体内部:通过 MCP 发现、通过 A2A 协作、通过 MPP 交易 一个完成实际任务的自主智能体很少只使用一种协议——它通常通过 MCP(模型上下文协议)发现工具,通过 A2A(智能体间协议)将部分工作移交给另一个智能体,并通过 MPP(机器支付协议)为服务付费,所有这些都在一个请求链中完成。追踪这一端到端的流程可以发现,这三种协议是如何作为同一技术栈的层级协同工作的,而不是相互竞争的标准。


Step 1: Tool Discovery via MCP

Before an agent can act, it needs to know what tools exist and what they do — this is MCP’s job. The handshake. Discovery doesn’t start with a plain “list tools” call. The client sends a JSON-RPC 2.0 initialize request describing its own capabilities (like supportsToolDiscovery and maxToolCount), and the server responds with its own capability set. Only after this mutual negotiation does actual tool enumeration begin.

第一步:通过 MCP 进行工具发现

在智能体采取行动之前,它需要知道存在哪些工具以及它们的功能——这就是 MCP 的工作。握手过程:发现过程并非始于简单的“列出工具”调用。客户端会发送一个 JSON-RPC 2.0 初始化请求,描述其自身的能力(如 supportsToolDiscovery 和 maxToolCount),服务器则以其自身的能力集进行响应。只有在完成这种相互协商后,实际的工具枚举才会开始。

Static vs. dynamic discovery. Once connected, an agent can pull tools three ways: statically defining them in code ahead of time, dynamically fetching the current list at runtime, or using a search function that performs semantic matching over available tools based on the user’s actual request. Dynamic discovery matters increasingly in production because it lets a platform update its available tools without repackaging or republishing the agent — the client diffs the current tool list against what it last knew and applies changes automatically.

静态发现与动态发现。 连接后,智能体可以通过三种方式获取工具:在代码中预先静态定义、在运行时动态获取当前列表,或者使用搜索功能根据用户的实际请求对可用工具进行语义匹配。动态发现在生产环境中变得越来越重要,因为它允许平台在不重新打包或重新发布智能体的情况下更新可用工具——客户端会将当前的工具列表与之前已知的列表进行对比,并自动应用更改。

Discovery at scale. In enterprise deployments, an MCP Gateway sits between the agent and multiple MCP servers, filtering which tools an agent can even see based on its identity, workspace, and permission policies — discovery answers “what exists,” while a separate authorization step governs “how it can be called”. Some gateways go further with a two-step catalog pattern: the agent first calls a lightweight discover_tools meta-tool to browse categories and names without full schemas, then calls select_tools to scope its session to a specific subset before receiving the full parameter schemas — this keeps context windows small and improves tool-selection accuracy. For a fintech backend, this means your existing REST endpoints — balance checks, transaction lookups — become MCP tools with structured schemas, and any agent (yours or a third party’s) can discover and call them without a bespoke integration per client.

规模化发现。 在企业部署中,MCP 网关位于智能体和多个 MCP 服务器之间,根据智能体的身份、工作区和权限策略过滤其可见的工具——发现回答的是“存在什么”,而单独的授权步骤则管理“如何调用”。一些网关通过两步目录模式进一步优化:智能体首先调用轻量级的 discover_tools 元工具来浏览类别和名称(无需完整架构),然后调用 select_tools 将会话范围限定在特定子集,最后再接收完整的参数架构——这保持了较小的上下文窗口并提高了工具选择的准确性。对于金融科技后端而言,这意味着你现有的 REST 端点(如余额查询、交易查找)将成为具有结构化架构的 MCP 工具,任何智能体(无论是你自己的还是第三方的)都可以在无需为每个客户端进行定制集成的情况下发现并调用它们。


Step 2: Coordination via A2A

Once an agent has tools, complex tasks often require delegating part of the work to another, independently built agent — this is what A2A standardizes. Agent Cards. Every A2A-compliant agent publishes a JSON capability descriptor called an Agent Card at a well-known path: /.well-known/agent.json. This card gives a complete picture of what the agent can do, how to reach it, and what parameters it expects — the equivalent of a service’s OpenAPI spec, but designed for another agent to read.

第二步:通过 A2A 进行协作

一旦智能体拥有了工具,复杂的任务往往需要将部分工作委托给另一个独立构建的智能体——这就是 A2A 所标准化的内容。智能体卡片(Agent Cards):每个符合 A2A 标准的智能体都会在众所周知的路径 /.well-known/agent.json 下发布一个名为“智能体卡片”的 JSON 能力描述符。这张卡片提供了智能体能做什么、如何联系它以及它期望什么参数的完整图景——这相当于服务的 OpenAPI 规范,但它是专为其他智能体阅读而设计的。

Discovery and delegation flow. A client agent first fetches the target agent’s card from that well-known URL and uses it to build a connection. When it needs that agent’s help, it sends a message containing the task along with session metadata like a session ID and historical context. The receiving A2A server evaluates the incoming message as a Task to complete, rather than treating it as a simple stateless API call.

发现与委托流程。 客户端智能体首先从该已知 URL 获取目标智能体的卡片,并利用它建立连接。当它需要该智能体的帮助时,它会发送一条包含任务的消息,以及会话 ID 和历史上下文等会话元数据。接收方的 A2A 服务器会将传入的消息评估为要完成的“任务”,而不是将其视为简单的无状态 API 调用。

Why this differs from a plain API call. A2A tasks carry state — the receiving agent can report back partial progress, ask clarifying questions, or return a task in an intermediate status, not just a final response. This matters for genuinely long-running or multi-step delegation, like one agent asking a separate logistics agent to “find the fastest delivery route” while a parent workflow waits on updates rather than blocking on one synchronous request. In a fintech scenario, this looks like a customer-facing support agent discovering a specialized fraud-review agent via its Agent Card, delegating a suspicious transaction for deeper analysis, and continuing the conversation once that sub-agent reports back — all without the two systems having been built by the same team or sharing a private API contract.

为什么这与普通 API 调用不同。 A2A 任务带有状态——接收智能体可以报告部分进度、提出澄清问题或返回中间状态的任务,而不仅仅是最终响应。这对于真正长期运行或多步骤的委托至关重要,例如一个智能体要求另一个物流智能体“寻找最快配送路线”,而父工作流在等待更新,而不是阻塞在一个同步请求上。在金融科技场景中,这表现为面向客户的支持智能体通过智能体卡片发现专门的欺诈审查智能体,将可疑交易委托给它进行深度分析,并在子智能体报告结果后继续对话——所有这些都不需要两个系统由同一个团队构建或共享私有 API 合约。


Step 3: Transacting via MPP

Once the right tool is found and any needed coordination is done, the agent may need to pay for the resource itself — this is where MPP (Machine Payments Protocol) takes over. The core handshake is HTTP-native. MPP, co-authored by Stripe and Tempo and launched in March 2026, layers payment directly onto standard HTTP requests using the existing 402 Payment Required status code.

第三步:通过 MPP 进行交易

一旦找到了合适的工具并完成了必要的协作,智能体可能需要为资源本身付费——这就是 MPP(机器支付协议)发挥作用的地方。核心握手是 HTTP 原生的。由 Stripe 和 Tempo 共同编写并于 2026 年 3 月推出的 MPP,利用现有的 402 Payment Required 状态码,将支付直接叠加在标准 HTTP 请求之上。

The full flow runs in a single request cycle with no redirects or webhooks required:

  1. The agent sends a standard HTTP request (a GET, for instance) to a paid endpoint.
  2. The server responds with 402 Payment Required and a WWW-Authenticate: Payment header specifying price, accepted currencies, recipient details, and supported payment methods.
  3. The agent selects a payment method and authorizes payment — via stablecoin transfer, card payment, or another supported rail.
  4. The agent resends the original request, this time including payment credentials in an Authorization: Payment header.
  5. The server verifies the payment and returns the resource along with a Payment-Receipt header as proof.

整个流程在单个请求周期内运行,无需重定向或 Webhook:

  1. 智能体向付费端点发送标准 HTTP 请求(例如 GET 请求)。
  2. 服务器响应 402 Payment Required,并附带 WWW-Authenticate: Payment 标头,指定价格、接受的货币、收款人详细信息和支持的支付方式。
  3. 智能体选择支付方式并授权支付——通过稳定币转账、银行卡支付或其他支持的渠道。
  4. 智能体重新发送原始请求,这次在 Authorization: Payment 标头中包含支付凭据。
  5. 服务器验证支付并返回资源,同时附带 Payment-Receipt 标头作为凭证。

Beyond one-shot payments. MPP layers four additional primitives on top of that base handshake: recurring subscriptions, streaming (metered, continuous) payments, cancellation events, and balance reconciliation — all addressed over the same HTTP surface rather than requiring separate billing infrastructure. MCP tools can be monetized directly. MPP explicitly supports paying per MCP tool call — an agent can call a monetized MCP server and pay per invocation without any OAuth flow or account setup, closing the loop between the discovery layer and the payment layer. Discovery of paid services. Just as MCP has tool discovery, MPP has service discovery: providers can advertise their API’s payment terms through an OpenAPI-style discovery document, and agents can…

超越单次支付。 MPP 在该基础握手之上增加了四个额外的原语:循环订阅、流式(计量、持续)支付、取消事件和余额对账——所有这些都在同一个 HTTP 界面上处理,而无需单独的计费基础设施。MCP 工具可以直接货币化。MPP 明确支持按 MCP 工具调用付费——智能体可以调用货币化的 MCP 服务器并按次付费,无需任何 OAuth 流程或账户设置,从而闭合了发现层与支付层之间的循环。付费服务的发现:正如 MCP 有工具发现一样,MPP 也有服务发现:提供商可以通过 OpenAPI 风格的发现文档发布其 API 的支付条款,智能体可以……