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.

BeginnerIntermediateExpert · 12 min read · Last updated:

In short

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.

Versions used

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.

Beginner The one-minute answer

Three kinds of request

REST"Create this record." The caller knows the operation and the fields.
MCP"Here are tools you can use." A model picks from described actions.
A2A"Please take care of this." Another agent decides how, and reports back.

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

AspectREST APIMCPA2A
Typical callerApplication codeAn AI application on behalf of a modelAnother agent or application
Unit of workRequest and responseTool call, resource read or promptMessage and task
DiscoveryDocumentation, often OpenAPIList tools, resources and promptsAgent Card with skills
Who plans the stepsThe callerThe calling model and its applicationThe remote agent
Missing informationAn error; your designErrors, or a request for inputTask pauses as input required
Long workYour own job patternProgress, or the tasks extensionTask states, streaming and push
ResultA response bodyContent and structured contentArtifacts on a task
IdentityYour choice of standardOAuth-based authorization for HTTP serversSchemes declared in the card
Maturity of toolingVery broadBroad among AI applications; still changingNewer; check partners' support
Intermediate See the difference in code

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"}
InterfaceWhat happened when information was missingWhat the caller must do
RESTHTTP 422 with our messageCode a rule for this error and send the whole request again
MCPThe tool call returned an error resultThe model reads the error and calls again with all arguments
A2AThe task paused and askedReply 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.

Build the core once

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

Does your code know exactly what to call?Yes: use the API directly
Should a model choose among operations?Yes: expose them as tools, with MCP if several applications need them
Should another system own the whole job?Yes: consider A2A
SituationReasonable choiceWhy
Nightly sync between two systemsAPIFixed steps; no model needed
One agent, three internal functionsPlain function toolsNo protocol needed yet
Many assistants need the same ticket systemMCP serverWrite the integration once
Hand claims review to an insurer's agentA2ASeparate owner, long work, questions
Public developer platformAPI first, MCP as an adapterServes both code and AI applications
Specialists inside one programIn-process handoffsA 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.

NeedWith your own APIWith A2A
Start work and get a handleDesign a job resourceA task with an identifier
Status valuesInvent and document themA defined set of states
Ask the caller a questionDesign a status, a schema and a reply endpointInput required, then a follow-up message
ProgressPolling or your own eventsPolling, streaming or push
CancelDesign the endpoint and its rulesA cancel operation; the rules are still yours
DeliverablesYour response formatArtifacts 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.

Advanced Combine and govern them

How they fit together

Assistanttalks to the person
Finance agentreached by A2A
MCP serverstools and data
Business APIssystems of record

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.

StepInterfaceReason
A buyer asks the assistant to look into invoice 88The product's own chat interfaceA person talking to one application
The assistant reads the order and delivery recordsMCP toolsSeveral internal assistants share these lookups
The tools query the purchasing systemREST APIThe system of record already enforces permissions
The assistant asks the supplier to reconcile the differenceA2A taskAnother company, its own methods, may take days
The supplier's agent asks for the delivery noteA2A input requiredA question in the middle of the work
The supplier returns a credit proposalA2A artifactA structured deliverable to validate
The buyer approves and the credit is postedApproval screen, then RESTA 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

InterfaceCharacteristic riskFirst control
REST APIMissing object-level permission checksAuthorize each record, not only each route
MCPHostile descriptions or results steering the modelReview servers, limit tools, approve actions; MCP Authentication and Security
A2AOver-trusting another organization's agentVerify 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

OptionConsider it when
Function calling inside your applicationTools serve one application
Framework handoffs between agentsAll agents live in one codebase
Message queue or event streamWork is asynchronous and the steps are fixed; see Event-Driven and Background Agents
WebhooksOne system only needs to hear that something happened
A batch file exchangeA partner cannot offer anything live, and a daily cycle is enough

What none of them gives you

You still needRead
Permission rules and approvalsTool Permissions, Approvals and Abuse Risks
Safe retries for actionsReliable Tool Execution and Error Recovery
Defenses against injected instructionsPrompt Injection Attacks and Defenses
Tracing across boundariesAgent Tracing and OpenTelemetry
Quality testing of model behaviorAgent Evaluation Framework
Ownership, versioning and retirementAgent Inventory, Policy-as-Code and Release Gates

Cost and effort

ConsiderationAPIMCPA2A
Model tokensNone in your code pathTool descriptions and results enter the contextSpent inside the remote agent
RepeatabilityHighModel chooses; test the choicesDepends on the remote agent
Operating burdenFamiliarAnother server to secure and watchTask storage, long-running work, partners
Change riskYour versioningDescription changes alter model behaviorSkill and artifact changes break partners

Versioning and change

All three break callers in different ways, so each needs its own release discipline.

ChangeAPIMCPA2A
Add an optional fieldUsually safeSafe for code; check whether the model starts filling it wronglyUsually safe if consumers ignore unknown fields; confirm it
Reword a descriptionDocumentation onlyCan change which tool a model picks; rerun evaluationsCan change which agent or skill gets chosen
Rename or removeNew versionNew tool name, with an overlap periodNew skill or artifact version, agreed with partners
Upgrade the protocolRareTest clients and servers across specification datesTest 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

  1. Get the underlying API and its permissions right.
  2. Give one agent a few well-designed tools.
  3. Move tools behind MCP when a second application needs them.
  4. Add A2A when a separately owned agent needs to take on whole tasks.
  5. At every step, keep an evaluation set so you can tell whether the change helped.

Common mistakes

MistakeBetter
Calling MCP and A2A competitorsTreat them as different boundaries that combine
Replacing stable integrations with a modelKeep fixed work in code
Generating one tool per endpointDesign tools around jobs
Using A2A between functions in one processUse direct calls or framework handoffs
Assuming a protocol makes access safeCheck 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