AI systems and automationTechnical article

MCP vs API: what changes when a model, not your code, picks the call

An MCP server normally calls an ordinary API underneath, so the two are not rivals. What differs is who picks the call, your code or a model, and what that choice costs in tokens, permissions and moving parts. The current MCP revision also removed the handshake that most comparisons still describe.

In short

  • An API is the interface a service offers. MCP is a protocol that lets an AI app ask a server which tools it has and call them, and most MCP servers call an ordinary API underneath.
  • With an API, your code picks the call when you write it. With MCP, the model picks from a list it reads while it runs.
  • MCP saves connector code when many applications meet many tools. It costs context tokens for every tool definition, and it adds a second place where permissions must be checked.
  • Call the API directly when your code knows the call. Consider MCP when a model chooses among many tools, written by other people, that change over time.

They sit at different layers

Most comparisons of MCP and APIs are out of date in one detail. The Model Context Protocol has a current revision, 2026-07-28, and its changelog removed the initialize handshake and the protocol-level sessions that earlier revisions required. Every request now carries its protocol version and the client's capabilities with it. An article that calls MCP the stateful one and APIs the stateless one is describing revision 2025-11-25 or older.

So what is each one? An API is the interface a service offers to programs. The OpenAPI specification describes HTTP APIs so that people and tools can understand what a service can do without reading its source code. MCP is a protocol of JSON-RPC messages between an AI application and a server. The server lists tools, each with a name, a description and a JSON Schema for its input, and the specification calls tools model-controlled: the model can discover and call them on its own. Behind a tool there is very often an ordinary API. The tools page itself gives querying databases and calling APIs as examples.

Figure 1Who learns what a service can do, and when
The agent reads the list of calls while it runsRUNThe app asks the server what it offerstools/listRUNThe model reads the names and descriptions and picks onerefund_orderRUNThe app sends the call with the arguments the model filled intools/callRUNThe result comes back as content the model readscontent: [ ... ]No handshake: every request carries the protocol version (revision 2026-07-28).

Swipe sideways to see the whole figure

IntegrationMCP revision
The order of steps follows the MCP tools page and the lifecycle page of revision 2025-11-25. Revision 2026-07-28, the current one, has no handshake: each request carries the protocol version. The tool name and the refund call are made up for the picture.

Switch the figure between the two. With a plain API, three of the four steps happen before the program ships: someone reads the documentation, writes the call and tests it. At run time the program makes the call it was written to make. With MCP, all of it happens while the agent runs. The app asks the server for its tools, the model picks one by reading the descriptions, and the app sends the call with the arguments the model filled in. Turn the revision switch to 2025-11-25 and a handshake step appears at the front. In the current revision it is gone.

Why a shared protocol exists at all

Suppose three AI applications each need four tools: a calendar, a CRM, a ticket system and a file store. If every application writes its own connector for every tool, that is 3 × 4 = 12 connectors to build and keep working. If each application speaks one protocol and each tool offers one server, it is 3 + 4 = 7. Anthropic's engineering team puts the problem this way: connecting agents to tools has meant a custom integration for each pairing, which is duplicated effort.

Figure 2Connectors to build: every pair, or one protocol
APPLICATIONSTOOLSAI app 1AI app 2AI app 3Tool 1Tool 2Tool 3Tool 4Custom connectors to build and keep working3 × 4 = 1212 pieces

Swipe sideways to see the whole figure

Wiring
Simplified. It counts the worst case, where every application needs its own code for every tool. A team with one application and a few services has no pairing problem, and a shared protocol only adds a layer there. Each MCP server still has to be written once.

Drag the sliders. The gap opens as either side grows: 6 applications and 8 tools is 48 connectors against 14. Look at the other end too. One application that calls four services has no pairing problem. It needs four API clients, it has them, and a protocol between them only adds a layer. The saving belongs to the case where many applications meet many tools.

The cost nobody draws: every tool definition is text the model reads

A model chooses a tool by reading its definition, so the definitions have to sit in front of it. Anthropic's engineering team describes this in its post on code execution with MCP. Most MCP clients load all tool definitions upfront into the context window, and an agent connected to thousands of tools may need to process hundreds of thousands of tokens before it reads the request. Results cost tokens as well. In the post's example, copying a two-hour sales call transcript from one tool to another sends the transcript through the model twice, an extra 50,000 tokens. A direct API call from your code has neither cost, because the model never sees a list and never carries the data.

