-
Notifications
You must be signed in to change notification settings - Fork 4.7k
model context protocol vs api vs rag
MCP is not an alternative to an API. It is usually a thin layer on top of the API you already have, aimed at a model instead of at a developer. So the real question is never which to use; it is whether the layer is worth its price, and the price is a number almost nobody publishes.
This page answers that first, with ours measured. RAG comes after, because it is the other comparison people pair with this one and it is a category error in a different direction: RAG does something MCP does not do at all.
An API is how two programs talk. MCP is how a model is told what it can do and then does it.
In practice an MCP server is very often a thin wrapper over an API you already have. The server declares each capability as a tool with a JSON Schema for its inputs, the model reads those declarations and chooses when to call one, and the server turns that call into the API request it was always going to make.
What MCP adds on top of the API, and why the wrapper is not pointless:
-
Discovery the model can read.
tools/listreturns the capabilities with their schemas. Your API's OpenAPI document is for developers; this is for a model at runtime. - One connection shape across every capability. Files, databases, browsers and issue trackers arrive through the same client, so the assistant does not need bespoke integration per service.
- A place for oversight. Approval prompts, permission settings and activity logs sit at this layer rather than in each API client.
Every comparison of these two skips the price, so here is ours. A tool is not free to declare: its name, its description and the JSON schema for its arguments are sent to the model on every turn, for the life of every session. Not once at registration. Every turn.
Enumerated from this project's own browser server on 2026-09-13 and counted with a tokenizer rather than a characters-per-token rule of thumb: 16 tools, 8,040 characters of description, 3,141 tokens on every single turn. A forty-turn session spends around 128,000 tokens restating what the tools are, before a page has been read.
Call the same API from your own code and that number is zero. Call it through provider-native function calling, where you send the schemas yourself, and you pay the same per-turn bill but keep control of exactly which ones and when. How many MCP tools is too many is that arithmetic in full.
Does a model need to choose whether to call this? If your own code decides, you want the API and nothing else. A protocol whose product is discoverability is pure overhead when nothing is discovering.
Does somebody else's assistant need to find it? This is the one MCP answers and function calling does not. An MCP server can be registered by a client you did not write, in an application you have never seen. If both ends are yours, you are paying a per-turn bill for a registry with one entry in it, and MCP alternatives works through what to use instead.
Two yeses and the wrapper is worth writing. One yes and it is usually a function call with extra steps.
These solve different halves of the same sentence. RAG gets information in front of a model. MCP lets the model act, and also lets an application attach information.
The overlap is real but partial, and the protocol itself draws the line: its three primitives are tools, resources and prompts, and it is resources that look like retrieval - read-only data behind a URI, pulled in by the application as context. MCP tools, resources and prompts has the full split.
The differences that decide it:
| RAG | MCP resources | |
|---|---|---|
| Selection | embeddings or search over a corpus | the application picks a URI |
| Freshness | as fresh as the last index build | read at request time |
| Scale | designed for large corpora | designed for specific known things |
| Can it act? | no | tools can, resources cannot |
Use RAG when the question is "which of these ten thousand documents is relevant". Use MCP resources when the answer is a specific known thing: this file, this calendar, this schema. Use both when the model needs to find something and then do something about it, which is the common real case.
- MCP vs an API: not competitors. MCP is usually a model-facing layer over an API, and it bills you per turn for the discovery it adds - 3,141 tokens on ours, every turn, forever.
- MCP vs RAG: not competitors. RAG retrieves at scale; MCP acts, and attaches known context.
- If nothing in your system is a model choosing what to do next, you probably need neither.
Does MCP replace REST APIs? No. It typically wraps one so a model can discover and call it.
Is MCP better than RAG? They answer different questions. RAG finds relevant text in a large corpus; MCP lets a model take actions and lets an app attach specific context.
Can MCP do retrieval? Resources are read-only data by URI, which covers "fetch this known thing". It is not a substitute for search over a large corpus.
Do I need an MCP server for my own API? Only if a model, rather than your code, should decide when to call it.
Is MCP just function calling with extra steps? Function calling is the model-side mechanism; MCP is the transport and discovery standard that lets any client talk to any server without bespoke wiring. When both ends are yours, that discovery is a registry with one entry in it, which is the case MCP alternatives makes with the measured cost attached.
See also: how to choose among MCP servers, and MCP tools, resources and prompts.
-
Understanding MCP servers, the protocol's own documentation, retrieved 2026-09-11: the three primitives,
tools/listand its schemas, resources as read-only URIs retrieved by the application, and the oversight mechanisms described above.
Written while maintaining an MCP server. The section that says you do not need MCP when your own code calls your own API is the one to check us on, and it is in the middle of the page rather than the footnotes.
- OpenAI Operator alternatives
- Open-source Operator-style agents
- Is OpenAI Operator still available?
- OpenAI Operator vs Claude computer use
- browser-use alternatives
- Choosing an AI browser agent
- Open-source AI browser agents
- Open-source computer-use agents
- What is an AI web agent?
- AI browser agents vs traditional scraping
- Cloud browser infrastructure for AI agents, explained
- Browserbase alternatives
- Firecrawl vs an AI browser agent
- Skyvern alternatives
- Stagehand vs browser-use
- Project Mariner is gone: what replaced it
- Manus alternatives
- Gemini computer use vs Claude computer use
- AIHawk, reviewed honestly by its own wiki
- AI browser vs AI browser agent: which one do you want?
- AI browser agent vs RPA: which one fits the job
- AI browser agent vs n8n, Zapier and Make
- Vercel agent-browser alternatives, compared honestly
- What is an agentic browser? Definition and the two kinds
- Open-source agentic browsers: the three layers, compared
- Choosing an MCP server for browser automation: four axes
- Stealth MCP servers compared: Camoufox, nodriver, Patchright
- Playwright MCP alternatives, and the three you don't need
- Autonomous browser agents: the four rungs of autonomy
- What is actually free in the AI browser agent stack
- browser-use on GitHub: what the repo actually gives you
- Playwright MCP vs Chrome DevTools MCP: different jobs
- How to choose among MCP servers: a map by category
- Which MCP servers are worth adding to Claude Code
- MCP on GitHub: finding servers and judging them fast
- MCP vs an API: the decision, and what the wrapper costs
- MCP alternatives: when the protocol is the wrong shape
- Why does my AI agent get blocked?
- The timing signal AI agents give off
- Agent retry loops trip rate limits, not fingerprints
- Claude computer use detected as a bot
- browser-use getting blocked: what you can and cannot change
- Playwright MCP session blocked: four causes, four fixes
- Playwright MCP and captchas: what actually gets you past
- Cloudflare and a browser MCP server: what is being read
- Can an AI agent solve a captcha? The honest answer
- Getting an AI agent to fill out forms
- Which model to use with AIHawk
- Browser problem or model problem?
- Running AIHawk's browser from Claude Code
- Extracting data to a CSV with an AI agent
- Monitoring a page for changes with an AI agent
- Running AIHawk's browser from Claude Desktop
- Running AIHawk's browser from Cursor
- Using an AI agent to hunt for apartments
- Getting website data into Google Sheets with an AI agent
- Using an AI agent to download invoices from portals
- AI agents for web research
- Using an AI agent to test your own website
- Running AIHawk's browser from Cline
- Posting to social media with an AI agent
- Posting to Facebook with an AI agent
- Posting to Instagram with an AI agent
- Posting to X with an AI agent
- Automating LinkedIn posts: read this first
- Appointment bots: what they are and what an agent can legitimately do
- Track prices across sites with an AI agent
- Build a lead list with an AI browser agent
- Run an AI browser agent on a schedule
- AI browser agent with a local LLM: what changes
- Should you log your AI agent into your accounts?
- How to write a task an AI browser agent can follow
- Move data between two web apps with an AI agent
- The MCP server
- How the tools are shaped, and why
- Playwright MCP vs the Playwright CLI: which fits when
- Playwright MCP: browser is already in use, and the fix
- Playwright MCP best practices: four decisions that matter
- Playwright MCP with a proxy, and the three leaks it leaves
- A browser MCP server in GitHub Copilot: setup and limits
- Using a browser MCP server for web scraping: the pattern
- Which LLM for browser automation: the four properties
- How to build a browser agent, and what to take instead
- Getting an AI agent to log into a website: three routes
- MCP tools, resources and prompts: who controls each
- How many MCP tools is too many? The context arithmetic
- How to build an MCP server: the decisions, not the scaffold
- Local or remote MCP server: what changes, and what does not
- Writing an MCP client in Python: the thirty-line version
- Self-hosted AI agent: what one actually costs to run
- How long an AI browser agent takes per step, measured
- Text, HTML, snapshot or screenshot: what the agent should read
- Giving an AI browser agent a stopping condition
- Keeping an AI browser agent out of destructive actions
- Why did the AI agent click the wrong thing
- When the page changes under the AI agent
- Running one AI agent task across a list of sites
- Seeing a page as it appears in another country
- Getting data out of a dashboard with no export button
- Two browsers in one session: main and support
- Finding the dead links on a site with an AI agent
- Filling a CRM record from a company's website
- One form submission per spreadsheet row, with an AI agent
- Dated screenshots of a page as evidence
- Checking order and delivery status with an AI agent
- Reading a PDF that opens inside the browser
- Summarising a long page or thread with an AI agent
- Collecting every image on a page with its caption
- Collecting event and course listings with an AI agent
- Cancelling a subscription with an AI agent
- What an AI agent can and cannot do inside an iframe
- Shadow DOM and an AI agent: you can click it, you cannot read it
- What a page snapshot costs, per control
- Native selects and the ones that only look like selects
- Clicking by selector or by coordinates
- How long the agent waits before it gives up
- What a second browser costs
- Uploading a file with an AI agent, and why this one cannot
- Watching the agent work, and when it is worth it
- When not to use an AI browser agent
- Agent or script: deciding once instead of every time
- Using the keyboard instead of the mouse
- Secrets in an agent task: where they end up
- What an agent run should log
- Deduplicating what an AI agent collects
- Normalising values across sites
- Validating an AI agent's output
- Reading a table with an AI agent
- Driving a site's own search and filters
- The task works headed and fails headless