Skip to content

Search

Articles, tools, solutions and knowledge base guides

Start typing to search across articles, tools and apps.

MCP vs A2A: how models, tools and AI agents communicate

An AI application may need both access to data and functions and collaboration with independent agents. Model Context Protocol (MCP) and Agent2Agent Protocol (A2A) organize these two kinds of integration. This guide explains their scope, operation lifecycles, combined use cases and safeguards for production systems.

AI
Published Written by Reading time 8 min read
On this page Contents: quick navigation between sections

What is the difference between MCP and A2A?

Protocol comparison
Criterion MCP A2A
Purpose Tools and data Task delegation
Discovery Operation catalogue Agent Card
Work unit Invocation Message or Task
State Stateless core Task state
Long operations Optional Tasks Task lifecycle
Transport stdio / Streamable HTTP JSON-RPC / gRPC / HTTP+JSON

MCP describes external capabilities that an AI host can access. A2A defines how independent agents discover capabilities, delegate work, track task state and exchange results. The receiving agent does not need to expose its internal prompts, model, tools or memory to the caller. [1][5][6]

This is not a distinction between simple and complex operations. An MCP tool may start a complex analysis, while an A2A agent may respond with a single message. The architectural boundary is what matters: an explicit operation with a contract or collaboration with an independent task executor. Neither protocol is a language model, an agent framework or a replacement for business rules. [1][5][6]

How does MCP work?

MCP tool integration
[AI host]
    ↕
[MCP client]
    ↕ MCP
[MCP server]
    ↕
[Data / API]

The host is the AI application, the MCP client handles communication with a server, and the server exposes selected capabilities. Tools describe operations and arguments; resources provide URI-identified data; prompts provide reusable interaction templates. A model typically proposes a tool call, while the client and server are responsible for its execution. [1][3]

This guide uses MCP revision 2026-07-28: the core is stateless, each request carries version and client capabilities, and server/discover can reveal server capabilities. A client can discover tools using tools/list and invoke one with tools/call. Standard transports are stdio and Streamable HTTP, which returns JSON or a request-scoped SSE stream. Earlier revisions used initialize and session state; do not mix the contracts. Optional Tasks require support on both sides and allow long-running operations to be tracked. [1][2][3][4][11]

MCP uses JSON-RPC 2.0. In a tool definition, inputSchema describes arguments and optional outputSchema defines the shape of the result in structuredContent. A tool result is not the same as schema-constrained model generation. Distinguish a JSON-RPC protocol error, such as an unknown tool, from an execution error returned as isError: true. Handle both classes; a successful transport response does not imply a successful operation. [3][4]

The io.modelcontextprotocol/tasks extension uses capabilities declared on the current request. The server may return a regular result or resultType: "task" with a task identifier. Clients must handle both outcomes, retrieve status and results with tasks/get, and use tasks/update and tasks/cancel as needed. Do not use the older tasks/result and tasks/list methods with this revision. Authorize every task-related request. [11]

How does A2A work?

A2A agent collaboration
[Client agent]
    ↓ A2A: Message
[Executing agent]
    ├── A2A: Message → [Client agent]
    └── A2A: Task → [Client agent]
        ↳ Artifact / status

In A2A 1.0, an Agent Card describes service identity, Agent Skills, interfaces and authentication requirements. It can be obtained, for example, from /.well-known/agent-card.json. The client selects a compatible version and interface and sends a Message. The agent can return a Message immediately or a Task representing work. An Artifact represents a task result such as a report or structured data; a Part is a unit of content, and contextId groups related interactions. [5]

A Task has an identifier and lifecycle. After acceptance it may enter execution, wait for input or authorization, complete, fail, be canceled or rejected. Clients can check status with Get Task, stream updates or receive push notifications when supported. A2A defines a Protocol Buffers data model and JSON-RPC, gRPC and HTTP/REST bindings; check version and capabilities first. Identifiers, methods and message formats depend on the version and binding, so do not reuse 0.3 examples unchanged with 1.0. [5]