Figure 3What the model reads before the first word of the request
60 definitions × 400 tokens = 24,000 tokens0100,000200,000 tokens12.0%of the window is used by tool definitionsbefore anyone has typed a request.A direct API call from your code adds none of this: the model never reads a list.

Swipe sideways to see the whole figure

Definitions loaded
Made up for the picture: the tokens per definition and the 200,000-token window, which is an example size. In Anthropic's own example the saving was from 150,000 tokens to 2,000, 98.7%, when the agent loaded only the definitions a task needed. Your clients and servers will differ.

Set 60 tools at 400 tokens each, a made-up size, and the definitions take 24,000 tokens, 12% of a 200,000-token window, before the user has typed anything. Switch to loading only five at a time and it is 2,000 tokens. Anthropic reports a drop of the same kind in its own example: from 150,000 tokens to 2,000, a saving of 98.7%, when the agent loads only the definitions a task needs. That is one example from one post and no promise for your setup. The idea carries over: connect fewer tools to each agent, keep descriptions short, and load the rest on demand.

A server in the middle needs its own permission checks

An MCP server is a second front door to the same system. The API behind it already knows how to refuse a caller without rights. The server in front of it knows only what it was built to know. If the server calls the API with one powerful key of its own, the API sees the server on every request and never the person behind it.

The specification pushes the other way. An MCP server must validate that an access token was issued for it, and token passthrough, forwarding the token it received on to the downstream API, is explicitly forbidden. The tools page lists what a server must do: validate all tool inputs, implement proper access controls, rate limit calls and sanitize outputs. Authorization itself is optional in MCP, and a local server on stdio takes its credentials from the environment, so whether anyone checks who is calling depends on how it was set up.

Figure 4Five requests through an MCP server to one API
REQUESTMCP SERVERWHAT THE API SEESRESULTAna: read order 4821admin keysame for everyonethe server: alloweddoneAna: refund $20admin keysame for everyonethe server: alloweddoneAna: refund $5,000admin keysame for everyonethe server: alloweddone, wrongBen: read order 4821admin keysame for everyonethe server: alloweddoneBen: export all customersadmin keysame for everyonethe server: alloweddone, wrong5 of 5 went through, 2 of them should not haveMade-up rules: support reads orders and refunds up to $50. The intern reads orders only.

Swipe sideways to see the whole figure

The server calls the API with
Made up for the picture: the two people, their rules and the five requests. The MCP specification forbids a server from passing on the token it received and says servers must implement access controls. How a server then acts for each user is the part you design.

Flip the figure between the two settings. The rules are made up: support staff can read orders and refund up to 50 dollars, and the intern can only read. With one admin key on the server, all five requests succeed, including a 5,000 dollar refund and a full customer export from the intern's account. With the caller's own rights carried through, the API stops those two and 3 of 5 go ahead. Forwarding the received token is ruled out, so the server needs its own way to act for that user, and designing it is part of the work.

Which one to pick

Three questions decide most cases: who chooses the next call, how many services are involved, and who runs them. The figure turns the answers into a rule of thumb. It is my own rule, not part of the specification.

Figure 5Which one for this job
Your API behind a few tools in your own agentDescribe two or three calls as tools in the agent's code.A shared protocol between things you own buys little.Modelpicks the toolToolsdefined in your codeAPI 1API 2

Swipe sideways to see the whole figure

Who picks the next callServices involvedWho runs them
A rule of thumb from my own work, not part of the MCP specification. Real systems mix these: one agent can use a vendor's server and two tools of your own.

The first answer usually settles it. If your code decides, call the API. If the model decides among two or three things you own, describe them as tools in your agent's code. A protocol starts to pay when many tools, written by other people, change over time, or when a vendor already publishes a server you want to use.

Start from an API that is already clean

An MCP server is a thin layer, so the API underneath has to be documented and have sensible limits first. This is the shape of one tool that wraps a refund call. The name says what it does, the description says when to use it, and the schema accepts only the fields the API needs.

{
  "name": "refund_order",
  "description": "Refund part or all of one order. Use only when the customer asked for a refund.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "order_id": { "type": "string" },
      "amount_cents": { "type": "integer", "minimum": 1 }
    },
    "required": ["order_id", "amount_cents"]
  }
}

Expose a few tools, not every endpoint

