AI agents and MCP · 10 min read
MCP vs REST API: Differences and When to Use Each
Keep the REST API for developers and add an MCP server when AI applications need to use the system. A short decision table, the differences in discovery, errors and transport, a worked example and a design checklist.
By The Vexio team Published Updated
MCP vs REST API: the verdict
MCP vs REST API is not a contest. Keep the REST API for the developers and integrations that already use it, and add an MCP server when AI applications need to use the same system. In practice the MCP server usually sits in front of the API and reshapes it for a model.
| If this is true | Use |
|---|---|
| A developer writes the code that calls your system | REST API |
| An AI assistant or agent should discover and use your system | MCP server, usually built on the API |
| Several AI hosts should reuse one integration | MCP server |
| You move bulk data between systems | REST API or a pipeline |
| Third parties who are not AI hosts need a stable contract | REST API |
The rest of this page explains what separates the two, with one worked example, and how to decide when the answer is “both”. The protocol facts were checked on 2026-10-14 against MCP specification revision 2026-07-28.
What is a REST API, and what is MCP?
REST stands for Representational State Transfer. Roy Fielding’s dissertation describes it as a set of architectural constraints: client-server separation, statelessness, cacheable responses, a uniform interface and layered systems, with code-on-demand as an optional extra. In everyday use, “REST API” means an HTTP API organised around resources, with methods such as GET and POST acting on URLs. MDN notes that people call HTTP APIs RESTful even when they do not meet every constraint, so expect the term to be used loosely.
OpenAPI is the common way to describe such an API. It is a language-agnostic interface description for HTTP APIs, so people and software can understand a service without reading its source code.
MCP, the Model Context Protocol, is an open standard for connecting AI applications to external systems. An AI application (the host, through a client component) connects to a server and discovers up to three kinds of things: tools the model can call, resources it can read and prompts users can invoke. Messages use JSON-RPC 2.0 and travel over a local stdio connection or over Streamable HTTP.
Streamable HTTP means MCP can itself run over HTTP, so the difference is not “HTTP versus something else”. It is what travels over the connection and who is expected to understand it. A REST API exposes many URLs, one per resource. An MCP server exposes a single endpoint, and the operation is named in the JSON-RPC message body. The specification also requires the client to mirror the method and tool name into Mcp-Method and Mcp-Name headers so gateways can route without parsing the body.
MCP vs API: the differences that matter
| Question | Typical REST API | MCP server |
|---|---|---|
| Who writes the caller? | A developer, ahead of time, from documentation or an OpenAPI file | An AI host that discovers capabilities at run time |
| How is it discovered? | Read documentation; generate a client from a spec | The client asks with tools/list and gets names, descriptions and input schemas |
| Unit of design | A resource, addressed by URL, acted on with HTTP methods | A tool: a named operation with typed inputs |
| Message format | Whatever the API defines, commonly JSON over HTTP | JSON-RPC 2.0 messages |
| Who decides to call it? | The application code | The model, with a human able to deny the call, as the specification recommends |
| What does a failure look like? | An HTTP status code and a body | A tool result with isError: true that the model can read, plus JSON-RPC errors for protocol problems |
| Transport | HTTP | stdio for local servers, Streamable HTTP for remote ones |
Two rows deserve a closer look.
Discovery at run time
With a REST API, knowledge of the endpoints lives in the developer’s head and in the code they wrote. If the API changes, someone updates the client. With MCP, the client asks the server what tools exist, and the descriptions in the answer are what the model reads to decide what to do. List responses carry cache hints (ttlMs), and a server can notify clients that opt in when its tool list changes.
This is the heart of the difference. An MCP tool description is written for a model as its reader, and its quality affects behaviour directly. An API reference is written for a developer, who can read around ambiguity and ask a colleague.
Errors the model can act on
In a tool call, a failure such as an invalid date or a missing record comes back as a normal result flagged isError: true, with a message the model can use to correct itself and retry. The specification contrasts these tool execution errors with protocol errors, such as an unknown tool or a malformed request, which are standard JSON-RPC errors. Writing the message so it says what to fix is real design work.
One capability, two interfaces
Suppose an order service has this endpoint:
GET /orders/A-1001
A developer’s integration knows the path, the authentication scheme and the response shape. In MCP the same capability is advertised as a tool, and the call looks like this. The _meta fields the protocol requires on every request are left out for brevity:
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "get-order-status",
"arguments": { "orderId": "A-1001" }
}
}
The MCP server receives the call, makes the REST request to the order service with credentials it holds, and returns the result as content. The API did not go away. The MCP server is an adapter between a model-facing protocol and the system-facing API.
Should you wrap every endpoint as an MCP tool?
Usually not. Generating one tool per REST endpoint is quick and often disappoints. Many fine-grained tools with overlapping descriptions give the model more to choose between and more room to choose wrongly. Tool definitions also cost tokens: Anthropic’s tool use documentation lists the names, descriptions and schemas in the tools parameter among the input tokens a request is billed for. None of the sources listed below measures how tool count affects accuracy, so treat “fewer, clearer tools” as a design heuristic to test on your own tasks.
Anthropic’s engineering guidance on building agents makes the general point that tool definitions deserve as much prompt engineering as the prompts themselves: clear boundaries from other tools, example usage, and arguments changed so mistakes are harder to make. For an MCP server that means designing around tasks rather than endpoints. “Get the status of an order” may be one tool even if it takes three API calls behind the scenes. A “list everything” tool that returns a large payload puts a lot of text in front of the model, so paginate or filter it.
When is MCP the right layer?
Add an MCP server when:
- you want AI assistants to use a system, and more than one assistant or host may be involved;
- the useful operations fit a handful of clear tasks;
- you want one place to apply access control, logging and approval rules for AI-initiated actions;
- you want people to connect their own tools without custom integration work on your side.
Model providers also let you define tools directly in a request, as Anthropic’s Messages API does. MCP is not the only way to give a model tools. It is a standard for packaging them so they work across hosts instead of being redefined in each application. If you only ever target one model API and one application, direct tool definitions are a legitimate choice.
When is a plain REST API enough?
Stay with the API when:
- one application you control will call the system, and a developer writes that code;
- you move bulk data, such as syncing a large dataset, where a model deciding each step adds nothing;
- third parties who are not AI hosts need a stable public contract;
- the operation is deterministic and always runs the same way, which is a job for a script or scheduled pipeline.
Building and hardening the API is custom software work in its own right, and a good MCP server depends on it.
What changes for security?
Moving from an API to an MCP server does not remove the API’s own controls. It adds a second layer.
- Identity. Decide who the server acts as. For HTTP servers the specification describes OAuth-based authorization in which the MCP server is a resource server that must accept only tokens issued for it. The security guidance explicitly forbids token passthrough, where a server forwards a token it received to another API.
- Least privilege. The security guidance recommends a minimal initial scope set, with elevation only when a privileged operation is first attempted.
- Write actions. Make destructive tools previewable. The specification says there should be a human with the ability to deny tool invocations.
- Validation and limits. Servers must validate all tool inputs, apply access controls, rate limit invocations and sanitise outputs, whatever the API behind them already does.
- Audit. Log which tool was called, with what arguments, for whom.
A checklist before you design the MCP layer
- Does an AI application need to use this system? If not, stop at the API.
- Is there already a good API? If yes, plan the MCP server as an adapter on top of it.
- Can you name the five or ten tasks people actually want? Design tools for those, not for every endpoint.
- Who does the server act as, and what can it never do?
- Which actions change data, and how will they be previewed or approved?
- Will it run locally over stdio, or remotely over Streamable HTTP with authorization?
For the background, read what an MCP server is. To see how small a working server is, follow the TypeScript tutorial. If the MCP layer is one part of a larger assistant, custom AI agent projects describes what drives their scope, and how to choose an AI agent development company covers vendor questions.
Getting an MCP layer built
Vexio builds MCP servers on top of existing APIs and databases as custom engagements: tools designed around tasks, a scoped identity, dry-run defaults for writes and an audit log. The MCP server development page explains how a project is scoped. To discuss your own API, ask for a demo or a call.
Sources
Checked on 2026-10-14.
- Roy T. Fielding, “Architectural Styles and the Design of Network-based Software Architectures”, chapter 5 (REST constraints): https://ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm
- MDN Web Docs, “REST” glossary entry (loose use of “RESTful”): https://developer.mozilla.org/en-US/docs/Glossary/REST
- OpenAPI Initiative, OpenAPI Specification (interface description for HTTP APIs): https://spec.openapis.org/oas/latest.html
- JSON-RPC 2.0 specification: https://www.jsonrpc.org/specification
- Model Context Protocol, “Architecture overview” (primitives, transports, discovery, notifications): https://modelcontextprotocol.io/docs/learn/architecture
- MCP specification (revision 2026-07-28), Tools (tools/list, tools/call, errors, security obligations): https://modelcontextprotocol.io/specification/2026-07-28/server/tools
- MCP specification, Streamable HTTP (single endpoint, Mcp-Method and Mcp-Name headers): https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http
- MCP specification, Authorization (resource server role, token audience): https://modelcontextprotocol.io/specification/2026-07-28/basic/authorization
- Model Context Protocol, “Security best practices” (token passthrough, scope minimization): https://modelcontextprotocol.io/docs/tutorials/security/security_best_practices
- Anthropic Engineering, “Building effective agents” (tool design): https://www.anthropic.com/engineering/building-effective-agents
- Anthropic, “Tool use with Claude” (tool definitions in requests, token cost): https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview