# What Is the Model Context Protocol (MCP)?

> What MCP is, how hosts, clients and servers fit together, and why it matters for AI agents, explained simply for your AI interview.

**In short:** The Model Context Protocol (MCP) is an open standard that lets an AI app connect to outside tools and data in one common way. A tool built once as an MCP server works with any app that speaks MCP, so nobody has to write a custom connector for every app and tool combination.

AI and LLM interview question Q164, Agents and tool use. Intermediate, very common (our estimate). From Venkat R. Murty's free Interview Kit: https://designervenkat.online/interview/ai/what-is-the-model-context-protocol

## Say it in 30 seconds

MCP stands for Model Context Protocol. It is an open standard for connecting an AI app to outside tools and data, like a claims database or a payments system. The app and the tool both speak MCP, so a tool built once works with any MCP app. Anthropic created it and open-sourced it. It only handles the connection. It does not make the model smarter, and each tool still needs its own access checks.

## Say it in 2 minutes

Picture a claims team at an insurance company. Their AI assistant needs to read claim files, search the policy wording and, once a person approves, send a payout. Each of those is a separate system with its own rules, and without a standard each link is custom code that every new AI app needs again. The Model Context Protocol, or MCP, fixes that. Anthropic created it and open-sourced it.

MCP has three roles. The host is the AI app, such as the claims assistant. For each server it uses, the host starts one client, and each client keeps its own connection. The server is the program that offers the tools, data or templates. A server on your own machine usually talks over STDIO, which means direct messages between two programs on the same computer. A remote server usually serves many clients over Streamable HTTP, which is ordinary web requests with an optional stream for longer answers. The host gives the model the list of tools, and when the model asks for one, the client sends the call to the server.

Two points matter most. MCP only carries the messages. It does not decide what the model should do, and it does not make the model smarter. Also, a server is code. A local server from an unknown source can reach whatever its program can reach, so it needs least privilege (only the access it truly needs) and approval checks, like any other tool. The standard makes plugging in easy. Safety still lives in your code, and interviewers listen for that.

## What is the Model Context Protocol, in plain words?

An AI model on its own only knows what it learned in training and what is in front of it right now, such as your chat and any files the app adds. To do real work it needs outside help: a database to search, a file to read, a tool to take an action. The Model Context Protocol, or MCP, is the common set of rules that lets an AI app connect to that outside help in one standard way.

The MCP docs describe it as an open-source standard for connecting AI applications to external systems. Anthropic created it, and it was open-sourced.

Picture a hospital lab. Each analyser prints its results in its own format, so every system that reads them needs a custom link. A shared format means each machine is connected once and any system can read it. A claims assistant at an insurer is the same case: its claim database, its policy library and its payments tool can each sit behind an MCP server, and any MCP app can use them the same way.

MCP is the rulebook for the connection. The model is separate.

- **MCP host:** The AI app the person uses, such as a claims assistant or a coding agent.
- **MCP client:** The connector inside the host. It keeps one connection to one server.
- **MCP server:** A program that offers tools, data or templates to AI apps.
- **Tool:** An action the model can ask for, such as reading a claim. The client sends the call to the server, which runs it.

## How does MCP connect an AI app to its tools?

The chart shows the idea. Three AI apps and three tool servers would need nine custom links if each pair were built by hand. With MCP, every app and every server speaks the same protocol, so each side is built once.

*Diagram, One standard between apps and tools: Each app connects once to the shared MCP layer, and each tool server connects once to it. The payments server still needs a check in code before it pays.*
1. The claims assistant sends its tool requests in MCP.
2. The coding agent's requests also go in MCP.
3. The support chatbot sends its questions in MCP too.
4. MCP passes the claim lookup to the claims database.
5. MCP asks the documents server for the policy wording.
6. MCP passes the payment request on. The payments server checks it first.

Inside the host, MCP has three parts. The host is the AI app. For every server it uses, the host starts one client, and each client keeps a dedicated connection to its server. The server is the program that holds the tools. A server on your own laptop usually serves one client over STDIO, which means direct messages between two programs on the same machine. A remote server in the cloud usually serves many clients over Streamable HTTP, which is ordinary web requests with an optional stream for longer answers.

