# MCP vs. API: What's the Difference?

> An API is an interface a developer writes code against. MCP is a protocol an AI app uses to find a service's tools and call them for you, usually with that same API behind it.

Page: https://tryhoming.com/blog/mcp-vs-api
Updated: 2026-12-02
Published 2026-12-02

An API is an interface a developer writes code against. MCP, the Model
Context Protocol, lets an AI app discover what a service can do and call it
during a conversation.

The difference is who picks the call. Use the API when your own code makes
it. Use MCP when a person works through an AI app and the app picks it. Often
a service has both, because its MCP server calls its API.

"API" here means a web API, the REST kind you reach over HTTP. MCP is an API
in the broad sense too. This post covers only its tools. Servers can also
offer resources and prompts. [What MCP Is](https://tryhoming.com/learn/mcp/what-mcp-is) covers those.

## A Restaurant Directory

Picture a service that lists restaurants and takes reservations. With its
API, you write the code. You read the docs, learn the exact addresses and
fields, and write each call before anything runs. The menu is in the docs.

Figure: With MCP, the menu comes to the table: the AI sees what it can order, then orders.
With MCP, the directory hands the AI a menu at the table. It lists three
tools: `search_restaurants`, `get_menu` and `book_table`. Someone types "find a vegetarian lunch spot near
Union Square for 2 at 1pm." The AI reads the menu and picks a tool. Nobody
wrote that call in advance.

## Side by Side

| | REST API | MCP |
| --- | --- | --- |
| Who calls whom | Code a developer wrote calls the service. | An AI app calls the server when the model picks a tool and the app allows it. |
| Discovery | A person reads the docs, or an OpenAPI file, before writing code. | The client asks the server what it offers, with `tools/list`. |
| Auth | Whatever the service chose: an API key, OAuth, a signed request. | For a remote server the spec describes OAuth. Many servers also accept an API key as a bearer token. |
| Schema | Documented per endpoint. A machine-readable schema is optional. | Every tool carries a name, a description and a JSON Schema for its arguments. |
| On the wire | Many URLs. The HTTP verb and the path say what to do. | JSON-RPC 2.0 to one endpoint. The method in the body says what to do. |
| State | Each request stands alone. | Through version 2025-11-25, a connection opens with an `initialize` handshake. Version 2026-07-28 drops it. |
| Designed for | Developers and the programs they write. | Models and the apps that run them. |

## The Directory as a REST API

Figure: An API: code you wrote calls the directory at addresses you already know.

Here is the lunch search as a developer writes it. The values are made up.

```http
GET /restaurants?near=union-square&diet=vegetarian HTTP/1.1
Host: api.directory.example
Authorization: Bearer sk_test_…

HTTP/1.1 200 OK
Content-Type: application/json

{
  "restaurants": [
    { "id": "rst_218", "name": "Greenhouse Lunch", "walk_minutes": 4 },
    { "id": "rst_077", "name": "Root and Stem", "walk_minutes": 7 }
  ]
}
```

Then the reservation, with an id from the first response.

```http
POST /reservations HTTP/1.1
Host: api.directory.example
Authorization: Bearer sk_test_…
Content-Type: application/json

{ "restaurant_id": "rst_218", "party": 2, "time": "2026-12-04T13:00:00-05:00" }

HTTP/1.1 201 Created
Content-Type: application/json

{ "id": "res_9041", "status": "confirmed" }
```

The verb and the URL say what to do: a GET to `/restaurants` reads,
and a POST to `/reservations` creates. The developer knew both paths,
the field names and the API key header from the docs before the code ran.
If the directory renames `party` to `guests`, the
program fails until someone edits it.

## The Same Directory over MCP

Figure: MCP: an AI app asks the directory's server what tools it has, then calls one. The server calls the same API.

The directory's MCP server offers the same abilities as tools. A client
starts by asking for the list. Every message is JSON-RPC 2.0, sent to one URL.
The method name in the body says what to do.

```json
{ "jsonrpc": "2.0", "id": 1, "method": "tools/list", "params": {} }

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      {
        "name": "search_restaurants",
        "description": "Find restaurants near a place. Filter by diet. Returns ids to pass to get_menu or book_table.",
        "inputSchema": {
          "type": "object",
          "properties": {
            "near": { "type": "string", "description": "A neighborhood or address." },
            "diet": { "type": "string", "enum": ["vegetarian", "vegan", "gluten-free"] }
          },
          "required": ["near"]
        }
      },
      { "name": "get_menu", "description": "Read one restaurant's menu.", "inputSchema": { … } },
      { "name": "book_table", "description": "Reserve a table. Ask the person before calling.", "inputSchema": { … } }
    ]
  }
}
```

That response is the menu. Each tool has a name, a description written for a
model, and a JSON Schema for its arguments. The app gives all of it to the
model with the person's request.

The model reads "vegetarian lunch near Union Square" and picks `search_restaurants`. It can't reach the server. It proposes the
call, and the app decides whether it runs. If it does, the app's client sends
this:

```json
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "search_restaurants",
    "arguments": { "near": "Union Square", "diet": "vegetarian" }
  }
}
```

The server runs the tool and answers with the same `id`.

```json
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "content": [
      { "type": "text", "text": "{\"restaurants\":[{\"id\":\"rst_218\", …}]}" }
    ],
    "structuredContent": {
      "restaurants": [
        { "id": "rst_218", "name": "Greenhouse Lunch", "walk_minutes": 4 },
        { "id": "rst_077", "name": "Root and Stem", "walk_minutes": 7 }
      ]
    },
    "isError": false
  }
}
```

The model shows the person the result. On a yes, it calls `book_table` for 2 at 1pm the same way.

The server answered by making the same `GET /restaurants` request
from the section above, with its own API key. `book_table` makes
the same `POST /reservations`. An MCP server usually sits on top of
an existing API and describes it so an AI can use it.

## When to Use Which

Ask who decides what gets called. If code you wrote decides, use the API. If a
model decides while a person talks to it, use MCP.

| If | Use |
| --- | --- |
| Your own code calls the service on a fixed path: a nightly export, a charge at checkout, a sync between two systems. | API |
| The same input has to produce the same call every time. | API |
| The job runs in a backend with no AI in the loop. | API |
| The call moves a lot of data, such as ten thousand restaurants. | API |
| A person works in an AI app and wants it to find and call the right tool. | MCP |
| You want one integration that works in many AI apps. | MCP |
| You run a service and want both kinds of caller. | Both |

The API wins when the call is known in advance. A nightly export already
knows what to call. A model in the middle adds a step that can choose
differently tomorrow and gains you nothing. Result size is a second limit.
Whatever a tool returns goes into the model's context window, which is finite.
So ten thousand restaurants belong in a paginated response or a file.

MCP wins when nobody can write the call in advance. A person asks for lunch
near Union Square today and a table for six on Friday, in their own words.
The model works out which tool fits. The same server works in every AI app
that speaks MCP, so the directory builds one integration instead of one per
app.

Keep the menu short. The app puts the definition of every connected tool in
front of the model on every turn, so a server with two hundred tools serves a
model worse than one with ten. An API can have two hundred endpoints, and a
caller that uses three never pays for the rest. [How a Model Picks a Tool](https://tryhoming.com/learn/mcp/picking-a-tool) has the
details.

If you already have an API, the MCP server can be small. Give it a few tools
that call endpoints you have, covering what a person would ask an assistant
to do. Leave the rest of the API out.

## How to Add an MCP Server

You don't write code to use MCP. To add a remote server, paste its address
into an AI app and sign in. The app opens a browser so you can sign in to the
service, and its tools show up in your next chat. Where the address goes
depends on the app.
- In Claude, on claude.ai or in Claude Desktop, add a custom connector under Connectors and paste the address.
- In ChatGPT, add a custom MCP server, paste the address and choose OAuth. Your plan and workspace have to allow custom servers.
- In Claude Code, run one command, then type `/mcp` to sign in.
- In Codex, run one command. It sends an API key you keep in an environment variable.

The two commands for the example directory:

```bash
claude mcp add --transport http directory https://mcp.directory.example/mcp

codex mcp add directory \
  --url https://mcp.directory.example/mcp \
  --bearer-token-env-var DIRECTORY_API_KEY
```

A local server is the other kind: a program on your machine. The app starts
it and talks to it over stdio, so there is no address to paste.

Menu names change, so check each app's docs for the exact steps. [Connect Your Agent](https://tryhoming.com/guides/connect) has the steps for adding
Homing to each of these apps. [For Agents](https://tryhoming.com/for-agents) lists its
address and every tool. [Signing In to a Remote
MCP Server](https://tryhoming.com/learn/mcp/sign-in) shows what happens during sign-in.

## How Homing Uses Both

Figure: Homing: your agent writes over MCP, you read in the web app over REST.

Homing delivers messages from AI sessions to a person's inbox. It uses both
kinds. Your agent connects to the MCP server at `https://api.tryhoming.com/mcp`. It calls `ping` to check the
connection, then sends with the `send_message` tool. The tool's result is
a receipt with `status: "delivered"`.

The person reads that message in the web app at app.tryhoming.com. The web app
talks to the same server over REST. The agent can't study documentation
before every session, so it gets tools it can discover. The web app is
Homing's own code, written ahead of time, so it calls the API.

## Questions People Ask

### Is MCP replacing APIs?

No. Most MCP servers call a REST API to do their work. MCP adds a way for an AI app to discover and call a service. The API stays for every caller that is ordinary code.

### Is MCP secure, and who approves the calls?

The app you use does the approving. The model can't reach a server. It proposes a call, and the app decides whether to send it, usually by asking you. The spec says the app must get your consent before it uses a tool. It also says the protocol can't enforce that. So safety depends on the app you use and the servers you add. Add a server the way you would install software: only from someone you trust.

### Do I need to build an MCP server to use MCP?

No. You add a server that someone else runs to an AI app that supports MCP. You build a server only to make your own service or data usable from AI apps.

### Can one MCP server work with Claude, ChatGPT and other apps?

Yes. A server that follows the spec works with any client that follows it, so one server can serve Claude, ChatGPT, Claude Code, Codex and others. The apps differ in how you add a server and which sign-in methods they support.

### What is the difference between MCP tools, resources and prompts?

Who decides when they are used. Tools are actions the model proposes, like search_restaurants. Resources are data the app chooses to show the model, like a file. Prompts are ready-made requests that you pick yourself.

### Does MCP need an API key or OAuth?

For a remote server, the spec describes OAuth. The app sends you to the service to sign in and gets a token back. Many servers also accept an API key as a bearer token, for clients that can't open a browser. A local server reads its credentials from the environment.

### Is MCP free and open?

Yes. MCP is an open standard. Anyone can build a client or a server without paying for the protocol. A service you reach through MCP can still charge for its own plan.

## Go Deeper
- [How AI Assistants Use Tools](https://tryhoming.com/learn/mcp-plain-english/how-assistants-use-tools):
the same ground with no code.
- [What MCP Is: Hosts, Clients and Servers](https://tryhoming.com/learn/mcp/what-mcp-is):
the three roles, and why the model never calls the server.
- [One Conversation, Message by Message](https://tryhoming.com/learn/mcp/one-conversation):
real traffic from Homing's server, one message at a time.
- [Signing In to a Remote MCP Server](https://tryhoming.com/learn/mcp/sign-in): OAuth,
and where an API key fits.
- [Connect Your Agent](https://tryhoming.com/guides/connect): add Homing to Claude Code,
Codex, ChatGPT and other clients.
- [For Agents](https://tryhoming.com/for-agents): Homing's endpoint and every tool it lists.
