MCP vs API: What Changes When You Test Them (We Ran Both)

Hands-on testedAI security
Quick answer

an API is built for programs; MCP (Model Context Protocol) is built for AI agents, and it usually sits on top of an API. For testers the big difference is not speed. We exposed the same small service both ways and ran the same tests. On MCP, every failed call came back as HTTP 200 with an isError flag, and renaming one argument broke every old MCP call while the old REST client kept working. MCP also sent about 15 times more request bytes. So on MCP, assert the isError flag, not the status code, and snapshot the tool list in CI.

What is the difference between MCP and an API?

An API (here a REST API) is a contract for programs: fixed URLs, HTTP methods, status codes and a schema such as OpenAPI. A developer reads the docs and writes the call.

MCP is a protocol for AI applications. A server publishes a list of tools with names, descriptions and input schemas. An AI agent reads that list, decides which tool to call and sends a JSON-RPC message. Many MCP servers are thin wrappers around an existing API, so you often have both.

Most MCP vs API articles stop at that explanation. We wanted to know what changes for the person who has to test it, so we built both and ran the same checks.

How we tested

  • One small notes service (add, search and delete notes) with the same Python code behind both interfaces.
  • REST version: FastAPI 0.121.0 on uvicorn 0.54.0.
  • MCP version: the official MCP Python SDK 2.3.0, Streamable HTTP transport, default settings. The client and server agreed on protocol version 2026-07-28.
  • Both servers ran on one Linux machine (Python 3.13) on 127.0.0.1, wrapped by the same counter that logged every HTTP request, its status and its body size.
  • Same scenario on both: add 3 notes, search, delete, delete a missing note, empty title, wrong type, missing argument, and (MCP only) an unknown tool. We ran it 5 times with fresh servers.
  • No AI model, no API keys, cost $0. Request counts, bytes and status codes were identical in all 5 runs.

The full kit is on GitHub, so you can run it yourself (link at the end).

MCP vs API at a glance (what we measured)

What we checkedREST APIMCP server
Discovery documentOpenAPI: 2,147 bytes, 3 operationstools/list: 1,157 bytes, 3 tools
HTTP status of a failed call404 or 422Always 200 (error flag in the body)
Old client after renaming one argumentStill workedEvery call failed
HTTP requests for the scenario1012
Request body bytes for the scenario2283,511
Response body bytes for the scenario2,8354,820
Warm call, median of 5 runs (local)1.68 ms3.05 ms
First call with a new client (median)13.1 ms21.7 ms
Callable with curl or Postman aloneYesNo: 400 “Missing session ID”

1. MCP tool errors come back as HTTP 200

This is the finding that matters most for testers. Every failure on the REST side had its own status code. On MCP, all 12 requests in the scenario returned HTTP 200, including the five that failed.

CaseREST APIMCP
Delete a note that does not exist404 “note 99 not found”200, isError true, “Error executing tool delete_note: note 99 not found”
Empty title422 “title must not be empty”200, isError true, same message with the prefix
Text instead of a number422 “Input should be a valid integer”200, isError true, full validation report
Missing argument422 “Field required”200, isError true, full validation report
Unknown tool(no such case)200, isError true, “Unknown tool: no_such_tool”

This is how the protocol is designed. The MCP specification reports tool failures as tool execution errors: a normal result with isError: true, so the AI model can read the message and try again. Input validation errors were moved into that group on purpose (SEP-1303). Here is the raw response for the wrong-type call, shortened:

HTTP/1.1 200 OK
{"jsonrpc":"2.0","id":3,"result":{"content":[{"type":"text",
 "text":"Error executing tool delete_note: 1 validation error for delete_noteArguments ..."}],
 "isError":true}}

What it means for you: an uptime monitor, an API test tool or a CI check that treats “HTTP 200 = pass” will pass every broken MCP call. Assert isError and the message text on every call.

One detail did not match the specification. The 2026-07-28 spec lists “Unknown tool” as a protocol error, sent as a JSON-RPC error object. In our run, Python SDK 2.3.0 with default settings returned it as a normal result with isError: true. We only tested this SDK, so check what your own server does.

2. Renaming one argument broke MCP callers, not REST callers

We renamed the delete argument from note_id to id on both servers and replayed the old client.

  • REST: the old client still worked (200, note deleted). A path parameter name never travels on the wire; the URL /notes/1 looks the same.
  • MCP: the old call failed: Field required ... id, input {'note_id': 1}. Still HTTP 200.
  • Both discovery documents changed (the OpenAPI path and the tool’s required arguments), so a snapshot test caught the change on both sides.

On MCP, argument names are the contract an agent sends. Treat any rename as a breaking change, and keep a snapshot of tools/list in CI. We showed how in our MCP testing guide.

3. Error messages are written for a model, so check what they leak

