Model Context Protocol (MCP) Explained: How AI Apps Connect to Tools and Data
What the Model Context Protocol is, why it exists, and how hosts, clients and servers exchange tools, resources and prompts over JSON-RPC.
Published December 1, 2026
Every AI assistant eventually needs to do something outside the chat box: read a file, query a database, open a ticket, search docs. Before MCP, every app wired up every integration its own way. The Model Context Protocol (MCP) is an open standard, introduced by Anthropic in late 2024 and since adopted across the industry, that gives AI applications one common way to plug into tools and data. Think of it as USB-C for AI integrations.
The concept
MCP separates three roles. The host is the AI application the user interacts with, such as a desktop assistant, an IDE or a terminal agent. Inside the host, an MCP client maintains a connection to one MCP server. A server is a small program that exposes capabilities, for example a GitHub server, a Postgres server or your company's internal API server. One host can connect to many servers at once.
Servers expose three kinds of primitives. Tools are functions the model can call (create_issue, run_query). Resources are read-only data the application can load into context (a file, a schema, a document). Prompts are reusable templates the user can invoke. Messages are JSON-RPC 2.0, carried over stdio for local servers or Streamable HTTP for remote ones. Because the protocol is the same everywhere, a server written once works in any MCP-compatible host.
The architecture
A session, step by step
Primitives at a glance
| Primitive | Controlled by | Example |
|---|---|---|
| Tools | Model (with user approval) | run_sql, create_issue, send_message |
| Resources | Application | file://README.md, postgres://schema |
| Prompts | User | /summarise-pr, /explain-error |
| Sampling (client feature) | Server asks host's model | Server requests a completion |
| Elicitation (client feature) | Server asks the user | Request missing input mid-task |
Practical examples
Connect a local server in a host config
Most hosts accept a JSON config listing servers to launch over stdio.
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/Users/me/projects"]
}
}
}What a tool call looks like on the wire
Plain JSON-RPC 2.0.
{"jsonrpc": "2.0", "id": 7, "method": "tools/call",
"params": {"name": "search_issues", "arguments": {"query": "login bug", "state": "open"}}}Debug any server with the Inspector
An interactive UI to list and call tools, resources and prompts.
npx @modelcontextprotocol/inspector npx -y @modelcontextprotocol/server-filesystem ./Common mistakes
- Treating MCP as a model feature; it is an integration protocol any model or app can use.
- Installing third-party servers without reviewing what they can access.
- Exposing dozens of overlapping tools, which confuses the model and wastes context.
- Putting secrets in tool descriptions or results that get sent to the model.
Key takeaways
- MCP standardises how AI apps connect to tools and data.
- Hosts contain clients; each client talks to one server.
- Servers expose tools, resources and prompts over JSON-RPC.
- stdio for local servers, Streamable HTTP for remote ones.
FAQ
Is MCP only for Claude?
No. It is an open protocol, and many AI applications, IDEs and agent frameworks support it.
How is MCP different from function calling?
Function calling is how a model asks to call a function in one API request. MCP is how the application discovers and connects to those functions across many providers in a standard way.
Do I need MCP for a single internal tool?
Not necessarily. MCP pays off when you want the same integration to work in several hosts or want to reuse community servers.