One tool for each endpoint turns a hundred-endpoint API into a hundred definitions in the prompt, and the context figure shows what that costs. Group the tools around what a user wants done and leave the rest out.

Act as the person, and say what went wrong

Check the caller's token on the server, call the API with that person's rights and log every call. When a call fails, return a tool error with isError: true and a clear message such as "amount is above this user's limit". The specification says clients should pass tool execution errors to the model so it can correct itself, and a bare failure gives it nothing to correct.

Where a startup's version of this goes wrong

  • An MCP server is built for one internal script that could have called a function.
  • The server holds an admin key because that was the quickest way to make the demo work.
  • Every endpoint becomes a tool, so the agent starts each task with a long list to read.
  • A server made for one laptop, with a key in an environment variable, ends up shared by the whole team.
  • A third-party server is connected and nobody reads what its tools claim to do. The tools page tells clients to treat tool annotations as untrusted unless the server is trusted.

How this looked in a real product

In the parts of Aslam HQ, my own agency system, that its case study describes, the calls to Claude, LinkedIn, X and the email provider are ordinary API calls made from the app's own routes. My code decides each call, so there is no list for a model to choose from and no protocol layer in between.

The permission rule from this article is built in. Each route checks the person and their grant again before it uses the service key, and the AI features read the conversation through the caller's own session, so Claude only sees what that person is allowed to see. If I put a server in front of HQ for an agent to call, that is the rule the server would have to keep.

Questions to answer before you add an MCP server

  1. Who picks the next call in this feature, our code or a model?
  2. Would two or three tool definitions in the agent's own code do the job?
  3. How many tool definitions does the agent read before the first request, and how many tokens is that?
  4. Which key does the server use to call the API, and does it carry the caller's rights?
  5. Is every token checked as issued for this server, and is none of them forwarded downstream?
  6. What do we log for each call, and who reads it?
  7. Who wrote each third-party server we connect, and who has read what its tools say they do?

Sources

  1. Model Context Protocol, versioning (current revision 2026-07-28)
  2. MCP specification 2026-07-28, changelog (handshake and sessions removed)
  3. MCP specification 2026-07-28, Tools (model-controlled, tools/list, tools/call, errors, security)
  4. MCP specification 2026-07-28, Authorization (optional, token audience)
  5. MCP specification 2025-11-25, Lifecycle (the initialize handshake)
  6. MCP security best practices (token passthrough)
  7. OpenAPI Specification v3.2.1
  8. Anthropic Engineering, Code execution with MCP (4 November 2025)

The animated figures are simplified illustrations that use the numbers stated in the text. Where a figure is modelled on a real incident, the sources above are the full accounts.

The service behind this articleAI Systems, Agents, and Workflow AutomationRelated case studyAslam HQ: the system that runs my own agency
Aslam Sarfraz profile photo

Aslam Sarfraz

AI, DevOps and full-stack engineer

More articles

DevOps and reliability · 10 min read

How a memory error in PHP can run a stranger's code on your server

PHP's two critical bugs of October 2026, explained: a memory error that leaves a request half built, a worker that keeps a pointer to freed memory, who is exposed and what to do this week.

AI systems · 10 min read

Why your AI agent works in the demo and fails in production

A strong agent that solved about 61% of retail tasks on one try solved under a quarter of them on all eight tries. Five reasons a demo hides this, each with arithmetic you can check.

AI systems · 10 min read

How AI backends handle millions of requests without falling over

A chat answer keeps a GPU, a block of memory and a connection busy for many seconds. What that does to a backend, how serving systems cope, and what a startup should copy.

Full-stack engineering · 8 min read

Why startup backends break at the first big traffic spike

Ticketmaster took 3.5 billion requests in one sale and Segment merged more than 140 services into one. The failures behind spikes are rarely exotic, and each one has arithmetic you can do before launch.

DevOps and reliability · 8 min read

How one config change takes down production, and how to contain yours

CrowdStrike, Google Cloud, AWS and Cloudflare each had a major outage between July 2024 and November 2025, and none began with an attack. What happened, what it teaches and what to put in place.

LinkedIn outreach · 7 min read

Designing a LinkedIn outreach pipeline: a fixed capacity and an unseen limit

Outreach is a pipeline with a fixed capacity, a limit nobody publishes and very small samples. The planning numbers I use and the engineering behind them.