MCP Servers Explained: Tools, Resources, Prompts and When to Add a Gateway
A plain-language look at MCP servers: how host, client and server connect, how MCP differs from an API, what you can do with one, and when a gateway pays off.
This article is published in English.
An MCP server is a compact program that gives an AI model reach into tools and data it could not touch on its own. Picture a bridge. Using the Model Context Protocol, a shared standard, a model can read files, query a database or call an API without anyone writing new glue for each combination. The server may be a script on a laptop or a cloud service.
The acronym sounds more intimidating than the idea. It still deserves a clear understanding, because MCP is quickly turning into the default route by which AI agents touch the outside world.
What the server actually is
Three kinds of capability are offered by a server: actions the model can run, information it can read, and templates it can reuse. After connecting, the model asks what is available and works with the answer. In short, the server is a standard adapter that joins one AI to one outside system.
The word "server" misleads people. Nothing about it requires dedicated hardware in a datacenter; a server for the local filesystem can be a short script on a personal machine. The name comes from the fact that it answers requests, exactly like the dev server that starts with npm run dev. It is a small program that responds to questions.
Put differently, the server is whatever sits at the far end of the connection, able to do real work like reading a file or querying a database and able to describe that work in a way a model can parse.
Where MCP came from
The Model Context Protocol is an open standard for linking AI models to outside tools and data. Anthropic published it in November 2024, and inside a year it moved from a niche idea to something that Claude, ChatGPT, Cursor and VS Code all support.
It solved a plain annoyance. Before MCP, giving an AI a tool meant writing the integration by hand every time. A retrieval chatbot over a company's docs, with embeddings and retrieval wired together manually, is one data source and one fully custom integration. Repeat that for GitHub, then Slack, then a database, then another model expecting a different payload shape, and it stops scaling. Everyone was rebuilding the same connectors.
The official documentation compares MCP to a USB-C port for AI: one connector shape, and anything can plug into anything. A server built once works with every client that speaks the protocol. That explains the speed of adoption, since a heap of one-off integrations became a single shared standard.
How the pieces fit together
Three roles are involved: host, client and server.
- The host is the application a person actually uses, for instance Claude Desktop or Cursor.
- For each server it wants to reach, the host creates one client, which keeps a dedicated connection to that single server.
- Messages travel as JSON-RPC 2.0, a plain, well-understood format, which is an advantage here.
A server can offer three kinds of capability, and they are worth knowing by name:
- Tools: operations the model may trigger, for example opening a file, executing a query, or filing a GitHub issue.
- Resources: material the model reads for context, such as a document's text or a database schema. Reading has no side effects.
- Prompts: reusable templates for frequent jobs, saving the model from starting cold.
The flow is short. The client connects, asks the server to list what it has with a tools/list call, then runs one of the items with a tools/call. In JSON, the discovery request looks like this:
// "What can you do?"
{ "jsonrpc": "2.0", "id": 1, "method": "tools/list" }
and the follow-up that invokes a tool looks like this:
// "Okay, do this one."
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "get_weather",
"arguments": { "city": "Kolkata" }
}
}
One more point matters early: servers run in one of two places. A local server speaks over stdio, meaning standard input and output, so two programs on the same machine pass text back and forth with no network involved. A remote server speaks over HTTP, so it can live anywhere and serve many clients at once. The protocol is the same in both cases, which is the whole idea.
MCP versus a plain API
People ask this constantly, so the direct answer is that an MCP server normally sits on top of an ordinary API. It does not replace one. What differs is the intended consumer.
A regular API targets a developer who has read the documentation and hardcoded the exact calls. It presumes the endpoints are known ahead of time. An MCP server targets a model that arrives knowing nothing, asks what exists and decides on its own which tool to use. Discovery at runtime is the trick, and a plain API does not provide it.
In practice, the majority of MCP servers are thin wrappers over an API that a developer could have called directly. MCP contributes a uniform way to describe the tools, so any model can discover and use them without a human wiring every call. The API performs the task, and the server makes it legible to an AI.
What you can do with one
More than most people expect, and the raw materials are likely already on hand. Typical examples: one server lets a model work with local files, another handles GitHub issues and pull requests, a third queries Postgres, a fourth reads and posts Slack messages. Anthropic hosts a collection of reference implementations on GitHub, and vendors increasingly publish an official server for their own product.
Most people meet their first server through a coding agent such as Claude Code. Attach a server to a coding agent or a desktop chat app, and it can suddenly touch files, search the web or open a pull request with no copy-pasting. The tools simply appear as new things the model is able to do.
The pattern never changes: find a server for the system that matters, point the client at it, and the model gains a skill. A single server is a five-minute setup, and watching an agent edit a real file on disk for the first time feels a little like magic.
When a gateway becomes worth it
Start with the honest bit. With one or two MCP servers, a gateway is unnecessary, because it solves a problem that has not appeared yet. Skip ahead and go experiment.
Once the count climbs, say to ten servers wired into several agents, three problems surface quickly.
- Context bloat: each request pushes every server's whole tool list into the model's window. With 150 or more tools, most of the budget goes to reading the menu.
- Scattered credentials. Each server has its own keys and auth, spread across config files with no single place to rotate them.
- No shared policy. Nothing says who may call what, or caps spending.
That is tool sprawl, and it converts a tidy setup into a liability. A gateway fixes it by sitting in the middle, much like a power strip: instead of ten cables into ten sockets, the agent connects once, and the gateway handles the rest.
Bifrost, an open-source AI gateway from Maxim AI, is one product that can fill this role, putting every server behind one endpoint. Its answer to the token problem is a feature named Code Mode. Ordinarily the model must re-read each tool description with every prompt just to learn the menu. In Code Mode the prompt carries four generic tools and the model writes code to locate and run what it needs on demand. The vendor's own benchmarks claim input-token reductions of up to 92.8%, enough to dent a bill visibly. Trimming cost at the gateway follows the same logic as semantic caching.
A gateway also centralizes safety. API keys sit together instead of scattering across config files. Per-key tool filtering and budgets let an administrator pick which agent gets which tools and set spending caps. Tools do not execute automatically unless that gets enabled explicitly, which matters because silent, unapproved tool use by an agent is trouble waiting to happen.
Where to begin
No giant specification or complex code is required. Once the acronym stops being scary, the idea is small: a standard plug that lets an AI reach outside tools.
To try it today, pick an application already in use, such as Claude Desktop, Cursor or Claude Code. Then grab one prebuilt server, the filesystem or GitHub one for instance, and add it to the config file, which takes about five minutes. Once it runs, give the model a real prompt, such as inspecting a local folder or checking a repository. The moment an agent reaches out of its chat box and touches a real file, the protocol clicks.
Keep the first attempt tiny. A gateway and fancy routing are overkill for one or two servers. Play with one, see how it feels, and add a gateway only when a dozen servers are in play and the token bill starts climbing.
Quick answers
What is an MCP server, briefly? A small program offering an AI model tools and data through a common standard, so the model can read files, run database queries or call APIs with no bespoke glue.
How do client and server differ? Two ends of the same link. Servers supply the capabilities; a client, spawned by an application such as Claude Desktop, connects to a server and consumes them. An application can run several clients, one for each server.
Are servers safe? That depends on how they are run. One trusted local server carries little risk. Trouble starts with many unvetted servers holding their own credentials while agents execute tools unattended, which is why disabling auto-execution and using a filtering gateway pays off at scale.
How is one built? Pick an official SDK, declare a handful of tools along with their inputs, and serve them over stdio or HTTP. Begin with one or two tools that work against a client already in use, then expand, instead of trying to wrap a whole API at once.