MCP From a Developer's Seat: Hosts, Clients, Servers and Tool Calls
Why LLMs need a protocol for tools, how the MCP host, client and server divide the work, and how a single request travels from the user to a tool and back.
This article is published in English.
Sources: What and Why MCP?
AI has become a routine part of software work. Assistants generate code, track down bugs, analyze data and automate chores, and they've reshaped how developers build. Yet a basic question remains: how can a model interact safely and efficiently with the tools, data and systems developers rely on every day? The Model Context Protocol, or MCP, is one answer.
What follows looks at MCP from a developer's seat: what an MCP server is and why it exists, how the pieces fit together, how a model reaches external tools through the protocol, and what it does for scalability, maintainability and productivity.
Why MCP exists
Start with the situation today. You can reach powerful large language models from OpenAI, Meta's Llama, DeepSeek, Google's Gemini and Anthropic's Claude through a browser or an app. They answer questions, write text and code, summarize documents and even create images.
Focus on one basic ability, producing a text reply. Suppose you ask an LLM for the best hotels in Colombo. It can give a useful answer from the knowledge it holds, but two limitations show up quickly.
Limitation one: stale knowledge
A model's knowledge reflects its training data plus whatever extra information or tools it has been handed. Without connections to outside, live sources, it may not know current hotel prices, room availability, flight schedules or places that opened recently.
Limitation two: no ability to act
This one runs deeper. A model can compose an answer, but it can't automatically do anything in the real world. Ask it to email your manager and it'll write the message, yet it can't send it unless it's wired to an email service with proper permissions. Ask it to file a Jira ticket for a bug and it can draft the title and description, but creating the ticket requires access to Jira. The same goes for booking a hotel, querying a database, touching company systems or calling an API.
So how do you close that gap?
AI agents as a first step
The usual first answer is the agent: an LLM joined to external tools and allowed to choose which tool fits a step and when to call it. Consider a travel assistant. A user asks it to plan a Paris trip for next month: pick a good hotel, book it and suggest interesting spots nearby.
That sentence hides a bundle of tasks. The agent may need to:
- look for available hotels
- inspect details, prices and availability
- complete a booking
- find attractions near the hotel
- pull location and map data
- send a confirmation email
Doing so requires outside resources. The LLM contributes understanding and reasoning, while the tools contribute the capabilities to carry things out.
The integration explosion
Now imagine the agent has to work with 20, 50 or hundreds of tools and services. Each might come with its own API, authentication method, request and response formats and integration code. If every AI application writes a custom connector for every tool, the architecture turns tangled fast.
That is the gap MCP fills. It gives AI applications a standard way to talk to external tools, data sources and services. Instead of a different integration for every application and every tool, there's one shared protocol linking models to outside capabilities.
The three kinds of server capability
A server can offer three different things, and telling them apart clears up much of the vocabulary:
- Tools are actions the model can request, such as searching hotels or creating a ticket. They may change something in the outside world.
- Resources are pieces of data the application can read for context, such as a file, a database record or a document.
- Prompts are reusable templates that help structure an interaction with the model.
Most introductory examples focus on tools because they answer the "can't act" problem directly, but resources and prompts matter once an application needs context rather than commands.
How MCP works
With the motivation clear, look inside an MCP-based application. Three components matter, and though their names sound alike, each has its own job.
- The MCP host is the AI application that the user interacts with, for instance an IDE with built-in AI, a desktop app or a chatbot built on an LLM. It manages the overall AI interaction, including the user conversation and the connections to MCP servers.
- The MCP client lives inside the host and handles communication with an MCP server. The host is what the user sees, and the client is the part inside it that speaks the MCP protocol.
- The MCP server sits on the other side and exposes capabilities the AI application can use: tools that perform actions, resources that supply contextual data and prompts that help structure interactions.
What happens at startup
When the application connects to a server, the client opens a connection and initializes communication. Both sides swap information about protocol version and supported capabilities. Local servers can talk over stdio, and remote servers can use Streamable HTTP.
Once the link is ready, the client discovers what the server offers. A hotel server might expose tools called search_hotels, check_availability and make_booking, each with a description and details of the inputs it expects. The AI application then passes those definitions along to the LLM.
One request, traced
Say the user types, "Find me a hotel in Colombo this weekend." The LLM receives that message plus the available tool descriptions. From the request and those descriptions, it concludes that search_hotels is the right choice and produces the arguments, such as a location and dates.
The model doesn't run the tool itself. The host hands the tool request to the MCP client, which forwards it to the right server using the protocol. The server executes the real tool, which might call a hotel API, query a database or reach another outside system. All of those details stay hidden behind the server.
When the tool finishes, the result travels back through the server and the client to the AI application, and the LLM turns it into the final reply. If the request has several steps, the model keeps going, deciding whether another tool is needed.
A request like "Find a hotel, book it, and send me a confirmation email" may need several calls in sequence: a hotel search, an availability check, the booking and finally an email tool. Each step's output can feed the next.
The idea in one line
The LLM decides what should be done, the MCP client talks to the MCP server, and the server uses the proper tools to do the work. The whole path reads like this:
User, then MCP host, then LLM, then MCP client, then MCP server, then tool, and back through the server, the client and the LLM to the user.
That division of labor is where MCP's value comes from. The model concentrates on understanding and reasoning, and MCP gives the application a standard way to discover and use external capabilities.
Messages and permissions
Underneath, client and server exchange structured messages, and MCP builds on JSON-RPC 2.0 for that. A request names a method, such as listing tools or calling one, and the reply carries either a result or an error. Because the host sits between the model and every server, it is also the natural place to enforce permissions. A well-built host can ask the user to approve a booking or an email before the call goes out, and can limit which servers a given conversation may touch. The protocol standardizes the plumbing, but trust decisions still belong to the application and its user, so servers should be treated like any other piece of code that can act on your behalf.
Why developers should care
A shared protocol changes how AI-powered systems are built:
- Less repeated work. A tool exposed once through an MCP server can be used by any MCP-capable application instead of being re-integrated each time.
- Better maintainability. Tool details such as authentication and request formats stay behind the server, so applications don't need to change when those details do.
- Easier scaling. Adding a tool means adding a server and letting clients discover it, not rewriting the application.
- Cleaner separation. The model reasons, the client communicates and the server acts, and each part can be tested and replaced on its own.
Where the story goes next
LLMs can think and generate, but they can't reach every outside system alone. Agents give them tools, and MCP supplies a standard way to connect those tools to AI applications. The model reasons, the client communicates, the server exposes capabilities and the tools do the actual work.
One question is left open: what exactly passes between client and server? Answering it means looking at the protocol itself, how messages are exchanged, how tools are discovered and where JSON-RPC fits in. Short version: a model can think, a tool can act, and MCP helps them talk.