1. **The host asks for the tool list:** It asks the server which tools it offers, and the server replies with the list.
2. **The model picks a tool:** The host gives the list to the model. The model chooses the one it needs, such as a read of one claim.
3. **The client makes the call:** The model only asks. The client sends the call to the server, so your code can check it first.
4. **The answer goes back to the model:** The server's result returns to the model, which writes the reply the person reads.

> **Tip:** In one line: the model picks the tool, and the client sends the call to the MCP server.

## What can an MCP server offer?

A server offers three kinds of thing. The docs call these basic building blocks primitives. Each one suits a different job.

- **Tools: Actions.** Things the model can ask for, such as searching a file store or sending a payout. They can change things, so they need the most checks.
- **Resources: Data to read.** File contents, database records or API responses the model can read as context. Reading is safer than doing, but it can still leak private data.
- **Prompts: Ready-made templates.** Set instructions a user can pick, such as a checklist for reviewing a claim before payout.

Take a claims assistant handling claim CL-48213. It reads the claim with a read-only tool, pulls the matching policy clause as a resource, and drafts a payout with a payment tool. The payment tool then waits for a claims officer's approval, enforced in code, not in the prompt.

Here is the same flow in plain Python. No real model is involved: we pretend it asked for a payout, and the code decides what goes through.

```python
# A simplified MCP-style exchange for a claims assistant. No real model:
# the client asks the server for its tools, then runs the one the model picked.
SERVER_TOOLS = {
    "get_claim": {"reads": True},
    "pay_claim": {"reads": False},
}

def tools_list():
    return sorted(SERVER_TOOLS)

def tools_call(name, args, approved_by_human=False):
    tool = SERVER_TOOLS.get(name)
    if tool is None:
        return "ERROR: unknown tool " + name
    # Code, not the model, decides whether a payout runs. The approval flag must come from the human review step, never from model arguments.
    if not tool["reads"] and not approved_by_human:
        return "WAITING: " + name + " needs a human approval"
    return "RAN: " + name + " " + str(args)

print("Tools offered:", tools_list())
print(tools_call("get_claim", {"claim": "CL-48213"}))
model_pick = ("pay_claim", {"claim": "CL-48213", "amount": 1200})
print(tools_call(*model_pick))
print(tools_call(*model_pick, approved_by_human=True))
```

Output:

```text
Tools offered: ['get_claim', 'pay_claim']
RAN: get_claim {'claim': 'CL-48213'}
WAITING: pay_claim needs a human approval
RAN: pay_claim {'claim': 'CL-48213', 'amount': 1200}
```

## Why does MCP matter, and where does it stop?

The gain is less repeated work. According to the MCP docs, Claude, ChatGPT, Visual Studio Code and Cursor all support MCP. A tool server built once can serve any of them, rather than each app needing its own connector.

> "MCP (Model Context Protocol) is an open-source standard for connecting AI applications to external systems." (MCP docs)
>
> "MCP focuses solely on the protocol for context exchange-it does not dictate how AI applications use LLMs or manage the provided context." (MCP docs)

The limit is just as important. MCP moves messages, and your app still decides what happens. A server is also a program with access. The security guide says to treat a third-party local server as untrusted code, with the privileges you give it kept as small as possible.

> "treat a third-party local server as untrusted code with exactly the privileges you hand it" (MCP security guide)
>
> "Prompt injection in untrusted content can steer an honest server into the same overreach" (MCP security guide)

Prompt injection makes this worse. That is when hidden instructions, say in an email or web page, trick the AI into doing something its owner never asked for. Untrusted text like that can steer an honest server into misusing its access. So the answer is the usual layered defence: least privilege, checks in your code, and a human for risky actions.

> **Tip:** Asked about MCP risks? Say a server is code from someone else. Review it before you install it, give it the fewest rights, and keep payment or deletion checks in your own code.

