Skip to content
Antonio Kodheli

MCP vs API: The Difference and When to Use Each (2026)

MCP vs API from a developer who ships both: what each is for, a side-by-side code example, where function calling and agent skills fit, and how to decide.

Antonio Kodheli··12 min read

An API is how one program talks to another. MCP (the Model Context Protocol) is a standard way for an AI model to discover and use tools, and in most real systems an MCP server is a thin layer that sits on top of an existing API. So "MCP vs API" is rarely a choice between the two. The real question is whether you also want AI assistants to be able to use your API on their own, and MCP is the cleanest way to let them.

I run both in production. ServeStack, my restaurant ordering platform, has a normal REST API that its storefronts and apps call, and an MCP server on top of it so AI assistants can browse a menu and place an order. This guide explains the difference the way I'd explain it to a client deciding whether they need one.

The MCP vs API scale: who decides what gets called

The cleanest way to see the difference is to ask who picks which call to make. Moving down the scale, the model makes more of the decisions and the interface has to explain more about itself.

LevelWhat it isWho decides the callLabel
1Plain API (REST, GraphQL)Your code, written ahead of timeBest for: apps, services, integrations
2API + function callingThe model, from tools your app passes in each requestBest for: an AI feature inside one product
3MCP serverThe model, from tools any MCP client discovers at run timeBest for: making your product usable by any AI assistant
4Agent + MCP + skillsThe model plans several steps and picks tools as it goesBest for: multi-step work like support, ops and research

Most products end up at level 1 for their own apps and level 3 for AI access, both on the same backend.

MCP vs API in one table

API (REST, GraphQL, gRPC)MCP server
Built forPrograms written by developersAI models acting for a user
Who decides what to callThe developer, at design timeThe model, at run time
How the caller learns what existsDocs, an OpenAPI file, reading codeThe server lists its tools, with descriptions and input schemas, when the client connects
ShapeEndpoints, verbs, resourcesTools (actions), resources (data to read) and prompts (reusable templates)
Wire formatWhatever the API chooses, usually JSON over HTTPJSON-RPC 2.0 over stdio (local) or HTTP (remote)
GranularityFine-grained: many small endpointsTask-sized: a few tools that each do one useful job
Works withAnything that can make a requestAny MCP client: Claude, ChatGPT, IDEs such as Cursor and VS Code, agent frameworks
Typical ownerYour backendA small service that calls your backend

The short version: an API exposes capabilities, an MCP server explains them to a model.

Is MCP an API?

Technically yes. MCP is a protocol with requests and responses, so an MCP server is an API in the broad sense. It is a very specific kind of API, though, with three properties a normal API does not promise:

  1. Self-description. When an AI client connects, it asks the server for its list of tools. Each tool comes with a plain-language description and a JSON Schema for its inputs. The model reads those descriptions to decide what to call, so the descriptions are effectively part of the code.
  2. One standard for every client. Before MCP, connecting a tool to Claude, then to ChatGPT, then to an IDE meant three different integrations. With MCP you write one server and every MCP-compatible client can use it.
  3. Built-in places for the human. The protocol and the clients around it are designed for a user who approves actions, signs in with OAuth, and sees what the model is doing.

If you want the full background on the protocol itself, start with what an MCP server is.

The same feature as an API and as an MCP tool

Here is a concrete example. A restaurant wants AI assistants to be able to check whether an item is available.

The API endpoint already exists. A developer calls it from the website:

// GET /v1/locations/:locationId/menu/items/:itemId
app.get("/v1/locations/:locationId/menu/items/:itemId", async (req, res) => {
  const item = await menu.getItem(req.params.locationId, req.params.itemId);
  if (!item) return res.status(404).json({ error: "not_found" });
  res.json({ id: item.id, name: item.name, priceCents: item.priceCents, available: item.available });
});

The MCP tool wraps it. Notice that most of the work is the description and the input schema, written for a model rather than a developer:

import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

const server = new McpServer({ name: "restaurant", version: "1.0.0" });

server.registerTool(
  "check_item_availability",
  {
    title: "Check menu item availability",
    description:
      "Check whether a menu item can be ordered right now and what it costs. " +
      "Use this before adding an item to an order. Prices are in US cents.",
    inputSchema: {
      itemName: z.string().describe("The item as the customer said it, e.g. 'large cheese pizza'"),
    },
  },
  async ({ itemName }) => {
    const item = await menu.findByName(LOCATION_ID, itemName); // calls the same backend as the API
    if (!item) {
      return { content: [{ type: "text", text: `No item matching "${itemName}" is on the menu.` }] };
    }
    return {
      content: [{
        type: "text",
        text: `${item.name}: ${item.available ? "available" : "sold out"}, $${(item.priceCents / 100).toFixed(2)}`,
      }],
    };
  },
);

Three differences matter here:

  • The tool takes what the user said, not an ID. A model rarely has your internal IDs, so the tool resolves a name to an item itself.
  • The answer is written to be read. The API returns raw fields for a program. The tool returns a short sentence the model can relay or reason over.
  • The description tells the model when to use it. "Use this before adding an item to an order" is the kind of line that decides whether an agent behaves well.