Because the model reads MCP errors, the text is part of what you ship. Our own error messages arrived with an “Error executing tool <name>:” prefix. The validation errors went further: they included the internal model name delete_noteArguments, the rejected input and a link to the validation library’s documentation.

That is useful for an agent that needs to retry. It also tells anyone probing your server how it is built. Add error text to your review list, next to the checks in our AI agent and MCP security test.

4. MCP sends much more data per request

For the same scenario, MCP sent 3,511 request bytes against 228 for the REST API. Three things explain it, and all three are in the specification:

  • In protocol version 2026-07-28, every request must carry a _meta block (protocol version, client name, client capabilities). We saw it in every captured request.
  • Every call is a JSON-RPC message posted to one URL, so even a search is a POST with a body.
  • A brand-new client made 3 requests for its first tool call: discovery, tools/list (the client fetched it by itself) and the call.

Responses were bigger too (4,820 vs 2,835 bytes), because each result came back twice: as text and as structured JSON. The spec recommends that for backwards compatibility.

The tool list itself was small here (1,157 bytes, roughly 290 tokens by a rough 4-bytes-per-token estimate; we did not run a tokenizer). In a real server with dozens of tools this list goes into the model’s context on every session, so measure it per release.

5. Speed: MCP was slower, but this is not a benchmark

On one machine over loopback, a warm call took a median of 3.05 ms on MCP and 1.68 ms on the REST API (100 calls per run, 5 runs). The first call with a new client took 21.7 ms vs 13.1 ms. Real networks, real tools and real models will add far more than this gap, so treat the numbers as direction only.

6. You cannot test an MCP server with curl or Postman alone

We sent a plain tools/call request, the way you would from curl or Postman. The server answered 400 “Bad Request: Missing session ID”. You need an MCP-aware client: the official SDK, or MCP Inspector, which can also run from a CI script. Both are covered in our MCP testing guide.

MCP vs API: which one should you test, and how?

Usually both. If an MCP server wraps your API, keep your normal API tests for the business logic (see our API testing tools). Then add a thin MCP layer of tests for what is new: the tool list, argument names, error flags and error text. MCP does not replace the API; it is another contract on top of it.

Checklist for an MCP server, based on what failed or surprised us:

  1. Assert isError and the message on every tool call. Never rely on the HTTP status.
  2. Snapshot tools/list (names, argument names, descriptions) and fail the build on any change you did not approve.
  3. Treat an argument rename as a breaking change; version the tool or keep the old name.
  4. Read the error text an agent will see. Remove internal names and stack details.
  5. Measure the size of tools/list per release; it costs context on every session.
  6. Test with an MCP client (SDK or Inspector), not just curl.

For the security side (hidden instructions in tool descriptions, data leaks through tools), see our AI security testing guide and the tools in AI red teaming tools.

What we did not test

  • The stdio transport (covered in our MCP testing guide), the older SSE transport, and the SDK’s stateless and JSON-response modes.
  • Authentication and OAuth.
  • Real AI clients and real token counts.
  • Other SDKs (TypeScript and others) and other API styles (GraphQL, gRPC).
  • Load, concurrency and real network latency.

Get the code

Everything above is in our test kit on GitHub: aitg-test-kits/mcp-vs-api. It starts both servers on your machine, runs the scenario, and writes the results as JSON. A second script runs the rename test.

FAQ

What is the difference between MCP and an API?

An API is a contract for programs: URLs, methods, status codes and a schema. MCP is a protocol for AI agents: a server lists tools with descriptions and input schemas, and an agent chooses and calls them through JSON-RPC. Many MCP servers wrap an existing API.

Does MCP replace APIs?

No. In most setups the MCP server calls an API underneath. MCP adds a layer that AI agents can discover and use. You still need the API and its tests.

Why does an MCP error return HTTP 200?

Because tool failures are reported inside the result with isError set to true, so the AI model can read the message and retry. In our test, all five failed calls returned HTTP 200. Check isError, not the status code.

Is MCP slower than a REST API?

In our local test, yes: a median of 3.05 ms per warm call against 1.68 ms, and 21.7 ms against 13.1 ms for a first call. That gap is small next to real network and model time, and we did not test a real network.

How do I test an MCP server?

Use an MCP client such as the official SDK or MCP Inspector. Assert isError and the message on every call, snapshot the tool list in CI, and review the error text the model will see.

Sources

Was this helpful?Suggest an edit
Zain Ul Rehman
Zain Ul Rehman

QA Automation Engineer, Founder of AI Testing Guide. Each guide says what I ran myself and what I only researched, and I update it when things change. About me

Get new hands-on tests by email

A short email when we publish a new hands-on test, plus our free LLM attack test set. No spam.

Free. Confirm by email, unsubscribe in one click. Privacy

Scroll to Top