A language model only knows what was provided to it. This can include your message, the conversation so far, and whatever the app it runs in decides to add. If you ask an AI assistant: "Do I need an umbrella in Lagos tomorrow?", the model alone can't answer this question. It doesn't know tomorrow's forecast. Something has to fetch the forecast from a weather service, and the app it runs in has to let that happen safely.
The Model Context Protocol (MCP) is an open standard for connecting AI applications to the tools and data they need. An AI app that speaks MCP can use any MCP server, and a service that offers an MCP server works with every AI app that speaks MCP.
This article uses that question to explain how MCP works. It follows what happens from the moment you ask it to the moment the answer appears, and introduces each part of MCP as the question reaches it. You don't need to write code to follow along.
The problem MCP solves
Before a shared protocol, every AI app had to build its own integration for every service it wanted to reach. A chat app wrote custom code to talk to a weather API, then different custom code for GitHub, then more for your files. A code editor that wanted to use the same three services had to write all three integrations again in its own way.
The top half of the diagram shows where that leads: three apps and three services need nine separate integrations, and every new app or service adds a whole row or column. The bottom half shows the MCP version. Each app builds one MCP client, each service gets one MCP server, and any app can use any server because they all speak the same protocol.
MCP is often compared to a USB-C port. A laptop doesn't need a different socket for every brand of charger, and an AI app doesn't need a different integration for every service. The comparison has a limit worth keeping in mind: MCP standardizes the conversation between the app and the server, not the services behind it. A weather server still calls its own weather API in whatever way that API requires. MCP only defines how the server offers that ability to AI apps.
The three participants
Every MCP setup has the same three roles: the host, the client and the server.
| Participant | What it is | In the umbrella question |
|---|---|---|
| Host | The AI app you use. It runs the conversation, works with the model and decides what is allowed. | The chat assistant you typed your question into |
| MCP client | A component inside the host that maintains the connection to one MCP server. | The part of the assistant that talks to the weather server |
| MCP server | A program that offers capabilities, such as tools, to AI apps through MCP. | A weather server that can look up forecasts |
A host can connect to many servers at once, and it creates a separate client for each one. In the diagram, the assistant has one client for a files server and another for a weather server. Each client talks to exactly one server, which keeps the servers isolated from each other.
Notice what is missing from the list: the model. The model never talks to an MCP server directly. It works inside the host, and the host decides what the model sees and which requests go out. This is deliberate. Servers receive only the information a request needs, and the full conversation stays with the host. The weather server learns that someone asked about Lagos tomorrow. It doesn't see the rest of your chat.
Servers can run in two places, shown at the bottom of the diagram. A local server runs as a program on your own computer, like the files server. A remote server runs somewhere on the internet, like the weather server. You'll see how messages reach each kind later in this article.
What a server can offer
An MCP server offers its abilities as three kinds of building blocks, called primitives. The main difference between them is who decides when they're used:
| Primitive | Who decides to use it | In a weather server | Other examples |
|---|---|---|---|
| Tools | The model, when it decides it needs one | get_forecast, which looks up a seven-day forecast for a place | Creating a GitHub issue, running a query |
| Resources | The app, when it decides to attach context | A list of example cities at weather://cities | File contents, a database schema |
| Prompts | You, when you pick one, often as a slash command | A /plan-my-week template that asks for a week of forecasts | A "review this code" template |
Tools are functions the model can ask to run. Resources are data an app can read by an address called a URI, such as file:///notes/todo.md. Prompts are ready-made instructions you choose to start a task.
Each primitive comes with its own protocol methods, in two kinds:
- Discovery methods list what the server has:
tools/list,resources/listandprompts/list. - Execution and retrieval methods use one item from that list.
tools/callruns a tool,resources/readreads a resource, andprompts/getfetches a prompt.
A client always discovers first, then calls, reads or gets by name.
A server doesn't have to offer all three. Many servers start with tools only, and the umbrella question only needs one: get_forecast.
Following one question from prompt to answer
Here is the umbrella question's whole journey. The numbers in the diagram match the sections below. Only steps 1, 2, 6 and 7 are MCP messages between the client and the server. The others happen inside the host, which is why the model never talks to the server.
The client finds out what the server offers (1–2)
Before the model can use the weather server, the host needs to know what the server can do. The client can ask with server/discover (step 1). The server replies with the protocol versions it supports and its capabilities, which say which primitives it offers:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"resultType": "complete",
"supportedVersions": ["2026-07-28"],
"capabilities": { "tools": {} }, // this server offers tools
"_meta": {
"io.modelcontextprotocol/serverInfo": {
"name": "weather-server",
"version": "1.0.0",
},
},
"ttlMs": 3600000, // the client may reuse this answer for an hour
"cacheScope": "public",
},
}The server says it offers tools, so the client asks which ones with tools/list (step 2):
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"resultType": "complete",
"tools": [
{
"name": "get_forecast",
"description": "Get a seven-day forecast for a location.",
"inputSchema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Place name to forecast",
},
},
"required": ["location"],
},
},
],
"ttlMs": 300000,
"cacheScope": "public",
},
}Each tool has a name, a description and an inputSchema. The description and schema are written for the model. They tell it what the tool does and what arguments it needs, which is how the model can use a tool it has never seen before.
The model chooses a tool and you approve it (3–5)
The host now puts two things in front of the model: your question and the list of available tools (step 3). The model reads "Do I need an umbrella in Lagos tomorrow?", sees that get_forecast returns a forecast for a location, and asks to call it with location: "Lagos" (step 4). The tool returns seven days, so the model will pick out tomorrow when the result comes back.
The model asks. It doesn't act. The host decides whether the call goes ahead, and the MCP specification says there should always be a person able to deny a tool call. A well-built host shows you which tool is about to run and with what arguments, and waits for your approval (step 5). For a weather lookup, some apps let you approve once and remember the choice. For a tool that sends email or deletes files, you'd want to look every time.
The client calls the tool (6)
With your approval, the host hands the call to its client, which sends tools/call to the weather server (step 6):
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "get_forecast",
"arguments": { "location": "Lagos" },
"_meta": {
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": {
"name": "chat-assistant",
"version": "1.0.0",
},
"io.modelcontextprotocol/clientCapabilities": { "elicitation": {} },
},
},
}The _meta block appears on every request, not only this one. It says which protocol version the client is using, identifies the client, and lists what the client can handle. Here, elicitation means "I can ask the user a question if you need me to". You'll see why that matters in the next section.
Because every request carries this information, MCP doesn't need a connection-opening handshake or a session. Each request stands on its own, and the server can answer it without remembering anything from earlier requests. That's also why server/discover in step 1 is optional: a client that already knows the server can go straight to tools/call.
The result comes back (7–8)
The weather server calls its weather API, which isn't part of MCP, and gets the next seven days for Lagos, Nigeria (step 7). It returns the result, trimmed here to the first two days:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"resultType": "complete",
"content": [
{
"type": "text",
"text": "{\"location\":{\"name\":\"Lagos\",\"country\":\"Nigeria\"},\"daily\":{...}}",
},
],
"structuredContent": {
"location": { "name": "Lagos", "country": "Nigeria" },
"daily": {
"time": ["2026-11-09", "2026-11-10"],
"temperature_2m_max": [31, 30],
"precipitation_probability_max": [20, 80],
},
},
},
}The id matches the request's id, which is how the client knows which request this answers. The result carries the same forecast twice. content is text that any client can show or pass to a model. structuredContent is the same data as JSON that code can use directly. Tomorrow's entry says an 80% chance of rain. The client passes the result to the host, the host gives it to the model, and the model answers you: "Yes, take an umbrella tomorrow" (step 8).
When the server needs to ask you something
Sometimes a server can't finish a request without more information. "Lagos" is a good example: there's a Lagos in Nigeria and another in Portugal. Many servers just pick the best match. A more careful weather server can ask instead.
The client sends tools/call as before (step 1). This time, instead of a forecast, the server answers with resultType: "input_required" and a question for you (step 2):
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"resultType": "input_required",
"inputRequests": {
"which_location": {
"method": "elicitation/create",
"params": {
"mode": "form",
"message": "Which Lagos do you mean?",
"requestedSchema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"oneOf": [
{ "const": "lagos-ng", "title": "Lagos, Nigeria" },
{ "const": "lagos-pt", "title": "Lagos, Portugal" },
],
},
},
"required": ["location"],
},
},
},
},
},
}This is called elicitation: the server asks the user for input through the client. The server could only ask because the client declared elicitation in its _meta earlier. The host shows you the question, usually as a small form that names the server asking (step 3). You pick Lagos, Nigeria (step 4).
The client then sends the original tools/call again as a new request with a new id, adding your answer in inputResponses (step 5). Now the server has what it needs and returns the forecast with resultType: "complete" (step 6). You can always decline or dismiss the question instead, and the server has to handle that too.
How the messages travel
Every message in this article is JSON-RPC 2.0, a small, widely used format for remote calls. It has three kinds of message:
| Message | What it is | Example from this article |
|---|---|---|
| Request | Asks for something. Has a method, optional params and an id. | tools/call for get_forecast |
| Response | Answers one request. Carries the same id and a result or error. | The forecast result |
| Notification | A one-way message that expects no reply, so it has no id. | "The list of tools has changed" |
Because there's no session, a server can't send a notification whenever it likes. A client that wants them opens a long-lived subscriptions/listen request, and the server sends notifications on that stream.
How those messages get from client to server is the job of a transport. MCP defines two:
- stdio is for local servers. The client starts the server as a program on your computer and they exchange messages through its standard input and output. This is the files server from the architecture diagram. Desktop AI apps usually set these up from a configuration file that names the program to run.
- Streamable HTTP is for remote servers. The client sends each message as an HTTP POST to the server's MCP endpoint, a single URL such as
https://weather.example.com/mcp. The reply comes back as plain JSON, or as a stream of events if the server has several messages to send for that request. This is the weather server. Remote servers often ask you to sign in before you can use them. MCP's authorization rules define how that sign-in works, so the host can get access on your behalf without the server seeing your password.
The messages are the same on both transports. A tools/call for get_forecast looks identical whether it travels over stdio or HTTP. Only the delivery changes.
What MCP doesn't do
It helps to know where the protocol stops:
- It isn't a model or an agent. MCP doesn't decide what to do or generate answers. The model inside the host does that, and MCP only gives it a standard way to reach tools and data.
- It doesn't make a server trustworthy. An MCP server can do anything its code allows. Connect only to servers you trust, and treat a tool's description as a claim from the server, not a guarantee. Tool descriptions and results are text the model reads, so a malicious server can try to steer the model with instructions hidden in them. This is called prompt injection, and it's one reason the host asks you before a tool runs.
- It doesn't decide what the model may do. Approvals, permissions and what the model sees are the host's job. MCP gives the host the information it needs to make those decisions.
- It doesn't replace the service's API. The weather server still uses the weather API behind the scenes. MCP is the layer that lets AI apps use the server.
Key terms
| Term | Meaning |
|---|---|
| Host | The AI app you use, which contains one MCP client per server it connects to. |
| MCP client | The part of the host that talks to one MCP server. |
| MCP server | A program that offers tools, resources or prompts to AI apps through MCP. |
| Primitive | One of the three kinds of things a server offers: tools, resources and prompts. |
| Discovery | Asking a server what it offers, with server/discover and the */list methods. |
| Tool | A function the model can ask to run, such as get_forecast. |
| Resource | Data an app can read by URI, such as a file or a list of cities. |
| Prompt | A ready-made instruction template you choose, often as a slash command. |
inputSchema | The JSON Schema that describes a tool's arguments, written for the model. |
_meta | The block on every request with the protocol version, client info and capabilities. |
| Capabilities | What each side says it supports, such as tools on a server or elicitation on a client. |
| Elicitation | A server asking you for input through the client, such as "Which Lagos?". |
input_required | The result a server returns when it needs more information before it can finish. |
| Transport | How messages travel: stdio for local servers, Streamable HTTP for remote ones. |
| JSON-RPC | The message format MCP uses for requests, responses and notifications. |
What to remember
- MCP connects AI apps to tools and data through one shared protocol, so each app and each service only needs to implement it once.
- The host is the app you use, it holds one MCP client per MCP server, and the model works inside the host, never talking to servers directly.
- Servers offer tools (the model decides), resources (the app decides) and prompts (you decide).
- A tool call goes: discover the server, list its tools, let the model choose, get your approval,
tools/call, then hand the result back to the model. - Every request carries its own version and capabilities in
_meta, so there's no session to set up. - When a server needs more information, it returns
input_requiredand the client retries with your answer. - A tool that ran but failed returns a result with
isError: truethat the model can explain. A request that was wrong returns a JSON-RPCerror.