Where function calling fits

Function calling (also called tool use) is the model feature underneath all of this. With the Claude API you pass a list of tools in the request, and the model replies with a structured call to one of them. Your code runs it and sends the result back.

Function callingMCP
Where tools are definedIn your app's code, inside each API requestIn a separate server any client can connect to
Who can use themOnly the app that defined themAny MCP client
Best forTools that only make sense inside one productTools you want many assistants and apps to share

MCP does not replace function calling. When Claude uses an MCP tool, the client turns the server's tool list into function definitions and the model calls them the same way. MCP standardises where tools come from; function calling is how the model calls them.

Where agent skills fit

Agent skills are packaged instructions, scripts and reference files that teach an agent how to do a kind of task, loaded only when they are relevant. They answer a different question than MCP:

  • MCP gives an agent new abilities: "here is a tool that can read the order database."
  • A skill gives an agent know-how: "here is how we write a refund email, and here is the script that formats the report."

Good agents usually have both. A support agent might use an MCP server to look up orders and a skill that holds the company's refund policy and tone.

When to build an MCP server (and when an API is enough)

Build an MCP server when:

  • You want customers to use your product from inside Claude, ChatGPT or their IDE.
  • You are building an AI agent and want its tools to be reusable by other agents and clients later.
  • Your API is large and a model gets lost in it. A handful of task-sized MCP tools works much better than handing a model 200 endpoints.
  • You need user-level permissions for AI access. Remote MCP servers support OAuth, so each user's assistant acts with that user's rights.

An API alone is enough when:

  • Only your own code calls it, and no AI model needs to choose what to call.
  • The work is a fixed pipeline. If the steps never change, write the code. A model choosing between tools adds cost and uncertainty for no gain.
  • You need very high throughput between services. MCP is designed for an assistant making a few deliberate calls, not for service-to-service traffic.

Security: the part most comparisons skip

An API is usually called by code you wrote. An MCP tool is called by a model that is reading text from users, web pages and documents. That changes the rules:

  1. Keep tools narrow. refund_order(orderId, reason) with a limit is safer than run_sql(query).
  2. Ask before acting. Anything that spends money, sends a message or deletes data should require the user's confirmation in the client.
  3. Treat tool results as untrusted. If a tool returns text from the outside world, a prompt injection can ride along with it. Don't let one tool's output silently trigger another tool's write.
  4. Use real auth for remote servers. OAuth with scoped tokens, not a shared API key baked into the server.
  5. Log every call. You want to see which tool the model called, with what inputs, and what it returned.

On ServeStack the MCP checkout never takes a card number from the model. The agent builds the order, and payment happens on a checkout page where the customer confirms it. That one design choice removes most of the risk.

How to add MCP to an existing API

If you already have an API, adding MCP is usually a few days of work, not a rebuild:

  1. List the five to ten jobs an assistant would actually do with your product. Those become tools. Don't mirror every endpoint.
  2. Write the descriptions first. Say what the tool does, when to use it and what the units are. Test them by asking a model to plan a task using only the descriptions.
  3. Wrap your API. Each tool calls your existing endpoints or service layer.
  4. Pick a transport. stdio for a tool that runs on the user's machine, HTTP for a hosted server that many users connect to.
  5. Add auth and confirmations for anything that writes.
  6. Test in real clients. Connect it to Claude and an IDE and run the tasks end to end.

My open-source MCP Server Starter has the structure for tools, resources and prompts if you want to start from working code.

Keep going

Frequently asked questions

What is the difference between MCP and an API? An API lets programs call your software. MCP is a standard that lets AI models discover and use tools, usually by wrapping an existing API with descriptions and input schemas the model can read. Most MCP servers call an API underneath.

Does MCP replace REST APIs? No. MCP servers almost always sit on top of REST or GraphQL APIs. Your apps keep using the API directly; AI assistants use the MCP server.

Is MCP the same as function calling? No. Function calling is the model feature that lets it request a tool call. MCP is the standard for where those tools live and how any client can connect to them. An MCP client turns MCP tools into function calls for the model.

What is the difference between MCP and agent skills? MCP gives an agent new tools and data. Skills give it instructions and know-how for a kind of task. They work together.

Do I need an MCP server for my product? You need one if you want people to use your product from inside AI assistants, or if you are building agents that should share tools. If only your own code calls your API, you don't.

How long does it take to build an MCP server? A server with a few tools over an existing, well-documented API can be built in days. Most of the time goes into tool design, permissions and testing with real clients.

I build MCP servers on top of existing APIs so Claude, ChatGPT and other AI assistants can use your product safely. Tell me what your API does and you'll get a fixed price for the first version.

Get an MCP server built for your product

Written by Antonio Kodheli

Full-stack web developer in Boston. I build modern web apps with TypeScript, Next.js, and the Claude API, and write about it here.