MCP vs A2A vs REST
One answers "which operations exist", one "which tools can a model use", one "who can take this job". Most systems need more than one.
Use a REST or similar API when your own code decides what to call. Use MCP when an AI application needs to discover and use tools and data. Use A2A when you hand a job to an independent agent that may take time, ask questions and return deliverables. They stack: an agent reached over A2A can use tools over MCP, which call ordinary APIs.
What you will learn: what each contract describes, how the same capability looks in all three, how to choose, how they combine and what each leaves for you to build.
Prerequisites: What Is MCP? Hosts, Clients, Servers and Capabilities and What Is A2A? Agent Cards, Tasks and Messages.
Compared in November 2026 using MCP specification 2026-07-28 and A2A 1.0, run with Python packages mcp 2.3.0 and a2a-sdk 1.3.1. "REST" here means an ordinary HTTP API; much of the comparison applies to GraphQL or gRPC too.
Three kinds of request
A useful analogy: an API is a form, MCP is a labeled toolbox, and A2A is asking a colleague. The analogy is imperfect, but it shows where responsibility for the steps sits.
Side by side
| Aspect | REST API | MCP | A2A |
|---|---|---|---|
| Typical caller | Application code | An AI application on behalf of a model | Another agent or application |
| Unit of work | Request and response | Tool call, resource read or prompt | Message and task |
| Discovery | Documentation, often OpenAPI | List tools, resources and prompts | Agent Card with skills |
| Who plans the steps | The caller | The calling model and its application | The remote agent |
| Missing information | An error; your design | Errors, or a request for input | Task pauses as input required |
| Long work | Your own job pattern | Progress, or the tasks extension | Task states, streaming and push |
| Result | A response body | Content and structured content | Artifacts on a task |
| Identity | Your choice of standard | OAuth-based authorization for HTTP servers | Schemes declared in the card |
| Maturity of tooling | Very broad | Broad among AI applications; still changing | Newer; check partners' support |
One capability, three front doors
The business rule is a single function: subtract the purchase order amount from the invoice amount. Each interface must also deal with a request that lacks the currency. The script imports the agent and client helpers from Build, Deploy and Troubleshoot A2A, so save it in the same folder. It needs pip install "a2a-sdk[http-server]" "mcp==2.3.0" httpx2.
"""One capability, three contracts: REST endpoint, MCP tool, A2A agent."""
import asyncio
import json
from mcp import Client
from mcp.server import MCPServer
from starlette.applications import Starlette
from starlette.responses import JSONResponse
from starlette.routing import Route
from starlette.testclient import TestClient
from client_demo import call, message
from agent import build_app
ORDERS = {"PO-7731": 1200.0}
def difference(order: str, amount: float) -> dict[str, str | float]:
"""The business rule. All three front doors end up needing it."""
return {"order": order, "difference": amount - ORDERS[order]}
async def rest_match(request):
body = await request.json()
if "currency" not in body:
return JSONResponse({"error": "currency is required"}, 422)
return JSONResponse(difference(body["order"], body["amount"]))
server = MCPServer("invoices")
@server.tool()
def match_invoice(order: str, amount: float,
currency: str) -> dict[str, str | float]:
"""Compare an invoice amount with its purchase order."""
return difference(order, amount)
async def mcp_side():
async with Client(server) as client:
tool = (await client.list_tools()).tools[0]
print("MCP discovers:", tool.name, tool.input_schema["required"])
missing = await client.call_tool(
"match_invoice", {"order": "PO-7731", "amount": 1320})
print("MCP incomplete: tool error =", missing.is_error)
done = await client.call_tool(
"match_invoice",
{"order": "PO-7731", "amount": 1320, "currency": "EUR"})
print("MCP complete :", json.dumps(done.structured_content))
rest = Starlette(routes=[Route("/matches", rest_match, methods=["POST"])])
with TestClient(rest) as http:
request = {"order": "PO-7731", "amount": 1320}
reply = http.post("/matches", json=request)
print("REST incomplete:", reply.status_code, reply.json()["error"])
reply = http.post("/matches", json=request | {"currency": "EUR"})
print("REST complete :", reply.status_code, json.dumps(reply.json()))
asyncio.run(mcp_side())
with TestClient(build_app()) as http:
task = call(http, "SendMessage",
message(1, "Check 1320 against PO-7731"))["result"]["task"]
print("A2A incomplete:", task["status"]["state"])
task = call(http, "SendMessage",
message(2, "EUR", task["id"]))["result"]["task"]
print("A2A complete :", task["status"]["state"],
json.dumps(task["artifacts"][0]["parts"][0]["data"]))
Output:
REST incomplete: 422 currency is required
REST complete : 200 {"order": "PO-7731", "difference": 120.0}
MCP discovers: match_invoice ['order', 'amount', 'currency']
MCP incomplete: tool error = True
MCP complete : {"order": "PO-7731", "difference": 120.0}
A2A incomplete: TASK_STATE_INPUT_REQUIRED
A2A complete : TASK_STATE_COMPLETED {"order": "PO-7731", "difference": 120.0, "currency": "EUR"}
| Interface | What happened when information was missing | What the caller must do |
|---|---|---|
| REST | HTTP 422 with our message | Code a rule for this error and send the whole request again |
| MCP | The tool call returned an error result | The model reads the error and calls again with all arguments |
| A2A | The task paused and asked | Reply to the same task with only the missing answer |
MCP can also ask the person for input during a call; see MCP Messages, Transports and Advanced Features. The point of the example is the default shape of each contract, and that the rule itself stayed in one place.
Put validation, permissions and business rules in a service layer. Add REST, MCP or A2A as thin adapters. You can then offer another interface later without a second copy of the rules.
A decision guide
| Situation | Reasonable choice | Why |
|---|---|---|
| Nightly sync between two systems | API | Fixed steps; no model needed |
| One agent, three internal functions | Plain function tools | No protocol needed yet |
| Many assistants need the same ticket system | MCP server | Write the integration once |
| Hand claims review to an insurer's agent | A2A | Separate owner, long work, questions |
| Public developer platform | API first, MCP as an adapter | Serves both code and AI applications |
| Specialists inside one program | In-process handoffs | A network protocol adds cost; see Handoffs, Routing, Shared State and Communication |
Signals you chose wrongly
- An MCP tool that runs for an hour, asks several questions and returns files may want to be an agent.
- An A2A agent that only wraps one lookup, and never pauses or fails in interesting ways, may want to be a tool.
- A model calling dozens of thin endpoints to finish one job suggests the tools need to be shaped around tasks; see MCP Tool Design and MCP vs APIs.
- Callers parsing sentences to find a number means the result needs structured fields.
What travels on the wire
The three request bodies below ask for the same thing. They are shortened to show the shape; required headers and metadata are left out.
REST POST /matches
{"order": "PO-7731", "amount": 1320, "currency": "EUR"}
MCP {"jsonrpc": "2.0", "id": 1, "method": "tools/call",
"params": {"name": "match_invoice",
"arguments": {"order": "PO-7731", "amount": 1320,
"currency": "EUR"}}}
A2A {"jsonrpc": "2.0", "id": 1, "method": "SendMessage",
"params": {"message": {"messageId": "m-1", "role": "ROLE_USER",
"parts": [{"text": "Check 1320 EUR against PO-7731"}]}}}
The first two name an operation and fill in fields. The third states a request in a message and leaves the method to the receiver. That freedom is useful when the work varies, and a burden when it does not: free text has to be interpreted, and interpretation can be wrong. A2A messages can also carry structured data parts, so agree on a data shape wherever precision matters.
Long jobs: build it or adopt it
An HTTP API can certainly run long work. The difference is how much of the pattern you must design and document yourself.
| Need | With your own API | With A2A |
|---|---|---|
| Start work and get a handle | Design a job resource | A task with an identifier |
| Status values | Invent and document them | A defined set of states |
| Ask the caller a question | Design a status, a schema and a reply endpoint | Input required, then a follow-up message |
| Progress | Polling or your own events | Polling, streaming or push |
| Cancel | Design the endpoint and its rules | A cancel operation; the rules are still yours |
| Deliverables | Your response format | Artifacts made of parts |
If one team owns both ends and the job has two states, your own job endpoint is simpler. The standard pattern pays off when many independent callers must work with many independent agents without a custom agreement for each pair.
How they fit together
Each boundary needs its own check. The finance agent verifies the assistant's identity; the MCP server verifies the finance agent's token; the business API enforces its own permissions. A token from one hop should not be forwarded to the next.
A worked scenario
A retailer wants an assistant to resolve a disputed supplier invoice. The example is illustrative.
| Step | Interface | Reason |
|---|---|---|
| A buyer asks the assistant to look into invoice 88 | The product's own chat interface | A person talking to one application |
| The assistant reads the order and delivery records | MCP tools | Several internal assistants share these lookups |
| The tools query the purchasing system | REST API | The system of record already enforces permissions |
| The assistant asks the supplier to reconcile the difference | A2A task | Another company, its own methods, may take days |
| The supplier's agent asks for the delivery note | A2A input required | A question in the middle of the work |
| The supplier returns a credit proposal | A2A artifact | A structured deliverable to validate |
| The buyer approves and the credit is posted | Approval screen, then REST | A consequential action with a human decision and a fixed operation |
Notice that the last step uses no model. Once a person has approved an exact amount, ordinary code should carry it out.
How the risk differs
| Interface | Characteristic risk | First control |
|---|---|---|
| REST API | Missing object-level permission checks | Authorize each record, not only each route |
| MCP | Hostile descriptions or results steering the model | Review servers, limit tools, approve actions; MCP Authentication and Security |
| A2A | Over-trusting another organization's agent | Verify identity, validate artifacts, bound delegation; A2A Security and Interoperability |
Testing each boundary
- API: contract tests against the published schema, including permission and error cases.
- MCP: test each tool in memory, then measure whether the model picks the right tool with the right arguments on a fixed set of requests.
- A2A: walk every task state, including questions, rejection, cancellation and a dropped stream, with each partner's client.
- Together: run a few end-to-end cases and check one trace links all the hops.
Other options worth remembering
| Option | Consider it when |
|---|---|
| Function calling inside your application | Tools serve one application |
| Framework handoffs between agents | All agents live in one codebase |
| Message queue or event stream | Work is asynchronous and the steps are fixed; see Event-Driven and Background Agents |
| Webhooks | One system only needs to hear that something happened |
| A batch file exchange | A partner cannot offer anything live, and a daily cycle is enough |
What none of them gives you
| You still need | Read |
|---|---|
| Permission rules and approvals | Tool Permissions, Approvals and Abuse Risks |
| Safe retries for actions | Reliable Tool Execution and Error Recovery |
| Defenses against injected instructions | Prompt Injection Attacks and Defenses |
| Tracing across boundaries | Agent Tracing and OpenTelemetry |
| Quality testing of model behavior | Agent Evaluation Framework |
| Ownership, versioning and retirement | Agent Inventory, Policy-as-Code and Release Gates |
Cost and effort
| Consideration | API | MCP | A2A |
|---|---|---|---|
| Model tokens | None in your code path | Tool descriptions and results enter the context | Spent inside the remote agent |
| Repeatability | High | Model chooses; test the choices | Depends on the remote agent |
| Operating burden | Familiar | Another server to secure and watch | Task storage, long-running work, partners |
| Change risk | Your versioning | Description changes alter model behavior | Skill and artifact changes break partners |
Versioning and change
All three break callers in different ways, so each needs its own release discipline.
| Change | API | MCP | A2A |
|---|---|---|---|
| Add an optional field | Usually safe | Safe for code; check whether the model starts filling it wrongly | Usually safe if consumers ignore unknown fields; confirm it |
| Reword a description | Documentation only | Can change which tool a model picks; rerun evaluations | Can change which agent or skill gets chosen |
| Rename or remove | New version | New tool name, with an overlap period | New skill or artifact version, agreed with partners |
| Upgrade the protocol | Rare | Test clients and servers across specification dates | Test each partner across protocol versions |
Questions to settle in a design review
- Who owns each side, and who is called when it fails?
- Which identity reaches the system of record, and what may it do?
- Which steps must be exact and repeatable, and are they in code?
- How long can the work take, and how does the person learn the outcome?
- What happens if the same request arrives twice?
- What data crosses each boundary, and is that permitted?
- How will you test the whole path before and after a change?
Adopting in steps
- Get the underlying API and its permissions right.
- Give one agent a few well-designed tools.
- Move tools behind MCP when a second application needs them.
- Add A2A when a separately owned agent needs to take on whole tasks.
- At every step, keep an evaluation set so you can tell whether the change helped.
Common mistakes
| Mistake | Better |
|---|---|
| Calling MCP and A2A competitors | Treat them as different boundaries that combine |
| Replacing stable integrations with a model | Keep fixed work in code |
| Generating one tool per endpoint | Design tools around jobs |
| Using A2A between functions in one process | Use direct calls or framework handoffs |
| Assuming a protocol makes access safe | Check identity and permission at each boundary |
Questions people ask
Will MCP or A2A replace REST APIs?
Unlikely. Both usually sit in front of ordinary APIs and databases, which remain where data and rules live.
Can an MCP tool call an A2A agent?
Yes. A tool can start a remote task and return its identifier or result. Plan how the application will follow long tasks and relay questions to the person.
Which should a small team learn first?
Plain tool calling, then MCP when you want to share tools. Add A2A when you have a real agent-to-agent boundary.
Do these protocols lock us in?
They are open specifications, which helps. Lock-in more often comes from models, platforms, data formats and logic buried in one framework.
References
Next steps
Build an MCP Server and Client
Build a tool server and call it.
Build, Deploy and Troubleshoot A2A
Build and run an agent service.
Single-Agent vs Multi-Agent Systems
Decide whether you need more than one agent.