### How would you roll out MCP in a bank's support team?

A bank wants its support assistant to read policy pages and account rules through MCP. Here is the order I would take, so that a mistake stays small.

1. **Start with read-only servers:** Begin with a policy library and a product catalogue. Reads are easier to undo than payments or changes.
2. **Vet every server before install:** Check who wrote it, what it can reach, and whether it runs on your machine or a vendor's.
3. **Keep money moves behind approval:** Any refund or fee change waits for a staff member, checked in code, with the amount shown.
4. **Log every tool call:** Keep a record of who asked, what ran and what came back, so an incident can be traced.

The first two steps lower the chance of a bad server. The last two limit what a bad server can do.

## What does the interviewer want to hear?

**A strong answer covers**

- [ ] A plain definition: an open standard for connecting AI apps to tools and data.
- [ ] The three roles: host, client and server, with one client for each server.
- [ ] The three primitives: tools to act, resources to read, prompts as templates.
- [ ] Local (STDIO) and remote (Streamable HTTP) servers.
- [ ] MCP moves the messages. Your code still decides what is allowed.
- [ ] A server is code from someone, so vet it and keep its access small.

**Common traps**

- Trap: "MCP makes the model smarter at using tools." Better: It only connects. The model's skill doesn't change, and it still needs good instructions.
- Trap: "Once a tool is on MCP, it is safe." Better: A standard is not a security check. Each tool still needs least privilege and checks in code.
- Trap: "The model runs the tools through MCP." Better: The model only asks. The client sends the call to the server, and code can check it first.

## Can you spot the mistake?

**Spot the mistake:** A bank's agent platform has four MCP setups. Which one is a mistake?

A. The claims database runs locally over STDIO for one analyst.
B. A remote policy server uses Streamable HTTP and serves many clients.
C. The payments server is an MCP server, so the model can pay out without a limit check.
D. The host starts one client for each server it uses.

**Answer:** C. MCP only carries the calls. A payout with no limit or approval check in your code is the mistake, however the server is connected.

**Quick check:** A bank's assistant needs 12 internal tools. Which is the strongest reason to use MCP here?

A. It makes the model smarter at reasoning about money.
B. Each tool is built once as a server, and any MCP app can use it.
C. It stops prompt injection on its own.
D. It removes the need for access checks.

**Answer:** B. MCP cuts the repeated connector work. It does not improve reasoning, stop attacks or remove checks, so those still need their own design.

## Can you answer these from memory?

**Flash cards**

- **What is MCP?** An open standard that connects AI apps to outside tools and data in one common way.
- **Host, client, server?** Host: the AI app. Client: the connector inside it. Server: the program offering tools.
- **The three primitives?** Tools to act, resources to read, prompts as reusable templates.
- **Local vs remote transport?** Local: STDIO on one machine. Remote: Streamable HTTP over the network.
- **Who decides a tool call?** The model asks. The client sends the call to the server, and code can check it first.
- **Does MCP make a model smarter?** No. It is a connection standard. Access checks still live in your code.

## Likely follow-up questions

- Q165 MCP tools vs resources vs prompts? https://designervenkat.online/interview/ai/mcp-tools-vs-resources-vs-prompts
- Q167 MCP vs a plain REST API? https://designervenkat.online/interview/ai/mcp-vs-a-plain-rest-api
- Q156 What is tool (function) calling? https://designervenkat.online/interview/ai/what-is-tool-calling
- Q157 What is an AI agent? https://designervenkat.online/interview/ai/what-is-an-ai-agent
- Q166 What changed in the 2026-07-28 MCP spec? (full answer coming)
- Q175 What makes a tool-calling loop reliable enough to ship? https://designervenkat.online/interview/ai/reliable-tool-calling-loop

## Learn it in depth

- [MCP](https://designervenkat.online/learn/ai-engineering/mcp)
- [MCP hosts, clients and servers](https://designervenkat.online/learn/ai-engineering/mcp-host-client-server)
- [MCP data and transport layers](https://designervenkat.online/learn/ai-engineering/mcp-layers)
