By Fahad Murtaza · Published · Updated
MCP vs API: What Really Differs, With a WordPress Example
“MCP vs API” is a slightly unfair comparison, because MCP is a kind of API. The useful question is what changes when the caller is an AI model instead of a developer’s code, and when that change is worth having.
The short answer: a REST API is a contract between two programs whose authors read the same documentation. MCP is a contract between a system and an AI application that has never seen it before. Everything else follows from that. If MCP itself is new to you, start with what an MCP server is.
MCP vs REST API at a glance
| REST API | MCP | |
|---|---|---|
| Built for | Developers writing code | AI applications acting for a user |
| Discovery | Documentation, sometimes an OpenAPI file, read ahead of time | tools/list at runtime, on every connection |
| Unit of work | A resource at a URL, with an HTTP verb | A named tool with a description and input schema |
| Message format | HTTP requests, usually JSON bodies | JSON-RPC 2.0 over stdio or streamable HTTP |
| Connection | Stateless request and response | A connection that starts with an initialize handshake |
| Auth | Whatever the API chose: keys, Basic, OAuth | OAuth 2.1 based authorization is specified for HTTP; servers may accept other credentials |
| Errors | HTTP status codes, read by code | Protocol errors, plus tool results flagged as errors that the model reads |
| Who decides the next call | The programmer, in advance | The model, at the time |
What actually differs
The consumer
A REST API assumes a developer. Someone reads the reference, learns that prices live on one endpoint and stock on another, and writes code that makes exactly those calls forever.
MCP assumes a model. Nobody wrote code for this particular task. The model reads the tool list, forms a plan and makes calls it was never specifically programmed to make. That is why MCP tool definitions carry plain-language descriptions: they are documentation the caller reads at the moment of use.
Discovery and schemas
REST discovery happens outside the protocol. You find the docs, or an OpenAPI file if one exists. MCP builds discovery in: a client calls tools/list and gets every tool’s name, description and JSON Schema for input. Add a tool to the server and every client sees it on its next connection, with no client release.
Granularity
REST endpoints mirror data: a post, a product, an order. MCP tools tend to mirror tasks. A tool can be as narrow as “remove one block from a page” or as broad as “build a whole page from this spec”. Task-shaped tools matter because every extra round trip is another chance for a model to go wrong.
Sessions and auth
A REST call stands alone. An MCP connection begins with a handshake in which client and server agree on a protocol version and capabilities, and then stays open for a series of calls. For authorization, the MCP specification describes an OAuth 2.1 based flow for HTTP servers, which gives you per-client grants you can revoke. Many servers also accept a credential in a header. See MCP OAuth explained for the trade-offs.
Error handling
A script that gets an HTTP 400 stops or retries according to code someone wrote. A model that gets a failed tool result reads the message and tries to fix its own call. So MCP separates two cases: protocol errors (unknown tool, malformed request) and tool execution errors, which come back as a normal result marked isError with text the model can act on. Good MCP error messages say what to do next. Good REST errors say what went wrong.
When a plain API is the better choice
MCP is not an upgrade to REST. Use the API directly when:
- The task is fixed. A nightly stock sync, a form that creates a post, a mobile app. You know the calls in advance, so a model adds cost and uncertainty and nothing else.
- You need determinism. Code makes the same call every time. A model usually does, which is not the same thing.
- Volume is high. Reading tool definitions costs tokens on every conversation, and each decision takes model time. Ten thousand identical updates belong in a script.
- The caller is a browser or another service. REST has mature caching, tooling and client libraries everywhere.
MCP earns its place when a person describes an outcome in plain language and the steps are not known ahead of time.
The WordPress case: REST API vs MCP server
WordPress has shipped a REST API in core for years. It is solid and well documented, and you can absolutely point an AI at it. Here is the same job done both ways: set the regular price of WooCommerce product 118 to 24.00.
With the REST API
PUT https://your-site.com/wp-json/wc/v3/products/118
Authorization: Basic BASE64_OF_key:secret
Content-Type: application/json
{
"regular_price": "24.00"
}
That is clean, if the caller already knows the route, the auth scheme, that the price is a string, and that 118 is the right product. A developer knows those things. A model has to be told, through tool definitions somebody writes and maintains for each endpoint. The response is the full product object, and the old price is gone. WordPress revisions do not help here, because they track a post’s title, content and excerpt, not product data (more in WordPress revisions and undoing changes).
With a WordPress MCP server
With WP MCP installed, the client has already listed the tools and seen wpmcp-update-product with its schema. The model sends:
{
"jsonrpc": "2.0",
"id": 12,
"method": "tools/call",
"params": {
"name": "wpmcp-update-product",
"arguments": {
"id": 118,
"regular_price": "24.00"
}
}
}
The tool’s payload comes back as the updated product plus one extra field (trimmed here):
{
"id": 118,
"name": "Canvas tote",
"regular_price": "24.00",
"operation_id": "8c1d2e3f-4a5b-4c6d-8e7f-9a0b1c2d3e4f"
}
The write itself is the same WordPress and WooCommerce code either way, and the same permission checks apply: this tool requires a user who can manage WooCommerce. What differs is the wrapping. The model found the tool without custom glue, the input was validated against a schema, and the answer carries an operation_id.
What WP MCP adds on top
MCP as a protocol says nothing about undo. That part is the server’s job, and it is the reason WP MCP exists:
- Snapshot before every write. The product’s row, meta and terms are stored before the change is applied.
- An
operation_idon every write. It names that snapshot. - Rollback.
rollback-operationrestores one change,rollback-sessionunwinds a whole agent session, and a person can do the same with one click in wp-admin.
The free plugin keeps the last 20 operations by default, and Pro keeps unlimited history. A few actions cannot be snapshotted (a refund returns the status but not the money) and the tool response says so with recoverable: false.
The limits of MCP, stated plainly
- A model is still in the loop. It can pick the wrong product or misread a request. Schemas catch malformed input, not wrong intent. Rollback is the answer to that, not prevention.
- Tool lists cost tokens. With every ability enabled, the free plugin exposes 274 tools, and that full list runs to well over 100 KB of JSON. Compact mode cuts that to five dispatch tools at about 2 KB, at the price of an extra lookup step.
- Client support is uneven. Claude clients are the most tested path with WP MCP. Cursor works through the standard MCP config. ChatGPT needs OAuth switched on in
wp-config.phpand is not fully tested yet. - It is not a security boundary by itself. An agent can do whatever its WordPress user can do through the exposed tools. Use a dedicated user with a fitting role, and read MCP security for WordPress.
Next step
Keep the REST API for your scripts and integrations. For work you want to hand to an AI assistant, install the free plugin from /wordpress-mcp-plugin on a staging site and run one price change both ways. The difference shows up the first time you need to undo it.
If you want to build a server rather than use one, how to build an MCP server walks through the handshake and the WordPress route.
Common questions
Is MCP just an API?
MCP is a protocol built on JSON-RPC 2.0, so in the broad sense it is an API. The difference is the consumer: it is designed for AI applications that discover tools at runtime, where a REST API is designed for developers who read documentation and write code.
Does MCP replace REST APIs?
No. REST APIs remain the better fit for fixed integrations, scheduled jobs and front ends, and many MCP servers call a REST API internally. MCP adds a layer that lets an AI model find and use those capabilities without custom code.
What is the difference between MCP and a REST API?
A REST API exposes resources at fixed URLs and expects the caller to know them in advance. An MCP server exposes named tools with descriptions and input schemas that a client lists at runtime, so a model can choose the right one for a task.
Should I use the WordPress REST API or a WordPress MCP server?
Use the REST API when your own code makes known, repeatable calls. Use an MCP server when a person asks an AI assistant to work on the site in plain language and the steps are not known in advance.
Can an AI model use a REST API without MCP?
Yes, if someone writes the glue: tool definitions, authentication and error handling for each endpoint. MCP standardises that glue so it is written once, in the server, and works in every MCP client.
Is MCP slower than calling an API directly?
The protocol overhead is small, but a model in the loop adds time and token cost because it has to read tool definitions and decide what to call. For a fixed task a direct API call from a script is faster and cheaper.