Declare the A2A 1.0 version in requests, for example through A2A-Version: 1.0 over HTTP. Documentation patch versions do not change the protocol version sent in the request. Distinguish the messageId, Task identifier and contextId: they correlate different parts of an interaction but are not credentials or substitutes for authorization. A completed task state does not establish factual correctness of the result. [5]

In A2A, TASK_STATE_INPUT_REQUIRED and TASK_STATE_AUTH_REQUIRED indicate interrupted work awaiting input or authentication, not completion. For missing input, send a new message referencing the existing taskId; if a contextId is supplied as well, it must match the task. Deliver credentials through a secure out-of-band channel unless an appropriate mechanism has been negotiated. Terminal states are COMPLETED, FAILED, CANCELED and REJECTED (with the TASK_STATE_ prefix). [5]

An architecture combining both protocols

Combined architecture
[Customer assistant]
    ↕ A2A
[Complaints agent]

[Customer assistant]
    ↕ MCP
[Orders server]

[Complaints agent]
    ↕ MCP
[Policy server]

[Customer assistant]
    ↓
[Validation and approval]

Consider a customer service assistant asked to evaluate a complaint. It calls get_order over MCP with the order identifier; the server checks user identity and order ownership. When specialist analysis is needed, the assistant delegates the task over A2A to a complaints agent, sending only necessary data. The complaints agent retrieves the approved refund policy via its own MCP client and returns a recommendation as an Artifact with a reference to the source.

The assistant validates schema, provenance, policy currency and relevance to the order. A refund is not an automatic consequence of a recommendation: a separate business service checks the amount, limit, permissions and approval of the exact operation. It retains the transaction identifier after execution. A2A and MCP provide communication interfaces; the application controls delegation scope and effects. [6][8]

Security and trust boundaries

Tool descriptions, Agent Cards, documents, messages and results are untrusted input. Even an authenticated agent may return erroneous instructions or prompt-injected content. Restrict allowed servers and agents, verify their identities, use TLS for remote connections and validate data schema and provenance. A tool annotation or card skill does not prove permission. The server must authorize every operation and task access independently of the model. [5][7][8]

Do not forward a token issued for one resource directly to another server. Use audience-bound, scoped, short-lived credentials; delegation must not expand privileges. Control card URLs, redirects, artifact links and webhooks to mitigate SSRF and unauthorized transfers. Isolate tenants in task stores, caches and logs too; do not record full content or secrets by default. [5][7][8]

Local and remote integrations have different risks. An MCP server launched over stdio is a process that may inherit access to files and environment variables. Approve its startup command, verify package provenance and restrict filesystem, network and secret access. Verify an Agent Card signature, when present, using a trusted key; a signature does not replace authorization for individual operations. [5][7]

State, errors and execution costs

Hypothetical cost comparison
Variant Delegations Cost (USD)
Local operations only 0 200
Delegate exceptions 2,000 360
Delegate all 10,000 1,000

MCP's stateless core does not preclude durable business state or application handles. An A2A task can outlive a disconnected client, but server-side retention and recovery need to be designed. Losing a response does not imply the operation did not happen. A2A permits Send Message deduplication using messageId, but does not guarantee its idempotency. Use a separate business-operation idempotency key, check state before retrying and store the result; cancellation does not reverse a payment already made. [2][5]

Set limits on delegation, depth, time, retries, tokens and total task cost. Hypothetical example: 10,000 tasks each incur USD 0.02 in local operations; delegate 20% of them for an additional USD 0.08 each. Variable cost is 10,000 × 0.02 + 2,000 × 0.08 = USD 360. Delegating all tasks would cost USD 1,000 under the same assumptions. Infrastructure, human review and consequences of errors are excluded; value depends on quality. Correlate task IDs, tool calls and business operations in monitoring.

When should you choose MCP, A2A or a direct API?

In one backend with a few functions, direct API access or function calling may be simpler. MCP makes sense when several AI clients need the same tools or a portable catalogue of resources and operations. A2A is justified when teams maintain independent agents, delegate goals to them and track tasks regardless of implementation. Merely using multiple models does not require A2A.

