AI & MCP
MCP vs REST: two interfaces for two different clients
MCP does not replace REST: one talks to a program that knows the schema, the other to a model that must discover it. Here is when each wins.
Key points
- REST assumes a known schema; MCP publishes it at runtime with tools/list and JSON Schema.
- Our backend has 210 REST route handlers and 9 MCP tools: different surfaces for different clients.
- MCP offers no HTTP cache and no standard pagination, so a read-heavy machine client stays on REST.
MCP does not replace REST: REST talks to a program that already knows the schema, MCP to a model that has to discover it. They are two interfaces for two clients, and the choice depends on who is calling.
What the caller sees
| Aspect | REST | MCP |
|---|---|---|
| Caller | a program with the schema already written | a model that must discover the tools |
| Contract | OpenAPI or docs, before the call | tools/list at runtime, with a JSON Schema per tool |
| Cache | ETag, Cache-Control, shared proxies | no standard HTTP semantics |
| Errors | HTTP status plus a JSON body | JSON-RPC codes, for example -32001 on an invalid token |
| Session | stateless per request | a session with protocolVersion and negotiated capabilities |
| Fixed cost per call | headers and URL | about 900 tokens of schemas, 3,655 bytes |
The same data, two calls
curl -s https://ui.eneawork.it/api/stats
curl -s https://ui.eneawork.it/mcp \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
The first call returns a JSON object you know in advance. The second returns a description of the available tools: name, description and input schema. A program can read the first; a model needs the second to decide whether and how to act.
The choice
- Caller in code: REST, because the schema is already in the code and HTTP cache does half the work.
- Caller that is a model: MCP, because discovery happens at runtime and the tool count stays small.
- Read-heavy work: REST, for ETag, pagination and shared proxies that MCP does not define.
- A single repeatable action: MCP, with a narrow schema the model can read in a few hundred tokens.
Why 210 against 9
The two surfaces do not compete: 210 route handlers cover pages, sitemaps, registry, accounts and webhooks, and no model would read all of them. The 9 MCP tools are a selection built to fit in context: search_components, get_component, search_blocks, get_block, get_design_system, list_design_systems, compose_page, list_categories and get_page, checked on 1 November 2026.
The limitation
MCP has no HTTP cache, no standard pagination and no shared way to express a cost per call. Our endpoint is read-only and asks for an OAuth token for quota, while /api/stats answers anonymously: two different authentication stories over the same catalogue. A machine client reading thousands of records should stay on REST.
Where to continue
The protocol is explained in what MCP is, tool design in designing an MCP tool and the authorization flow in OAuth for MCP servers. For the comparison between two ways of exposing the same logic read Route Handlers vs Server Actions. The catalogue behind both interfaces is 111,985 components and 1,556 blocks; a citable record is shadcn sidebar.
Frequently asked questions
Will MCP replace REST APIs?
No. MCP is a discovery and call layer for a model, and underneath it can have a REST API. The two coexist: the same company exposes REST to programs and MCP to agents.
Can I use MCP without HTTP?
Yes. The stdio transport starts a local process and needs no authentication, while Streamable HTTP serves a remote endpoint. The protocol stays JSON-RPC 2.0 in both cases.
How many tokens does an MCP schema cost?
In our case 3,655 bytes for nine tools, about 900 tokens at four characters per token, measured on 1 November 2026. With fifty tools the fixed cost becomes the main problem.
Why is your MCP endpoint read-only?
Because a catalogue should not write to the user's repository from a remote endpoint. Writes stay on the client, which holds the code locally and can show the diff before applying it.
Can an agent call the REST routes directly?
It can, if you hand it a list of URLs and a format. It loses runtime discovery, though, and the schema cost moves into the prompt, which is exactly what MCP takes off the prompt.