# MCP vs API: one task took 5 operations direct and 9 through MCP

URL: https://systemdesignsimple.com/mcp-vs-api-when-ai-needs-mcp/
Published: 2026-11-15
Category: AI Systems
Publisher: System Design Simple (https://systemdesignsimple.com)

## Summary

An MCP server wraps your existing API so compatible AI apps can discover and call its tools. In a scripted simulation of one task (get open orders, email a summary), letting the model pick tools took 5 operations with direct calls and 9 through MCP: the same 5 plus initialize, tools/list and 2 tools/call requests. With one AI app and one API you control, call the API.

## Key facts

- **Test setup:** Node 22 script on one Mac, run 2026-11-15, seed 32: a scripted model stub, an in-process mock shop API, and MCP simulated in one process with the 2025-06-18 message shapes. No LLM, no network, no SDK
- **Direct, model picks tools:** 5 round trips: 3 model calls and 2 API calls (GET orders, POST email)
- **Through MCP, same prompts and turns:** 9 round trips: the same 5 plus initialize, tools/list and 2 tools/call; 1 notification not counted; 2,628 simulated JSON-RPC bytes
- **Model text:** 0 estimated units different between direct and MCP dispatch, by construction; the prompts were byte-identical
- **Fixed workflow:** 3 round trips (1 model call, 2 API calls) and 282 estimated text units, against 2,157 when the model picks tools

For MCP vs API, direct tool calls are usually simpler when you control one AI app and its API integration. MCP provides a shared discovery and invocation interface when compatible hosts need those tools. In a scripted simulation run on 2026-11-15, one task took 5 operations when the app called the API directly and 9 when the same calls went through MCP.

## Who calls the API when an AI uses a tool {#who-calls}

> Definition: MCP (Model Context Protocol): a JSON-RPC 2.0 protocol in which an MCP server exposes tools, each with a name, a description and a JSON Schema for its input, and an MCP client in the AI app lists them with `tools/list` and runs them with `tools/call`.

The model never makes the call. It produces a tool-call request with a tool name and arguments, for example `get_open_orders` with `customer_id: "cust_017"`, and the host app executes it. This demo represents that request as JSON text. Without MCP, the app runs its own adapter code and calls the API. With MCP, the app hands the request to its MCP client, which sends `tools/call` to the MCP server, and the server calls the API.

The demo checks this: every request to the mock API records its caller. In all three runs the model made 0 calls. The app sent the requests in the direct runs, and the MCP server sent them in the MCP run. The MCP tools page shows the same flow: the client discovers tools, the model selects one, the client invokes it ([MCP Tools, 2025-06-18](https://modelcontextprotocol.io/specification/2025-06-18/server/tools)).

## What the demo counted {#test}

The script [`labs/ai-32/compare-mcp-vs-direct-api-steps-and-tokens.mjs`](https://github.com/systemdesignsimple/labs/blob/main/labs/ai-32/compare-mcp-vs-direct-api-steps-and-tokens.mjs) runs one task, "get my open orders and email me a summary", against the same mock shop API three ways. The model is a scripted stub, so every run makes the same choices. It ran on one Mac with Node 22 and seed 32; the output is the same every time.

| Path | Model calls | API calls | MCP requests | Simulated request/reply operations |
|---|---|---|---|---|
| A. Fixed workflow: app code calls the API, the model only writes the summary | 1 | 2 | 0 | 3 |
| C. Model picks tools, app calls the API directly | 3 | 2 | 0 | 5 |
| B. Model picks tools, calls go through MCP | 3 | 2 | 4 | 9 |

Counts exclude transport acknowledgments. C and B are the fair comparison, with the same tool definitions, prompts and turns. The script checks that their prompts are byte-identical on every turn, so the model reads the same text either way and only the route of each call changes.

[Image: Lab terminal output: the model made 0 API calls; round trips 3 for the fixed workflow, 5 direct and 9 through MCP; model text 282, 2,157 and 2,157 estimated units; MCP adds 4 round trips and 2,628 JSON-RPC bytes | The lab's printed summary, run on one Mac with Node 22. In-process simulation; no network or latency measured. Captured 2026-11-15 in Chrome. Source: `labs/ai-32/capture-output-in-chrome.mjs`.]

## Which 4 requests MCP adds {#extra}

> Definition: Round trip: one request that waits for a reply. In this demo that is a model call, an HTTP call to the API, or a JSON-RPC request between the MCP client and server.

| Request | Why it exists | How often |
|---|---|---|
| `initialize` | Agrees on the protocol version and capabilities; the spec says it MUST be the first interaction | once during session initialization |
| `notifications/initialized` | Tells the server the client is ready; a notification gets no reply, so it is not counted | once during session initialization |
| `tools/list` | Discovers the tools and their schemas | once in this demo; real clients may fetch more pages or refresh after `notifications/tools/list_changed` |
| `tools/call` | Runs one tool | once per tool use (2 here) |

The lifecycle rules come from the [MCP lifecycle page](https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle): the client sends `initialize`, the server answers with its capabilities, then the client sends `notifications/initialized`. The JSON-RPC traffic for all of this came to 2,628 bytes in the simulation.

`initialize` and `tools/list` are setup costs. `initialize` runs once during session initialization, and an MCP session is not the same thing as an HTTP transport connection. This demo makes one unpaginated `tools/list` request after initialization, though real clients may need further pages or refreshes. Once initialized, a session can serve many tasks. Each tool use still pays one `tools/call`, one hop more than the direct adapter, which runs inside the app.

## Why tool selection increased model text in this demo {#orchestration}

Compare A with C, both on the direct API with no MCP anywhere. Letting the model pick tools took 2 more model calls and raised the estimated model text from 282 to 2,157 units. Of the 1,875 extra units, 1,227 were tool definitions sent again on each of the 3 model calls (409 per call). The remaining 648 units are the net difference from changed prompts and outputs, including repeated system text, history and generated tool calls.

| | Fixed workflow (A) | Model picks tools (C) | Through MCP (B) |
|---|---|---|---|
| Model text, estimated units | 282 | 2,157 | 2,157 |
| Of which tool definitions | 0 | 1,227 | 1,227 |

The units come from a simple built-in estimate, not a real tokenizer, so only the comparison between paths means anything. Routing through MCP changed the model text by 0 units; the jump came from letting the model pick tools, and this script resends both definitions on every turn. For a task that is always "fetch orders, then email", the fixed workflow used fewer estimated text units; billing was not measured. We covered why agents resend their history in [why an AI agent re-sends its history](/why-an-ai-agent-re-sends-its-history/).

## What we saw when we ran it {#we-ran-it}

We ran `node labs/ai-32/capture-output-in-chrome.mjs` on our Mac on 2026-11-15 at 06:23 UTC. The script saved the screen it captured in Chrome as a 1400x808 image, once as a PNG in the lab folder and once as the WebP below.

![Output of our ai-32 run: node capture-output-in-chrome.mjs](/img/mcp-vs-api-when-ai-needs-mcp/lab-run.webp)

*The image the capture script saved from Chrome on 2026-11-15.*

![Screenshot of the official page: Model Context Protocol specification 2025-06-18](/img/posts/mcp-vs-api-when-ai-needs-mcp/source-1.webp)

*The official Model Context Protocol specification page we list as a source.*

That page confirms the base of our definition: MCP clients and servers talk to each other in JSON-RPC messages.

## A minimal simulated MCP client {#code}

This is the client half of the demo, trimmed. It is simulation code: `pipe.send` passes one JSON-RPC message to a server in the same process and returns its reply.

```js
// mcp-client.mjs (simulation code from labs/ai-32, trimmed)
class McpClient {
  constructor(pipe) { this.pipe = pipe; this.nextId = 1; }
  request(method, params) {
    const reply = this.pipe.send({ jsonrpc: '2.0', id: this.nextId++, method, params });
    if (reply.error) throw new Error(`${method}: ${reply.error.message}`);
    return reply.result;
  }
  connect() {                                   // once per session
    this.request('initialize', { protocolVersion: '2025-06-18', capabilities: {},
      clientInfo: { name: 'lab-host-app', version: '0.1.0' } });
    this.pipe.send({ jsonrpc: '2.0', method: 'notifications/initialized' }); // no id, no reply
  }
  listTools() { return this.request('tools/list', {}).tools; }        // discovery; may paginate or refresh
  callTool(name, args) { return this.request('tools/call', { name, arguments: args }); } // per tool use
}
```

Run `node compare-mcp-vs-direct-api-steps-and-tokens.mjs` in [`labs/ai-32`](https://github.com/systemdesignsimple/labs/tree/main/labs/ai-32) (Node 22, no install, no network; `git clone https://github.com/systemdesignsimple/labs` first). The trace prints who talks to whom, step by step; look for `JSON-RPC tools/call get_open_orders` and the line `calls made by the model: 0`.

A production client checks more than the JSON-RPC `error` field. After `initialize` it compares the `protocolVersion` the server returned with the versions it supports, and the [lifecycle page](https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle) says it SHOULD disconnect if there is no match. It calls `tools/list` only if the server declared the `tools` capability. A tool that runs and fails returns a normal result with `isError: true` ([tool errors](https://modelcontextprotocol.io/specification/2025-06-18/server/tools#error-handling)), and the snippet returns that result without checking `isError`; the host must inspect the flag and preserve the failure status when forwarding the result to the model. Every request also needs a timeout. For `send_email` a timeout leaves the outcome unknown, because the email may already be out, so the API needs duplicate-send protection, such as an idempotency key, before the client retries.

## MCP vs API: when should you use MCP? {#when}

The direct path is simpler when no other app needs the tools. MCP's extra requests pay for a shared interface: compatible hosts can reuse the server's tool interface after configuration and authorization, without new adapter code in each one. Our [tool discovery article](/how-ai-learns-new-apps-tool-discovery/) shows a client picking up new apps through `tools/list` alone.

| Situation | Call the API | Run an MCP server |
|---|---|---|
| One AI app, one API, you own both | simplest, fewest hops | adds a client-server boundary; this simulation adds four requests |
| Several compatible AI apps need the same tools | an adapter in each app | one server they can all reuse |
| Your own non-AI apps reuse the logic | a shared API client library | not needed for this |
| The workflow is always the same steps | a fixed workflow used fewer model calls and estimated text units in this simulation | not needed for this |

Your own apps can get that reuse from a shared API client library, without MCP. What MCP adds is that compatible AI apps you did not write can use the tools too.

Whichever route you pick, the tools page asks for a human in the loop who can deny tool calls, and confirmation prompts before sensitive operations. See [would an AI agent delete my files](/would-an-ai-agent-delete-my-files/) for that side.

## What this demo does not show {#limits}

This simulation did not test reuse across compatible hosts.

## Our take {#our-take}

If one AI app you control talks to one API, call the API: the demo needed 5 operations instead of 9. Add an MCP server when several compatible AI apps need the same tools, and reuse an initialized MCP session across tasks where the client and transport support it. Before either, ask whether the model needs to pick tools at all, because that choice cost more text than MCP did.

This article describes general patterns with a small simulation. It does not describe any company's private systems or measure any AI product. Numbers come from one run on 2026-11-15 with a scripted model.

## Frequently asked questions

**Do I need MCP if my app already has an API?**
Not for one AI app you control. The app can describe your API as tools and call it with its own code. MCP helps when several compatible AI apps should use the same tools, because they can reuse one MCP server after configuration and authorization.

**Does MCP call my API or does the AI?**
Neither the model nor MCP itself opens the connection. The model produces a tool-call request; the host app reads it and, through its MCP client, asks the MCP server, and the MCP server calls your API.

**Does MCP add latency to every tool call?**
Each tool invocation adds a tools/call exchange with the MCP server. This simulation measures no latency; real overhead depends on the transport, where the server runs and whether the session is reused. Initialization happens once per session. This demo lists tools once; real clients may request additional pages or refresh the list.

## Sources

- [Model Context Protocol specification 2025-06-18](https://modelcontextprotocol.io/specification/2025-06-18)
- [MCP 2025-06-18: Lifecycle (initialize, notifications/initialized)](https://modelcontextprotocol.io/specification/2025-06-18/basic/lifecycle)
- [MCP 2025-06-18: Tools (tools/list, tools/call, list_changed)](https://modelcontextprotocol.io/specification/2025-06-18/server/tools)
- [JSON-RPC 2.0 specification](https://www.jsonrpc.org/specification)
