Home / Learn / AI, explained simply

What is MCP? The Model Context Protocol explained

MCP: an AI host app with one client per connection, talking JSON-RPC to MCP servers for files, a database and a calendar; each server offers tools, resources and prompts
Beginner

A language model on its own can only work with the text in its conversation. To check your calendar, query a database or read a file, an AI app has to connect to those systems. The Model Context Protocol (MCP) is an open standard for making those connections, so one integration works across many AI apps instead of each app needing its own.

The official description compares it to a USB-C port for AI applications: a standard plug, so any app that supports MCP can use any MCP server.

Where it came from

Anthropic released MCP as an open-source standard in November 2024. It has since been supported by Claude, ChatGPT, Visual Studio Code, Cursor and many other apps. In December 2025 it became a founding project of the Agentic AI Foundation, a fund under the Linux Foundation set up by Anthropic, Block and OpenAI, so it's now run in a vendor-neutral home. Its maintainers still make the technical decisions.

Hosts, clients and servers

  • Host: the AI application you use, such as Claude Desktop, Claude Code or VS Code.
  • Client: a connection the host keeps to one server. A host connected to three servers has three clients.
  • Server: a program that provides capabilities, such as a filesystem server, a GitHub server or your company's database server.

A server can run on your own computer, where the host starts it and talks to it through standard input and output (the stdio transport). Or it can run remotely, reached over the web with the Streamable HTTP transport, usually with OAuth sign-in.

What a server can offer

PrimitiveWhat it isExample
ToolsActions the model can ask to runcreate_issue, query_database, send_email
ResourcesData the app can read for contextA file's contents, a database schema
PromptsReusable templates a user can pick"Summarise this pull request"

Servers can also ask the user for extra information or confirmation through the client, which the spec calls elicitation.

How a tool call works

  1. The host connects to the server and finds out what it supports.
  2. The client asks for the list of tools (tools/list). Each tool has a name, a description and a JSON Schema for its inputs.
  3. The host gives those tool descriptions to the model along with your message.
  4. If the model decides a tool would help, it asks to call it with some arguments. The host sends a tools/call request to the server.
  5. The server runs the action and returns the result, as text, images or structured data, and the host passes it back to the model, which carries on answering you.

The messages are JSON-RPC 2.0. A tool call request looks like this (shortened):

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "weather_current",
    "arguments": { "location": "Leeds", "units": "metric" }
  }
}

The model never runs anything itself. It only asks, and the host decides whether to carry the request out, often by asking you first.

MCP, function calling and APIs

Function calling (or "tool use") is the model's ability to ask for a tool. MCP is the standard way to provide those tools to an app. An API is what a server often uses behind the scenes: a GitHub MCP server, for example, calls GitHub's API for you. MCP doesn't replace APIs; it wraps them in a form any AI app can discover and use.

Security: what to watch

  • Only install servers you trust. A local server runs as a program on your computer with your permissions.
  • Prompt injection. Text the model reads through a tool, like a web page or an email, can contain instructions written to hijack it. Keep approval prompts on for actions that send, delete or spend.
  • Least privilege. Give a server access to the folder, repository or account it needs, not everything.
  • Remote servers should use proper sign-in (OAuth) rather than long-lived keys pasted into config files.

The protocol keeps changing

MCP is versioned by date. The current specification (2026-07-28, checked 22 November 2026) made the protocol stateless: every request carries its protocol version and capabilities, and clients can ask a server what it supports up front. It also deprecated some older features, such as roots and sampling. If you're building a server, use an official SDK and check the version it targets at modelcontextprotocol.io.

Sources

The main references behind this guide. Numbers we worked out ourselves, such as the code outputs, come from running the code.