Combine the protocols when the delegated task executor accesses separate resources and tools. Do not introduce a protocol merely to replace a local function call. Require a documented domain contract, versioning, data ownership and predictable escalation rules. See the POLPROG MCP guide for more detail on tool integration. [6][9] The Harness Engineering guide covers runtime control, tool execution and environment isolation in more detail. [10]

If an existing host supports only MCP, an adapter can expose a selected A2A agent skill as an MCP tool. This is an implementation choice, not automatic protocol interoperability. The adapter must map parameters, state, permissions, errors and cancellation. For long-running work it may return an explicit task handle or use Tasks when the client supports it. Do not disguise ongoing work as a final result. [1][5][6][11]

How should you test integrations before deployment?

MCP contract tests should cover discovery, versions, invalid arguments, tool errors and server unavailability. For A2A, verify cards, version compatibility, direct Message responses, Task lifecycle, continuation after a question, interrupted streams, duplicate events and unknown identifiers. Missing optional features should lead to explicit rejection or a defined fallback without expanding privileges. [2][3][5]

Use two tenants and synthetic data for integration tests: deny access to another tenant's task and order, block prohibited connections and confirm that a modified recommendation cannot cause an unapproved refund. Simulate a lost response after a write, repeated delegation, budget exhaustion and cancellation. Measure task success, cost per correct result, p95 latency, escalation rate and actual policy violations. Increase permissions and agent count only after these tests.

In multi-agent systems, propagate the overall task budget and deadline to downstream services rather than limiting only individual calls. Detect delegation cycles using the parent task identifier and delegation history. Test that agent A cannot keep passing work to agent B, which sends it back to A. If connectivity is lost, determine the operation state first; repeating writes requires separate idempotency protection. [5][8]

Choose MCP for a common interface to resources and operations and A2A when independent systems need to exchange tasks and results. Combine them only where the separation of responsibilities justifies the extra complexity. Whatever protocol you use, enforce permissions, budgets, business rules and tests at service boundaries.

Tools for this topic

MCP Model Context Protocol A2A Agent2Agent Protocol AI Agents Tool Calling AI Architecture Interoperability Multi-Agent Systems AI Security OAuth Idempotency

Frequently asked questions

Does MCP replace A2A?

No. Tool access and collaboration between independent agents have distinct contracts, despite overlapping capabilities.

Does A2A require MCP?

No. An agent may use direct APIs, local functions or other integrations.

Can MCP support long-running operations?

Yes, for example via the optional Tasks extension if both sides support it. A stateless core does not preclude application state.

Is an Agent Card proof of trust?

No. It describes capabilities and interfaces; identity verification and authorization remain necessary.

Does task cancellation undo changes?

Not automatically. Completed operations require separate compensation if reversible.

Does every AI system need both protocols?

No. Direct APIs are often sufficient, especially inside a single backend.

Sources and references

  1. Model Context Protocol, Specification 2026-07-28↩1↩2↩3↩4↩5
  2. Model Context Protocol, Versioning and Compatibility↩1↩2↩3
  3. Model Context Protocol, Tools↩1↩2↩3↩4
  4. Model Context Protocol, Transports↩1↩2
  5. Agent2Agent Protocol, Specification 1.0↩1↩2↩3↩4↩5↩6↩7↩8↩9↩10↩11↩12↩13
  6. Agent2Agent Protocol, A2A and MCP↩1↩2↩3↩4↩5
  7. Model Context Protocol, Security Best Practices↩1↩2↩3
  8. OWASP, Top 10 for Agentic Applications↩1↩2↩3↩4
  9. POLPROG, Model Context Protocol (EN)↩
  10. POLPROG, Harness Engineering (EN)↩
  11. Model Context Protocol, Tasks Extension 2026-07-28↩1↩2↩3

Was this helpful?

Get new articles by email

One short email per new Learning article. No spam, unsubscribe in one click.

We only use your email to send new articles. No third-party sharing.

Back to Learning