Model Context Protocol (MCP) is an open standard for connecting AI applications to external tools and data, so an assistant like Claude or ChatGPT can read your files, query a database or call an API through one common interface. An AI app (the host) runs a small client for each MCP server, and the server tells the model which tools, resources and prompts it offers, using JSON-RPC 2.0 messages.
The official site compares it to a USB-C port: instead of every AI app writing a custom integration for every service, each service ships one MCP server and every MCP-capable app can use it.
What problem MCP solves
Before MCP, connecting a model to GitHub, a Postgres database and your local files meant three separate integrations, and they had to be rebuilt for every AI app. MCP standardises the connection. Anthropic released it on November 25, 2024, together with the specification, SDKs and pre-built servers for Google Drive, Slack, GitHub, Git, Postgres and Puppeteer. As of October 2026 the MCP site lists clients including Claude, ChatGPT, Visual Studio Code and Cursor.
MCP deliberately covers only the exchange of context and actions. It does not decide which model you use or how the app manages what it receives.
How MCP works: hosts, clients and servers
There are three roles:
- Host: the AI application you use, such as Claude Desktop, Claude Code or VS Code.
- Client: a connector inside the host. The host creates one client per server, and each client keeps a dedicated connection to its server.
- Server: a program that provides context and capabilities, for example a filesystem server or the Sentry server.
A server can be local or remote. Local servers usually run on your machine and talk over stdio (standard input and output), so the host starts them as a child process. Remote servers use the Streamable HTTP transport: HTTP POST for messages, optionally with Server-Sent Events for streaming, and standard HTTP authentication. MCP recommends OAuth for obtaining tokens.
What an MCP server can offer
| Primitive | What it is | Who it is for | Example |
|---|---|---|---|
| Tools | Functions the model can execute | The model | query_database, create_issue |
| Resources | Data that provides context | The user or the model | A file's contents, a database schema |
| Prompts | Reusable message templates | The user | A "review this pull request" template |
Clients can also offer features back to servers. In the current specification (version 2026-07-28) that is elicitation: the server asks the user for more information or a confirmation. Sampling, where a server asks the host's model for a completion, was part of the 2025-06-18 version and is deprecated as of 2026-07-28.
What MCP messages look like
Every message is JSON-RPC 2.0. A client discovers tools with tools/list. The server answers with each tool's name, description and a JSON Schema for its input. This response is taken from the architecture guide's example, shortened to one tool:
{
"jsonrpc": "2.0",
"id": 2,
"result": {
"tools": [
{
"name": "weather_current",
"title": "Weather Information",
"description": "Get current weather information for any location worldwide",
"inputSchema": {
"type": "object",
"properties": {
"location": { "type": "string" },
"units": { "type": "string", "enum": ["metric", "imperial", "kelvin"] }
},
"required": ["location"]
}
}
]
}
}
When the model decides to use the tool, the client sends tools/call with the tool name and arguments:
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "weather_current",
"arguments": { "location": "San Francisco", "units": "imperial" }
}
}
The server replies with a content array (text, images or resources), and the host passes that result back to the model. In the 2026-07-28 version every request also carries the protocol version and client capabilities in a _meta field, and servers must answer a server/discover request. The examples above omit _meta to keep them readable. You rarely write these messages by hand; the official SDKs handle them.
How MCP relates to function calling
The two fit together rather than compete. Function calling is the model-side mechanism: the model returns a structured request to run a named function, and your code runs it. MCP is the integration side: it lets the host find tools in separate server programs and call them in a standard way. A typical host fetches tool lists from all its MCP servers, gives them to the model as callable functions, and routes each call the model makes to the server that owns that tool.
Tool definitions are sent to the model as text, so they take up part of its context window. Connecting dozens of servers with hundreds of tools has a real token cost on every request.
How to add an MCP server to Claude Desktop
This is the official quickstart's example. It runs the filesystem server with access to two folders.
- Install Node.js, because this server runs through
npx. Check withnode --version. - In Claude Desktop, open the Claude menu in the system menu bar, then Settings... > Developer > Edit Config. This opens
claude_desktop_config.json, located at~/Library/Application Support/Claude/on macOS and%APPDATA%\Claude\on Windows. - Add the server (Windows paths shown; use
/Users/alex/Desktopstyle paths on macOS):
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": [
"-y",
"@modelcontextprotocol/server-filesystem",
"C:\\Users\\alex\\Desktop",
"C:\\Users\\alex\\Downloads"
]
}
}
}
- Quit Claude Desktop completely and start it again. The server's tools then appear under connectors in the chat input.
The folder paths in args are the only directories the server may touch. Paths must be absolute.
Security: what to watch for
MCP gives a model a route to real data and real actions, so the specification sets out principles that hosts are expected to follow:
- Hosts must get explicit user consent before invoking any tool, and before exposing user data to a server.
- Tools represent arbitrary code execution. Descriptions of tool behaviour should be treated as untrusted unless they come from a trusted server.
- The protocol cannot enforce these rules itself. They depend on how each host and server is built.
The practical rules follow from that. A local server runs with your account's permissions, so install servers only from sources you trust. Give file access to specific folders. Read approval prompts before clicking allow, especially for tools that write, delete or send.
If a server doesn't show up
Check the JSON syntax of the config file first; one missing comma stops every server loading. Then confirm the paths are absolute, and run the server's command yourself in a terminal (for example npx -y @modelcontextprotocol/server-filesystem C:\Users\alex\Desktop) to see its error directly. Claude Desktop writes MCP logs to ~/Library/Logs/Claude on macOS and %APPDATA%\Claude\logs on Windows: mcp.log covers connections, and mcp-server-NAME.log holds each server's stderr output.
Frequently asked questions
- Is MCP only for Claude?
- No. MCP is an open protocol. Anthropic introduced it in November 2024, but the official MCP site lists support in other assistants and tools, including ChatGPT, Visual Studio Code and Cursor. A server written once can be used by any client that speaks the protocol.
- Is MCP the same as function calling?
- No. Function calling is how a model asks your application to run a tool inside one API conversation. MCP is how an application discovers and calls tools that live in separate programs, called servers. In practice they work together: the host lists MCP tools to the model as callable functions, and when the model calls one, the host forwards the call to the right MCP server.
- Do I need to write code to use MCP?
- Not to use existing servers. In Claude Desktop, for example, you add a server by editing claude_desktop_config.json with the command that starts it, then restart the app. Writing your own server takes code, and official SDKs exist for several languages.
- Is it safe to install an MCP server?
- Treat it like installing any program. A local server runs with your user account's permissions, so it can do whatever you can do. The specification says hosts must get explicit user consent before invoking any tool, and that tool descriptions from untrusted servers should be treated as untrusted. Only install servers from sources you trust, and give file servers access to specific folders, not your whole drive.
Sources
- Model Context Protocol: What is MCP?
- Model Context Protocol: Architecture overview
- Model Context Protocol specification, version 2026-07-28
- Model Context Protocol specification, version 2025-06-18
- Model Context Protocol: Connect to local MCP servers
- Anthropic: Introducing the Model Context Protocol (November 25, 2024)