# When to use MCP instead of an API

> Use REST when your code decides the next call and MCP when a model does. On MCP the tool description is the whole contract, so it has to be exactly true.

Source: https://mosaicbrowser.com/blog/do-you-need-mcp-if-you-have-an-api

## We have a REST API and an MCP server, and they do different jobs

Use REST when your code decides the next call and MCP when a model does. On MCP the tool description is the whole contract, so it has to be exactly true.

![REST API versus MCP, each name in its own tile: Code reads the reference, a model reads the tool](https://mosaicbrowser.com/covers/do-you-need-mcp-if-you-have-an-api.webp)

Use a REST API when your own code decides which call comes next, and MCP when a model decides. That is the whole rule we use for the two automation surfaces in Mosaic. REST is for code written by someone who read the reference and can test what they wrote. MCP is for a model that cannot read the reference or the source, and has nothing but each tool's name, its input schema and its description. So on MCP the description is the contract, and every sentence in it has to be exactly true.

Both surfaces are on Pro, and both talk to the same store the window uses. As of 2 November 2026 that was 181 documented REST routes and 156 MCP tools.

## REST: for code someone wrote and tested

A REST caller is a script, a cron job, a test suite, a local n8n workflow. A person wrote it with the reference open. They know that `POST /profiles/:id/start` returns a DevTools endpoint, and they hand that endpoint to Puppeteer or Playwright, which do the rest. When something goes wrong they read the status code and the error, change a line and run it again.

That person can also read between the lines. If a field is described loosely, they try it, see what comes back and adjust. A REST API with a vague sentence in its docs is an annoyance, not a dead end, because the caller has other ways to find out.

What REST has to get right is mostly mechanical: one validator every route goes through, an unknown field refused by name, a 4xx written for the caller and a 500 only for our own bugs. Those rules are the same on both surfaces, and [the local API guide](https://mosaicbrowser.com/guides/anti-detect-browser-local-api) covers what a local API in this kind of browser should do.

Mosaic is a desktop app

Email yourself the link and open it on your computer.

[How it works: MCP server](https://mosaicbrowser.com/features/mcp-server)

## MCP: for a model that only has the description

An MCP caller is Claude or another assistant, deciding in the middle of a conversation which of 156 tools to call. It has never seen our source and will not open the reference. It reads the tool list the server hands it and acts on it, literally.

That changes what a mistake in the text costs. When we audited the 47 tools the server had at the time against what the code did, three descriptions were wrong:

- `update_profile` offered `archived: bool`, "Archive or restore". No such field existed anywhere in the product. The handler spread it into the update, so an assistant archived nothing and was told it worked.
- `delete_profile` said "Irreversible — stop it first if running". The store has always moved a profile to the trash. An assistant reading that would refuse the safe operation and reach for something worse.
- `list_devices`, and `create_profile` with it, said the platform was "windows, macos or linux", so a model could not make an Android profile through MCP at all, on a product whose Mobile library has its own place in the sidebar.

A person using REST would have found the first by reading the profile back, ignored the second and noticed the third on the Mobile page. A model has none of those routes. A wrong sentence in a tool description is a capability that does not exist, or one that exists and is refused.

## What each surface has to get right

Because the reader is different, the checks are different.

On REST, `check:api` holds that every route is documented, and the behaviour check sends malformed requests to a running app and fails if any of them gets a success.

On MCP, the check that matters reads the schema the model reads. `check:mcp-reach` calls each tool with field names taken from its own `inputSchema.properties`, because that schema is the thing under test. Its first version used a hand-written list of names and passed, while `update_proxy` advertised a `label` field whose real name is `name`: a model doing exactly what the tool said got a 400 for it.

The descriptions themselves got longer, and that was deliberate. `delete_profile` now says that it moves the profile to the trash, that `restore_from_trash` brings it back whole, which call actually destroys data, and that it once said "Irreversible" and was wrong. The errors changed too. "No project with id … Call list_projects for the ids" names the next tool to call, because a model cannot ask what was meant.

The last check is that the two surfaces cover the same ground. The first time `check:surface-parity` ran, it counted 175 REST routes against 122 MCP tools, and the gaps were not obscure: a profile's cookie jar had no tool at all. Every route now maps to a tool, or carries a reason it cannot exist on a tool surface, such as a live event stream.

## When to use MCP instead of the API

If you can write the steps down in advance, write them against REST. You get a DevTools endpoint for Puppeteer or Playwright, status codes, and a script you can run again tomorrow and get the same result.

If the steps depend on what the model finds, such as "open the client's dashboard, read what is overdue, then fill in the form", give it MCP. The server starts switched off and every call needs an API key, because these tools start browsers that are signed in to real accounts. The [MCP server page](https://mosaicbrowser.com/features/mcp-server) has the client config, and [what we fixed after a model first drove the tools](https://mosaicbrowser.com/blog/ai-assistant-runs-profiles) covers three faults the first real sessions turned up.

The two also combine: a script can create forty profiles over REST at night, and an assistant can work inside one of them the next morning over MCP. They reach the same profiles, because underneath there is only one store.

## Questions

### When should I use MCP instead of a REST API?

When the caller is a model that decides at run time which call to make next. If you are writing the sequence of calls yourself in code, a REST API is simpler, easier to test and easier to debug.

### Does MCP replace a REST API?

No. In Mosaic both are doors into the same store, so a profile made over MCP is the same as one made over REST or in the window. MCP adds a way for a model to discover what it can do; it does not add capabilities.

### Is MCP slower than calling the API directly?

The call itself is similar, since both are local HTTP. The cost is in the model: it reads every tool description and decides between calls, which takes tokens and time a script does not spend.

### Can I use Puppeteer or Playwright with Mosaic's MCP server?

Use the REST API for that. Starting a profile returns a DevTools endpoint that Puppeteer and Playwright attach to. MCP has its own page tools, for a model that reads the page and clicks on it.

## Related

[An anti-detect browser MCP server for your AI assistant](https://mosaicbrowser.com/features/mcp-server): Mosaic's anti-detect browser MCP server lets Claude or any MCP client create, launch and drive your profiles. 150+ tools, off by default, key-gated.

[Anti-detect browser REST API: profiles from your scripts](https://mosaicbrowser.com/features/rest-api): Mosaic's anti-detect browser REST API runs on 127.0.0.1 with API keys. Create and start profiles, then attach Puppeteer or Playwright over CDP.

[MCP server for browser automation: what it is and which to use](https://mosaicbrowser.com/guides/mcp-server-for-browser-automation): An MCP server for browser automation turns page actions into tools an AI assistant can call. Playwright MCP, Chrome DevTools MCP and Mosaic compared.

[Letting an AI assistant run browser profiles over MCP](https://mosaicbrowser.com/blog/ai-assistant-runs-profiles): Mosaic's MCP server lets Claude or any MCP client create, start and drive browser profiles. Three faults we found when a model was the caller.

[Anti-detect browser local API: what it is and what to check](https://mosaicbrowser.com/guides/anti-detect-browser-local-api): An anti-detect browser local API is an HTTP server on 127.0.0.1 that creates, starts and stops profiles and hands your script a DevTools endpoint.







[A regex that lost its backslashes inside a template literal](https://mosaicbrowser.com/blog/regex-in-template-literal): A template literal turns \s into s, so a regex shipped inside one matches nothing and throws nothing. It hid five of our detector rows as unread.

## Mosaic, on your own computer

The browser this blog is about: its own Chromium, fingerprints from real machines and a proxy IP per profile. Free covers 3 profiles with no card, and Pro is $25 a month for any number of them.

Mosaic is a desktop app

Email yourself the link and open it on your computer.
