What is MCP? The Model Context Protocol explained

What MCP and MCP servers are, how they work, and how to add one to Claude Code, Codex or Cursor.

Last updated

Abstract illustration of one glowing hub connected to six smaller nodes

MCP (the Model Context Protocol) is an open standard for connecting AI applications to outside systems: your files, a database, GitHub, Figma, Notion, Sentry, a browser. An MCP server is a small program that exposes those systems as tools the AI can call, and any app that speaks MCP (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code) can plug into it. The protocol's own docs describe it as "a USB-C port for AI applications": one standard plug instead of a custom cable for every device.

That's the short answer. The rest of this page explains what actually happens when an agent uses an MCP server, how to add one to the three coding agents most people use, what can go wrong, and whether you need MCP at all.

What does MCP stand for

MCP stands for Model Context Protocol. Each word is doing work:

  • Model: it's for AI models, or more exactly the apps built around them.
  • Context: what the protocol carries. Data the model can read (a file, a database schema, an error report) and actions it can take (create an issue, run a query).
  • Protocol: it's a set of rules for messages, not a product. Nobody "runs MCP"; apps and servers implement it.

If you searched "what does MCP stand for" and found something about a joint in your hand or a Microsoft certification, those are different MCPs. In AI and software, MCP almost always means the Model Context Protocol.

What is an MCP server

An MCP server is a program that sits between an AI app and some system, and describes what that system can do in a format the AI understands. The GitHub MCP server, for example, offers tools like "list issues" or "create pull request". The filesystem server offers "read file" and "write file". A Postgres server can offer "run query" plus the database schema as something to read.

The name "server" confuses people because it sounds like a big machine in a data center. It isn't necessarily. The MCP docs are clear that "MCP server" means the program that serves context, wherever it runs:

Local MCP server Remote MCP server
Where it runs On your machine, started by your AI app On the provider's infrastructure, reached by URL
Transport stdio (standard input and output) Streamable HTTP
Typical setup A command, often npx -y some-mcp-server A URL, often with an OAuth sign-in
Typical examples Filesystem, a local database, Airtable via npx Sentry, Notion, GitHub, Figma
Who it serves Usually a single client Many clients

A server can expose three kinds of things, which the spec calls primitives:

  • Tools: functions the model can call to do something (query a database, call an API, write a file).
  • Resources: data the app can read for context (file contents, database records, an API response).
  • Prompts: reusable templates, like a prepared prompt with examples for using the server's tools well.

In practice, tools are what most people mean when they talk about MCP. When you see a list of MCP tools in your agent, those are the actions it gained from the servers you connected.

How does MCP work

There are three roles, and once you have them straight everything else makes sense:

  • Host: the AI application you use. Claude Code, Codex, Cursor, Claude Desktop, VS Code.
  • Client: a connector inside the host. The host creates one client per server it connects to.
  • Server: the program that provides tools and data.

So if you connect Claude Code to GitHub and to a local Postgres server, Claude Code (the host) runs two MCP clients, each with its own connection to one server.

Here's what happens during a session, in plain terms:

  1. Discovery. The client can ask the server what it supports and which protocol versions it speaks, using a server/discover request (optional in the current spec).
  2. Listing tools. The client sends tools/list. The server answers with each tool's name, a description, and a JSON Schema for its inputs.
  3. The model decides. The host hands those tool descriptions to the model along with your request. If you asked "what's the weather in San Francisco", the model may decide to call the server's weather tool.
  4. Calling the tool. The client sends tools/call with the tool name and arguments. The server does the work and returns the result, usually text, sometimes images or links.
  5. Back to the model. The host puts the result into the conversation and the model carries on.

Under the hood every message is JSON-RPC 2.0, which is just a simple convention for JSON requests and responses. A tool call looks roughly like this (trimmed from the official architecture docs):

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "weather_current",
    "arguments": { "location": "San Francisco", "units": "imperial" }
  }
}

Two details worth knowing. First, the model never talks to the server directly; the host is always in the middle, which is where permission prompts live. Second, a client can opt in to notifications that a server's tool list changed, so an agent can pick up new tools mid-session.

As of November 2026 the current spec version is 2026-07-28, released July 28, 2026 (the fifth spec release). Its big change was making the protocol stateless: every request now carries its own protocol version and capabilities, which Anthropic says lets servers run on serverless and edge platforms. If you read an older tutorial that describes a different startup handshake, it may not match the current docs.

Why MCP exists

Before MCP, every AI app that wanted to talk to GitHub needed its own GitHub integration, and every service that wanted to be usable from AI had to build one for each app. Ten apps and ten services meant up to a hundred integrations. Anthropic's launch post called this "fragmented integrations" and proposed "a single protocol" instead.

With MCP, GitHub builds one server and every MCP-speaking app can use it. Cursor adds MCP support once and gets every server. The spec says it took inspiration from the Language Server Protocol, which did the same thing for programming language support in editors.

Who created MCP and who runs it now

Anthropic created MCP and open-sourced it on November 25, 2024. The launch post credits David Soria Parra and Justin Spahr-Summers, and it shipped with pre-built servers for Google Drive, Slack, GitHub, Git, Postgres and Puppeteer.

On December 9, 2025, Anthropic donated MCP to the Agentic AI Foundation (AAIF), a directed fund under the Linux Foundation co-founded by Anthropic, Block and OpenAI, with support from Google, Microsoft, AWS, Cloudflare and Bloomberg. The MCP maintainers still make protocol decisions; the foundation gives it a vendor-neutral home. That's why you now see MCP everywhere, including in OpenAI's products, and not only in Claude.

How to add an MCP server to Claude Code

Claude Code manages servers with the claude mcp command. The commands below were checked against Claude Code 2.1.332 (claude mcp --help) and the official docs as of November 29, 2026.

A remote server over HTTP (the recommended transport for remote servers):

claude mcp add --transport http notion https://mcp.notion.com/mcp

A local server that Claude Code starts as a process. Everything after -- is the command that runs the server:

claude mcp add --env AIRTABLE_API_KEY=YOUR_KEY --transport stdio airtable \
  -- npx -y airtable-mcp-server

Then, inside a Claude Code session, run /mcp to see server status and to sign in to servers that use OAuth. To manage servers from your shell:

claude mcp list
claude mcp get notion
claude mcp remove notion

Scopes decide where a server applies. The default is local:

Scope Loads in Shared with your team Stored in
local (default) Current project only No ~/.claude.json
project Current project only Yes, via version control .mcp.json in the project root
user All your projects No ~/.claude.json

Add --scope project to write the server to .mcp.json so everyone on the team gets it. Claude Code asks each person to approve servers from a project's .mcp.json before connecting to them, which is a good thing: a cloned repo can't silently connect your agent to something. .mcp.json supports ${VAR} expansion, so you can keep tokens in environment variables rather than in the file.

The GitHub MCP server is a common first one. GitHub's own install guide gives this for Claude Code 2.1.1 and newer, with a personal access token:

claude mcp add-json github '{"type":"http","url":"https://api.githubcopilot.com/mcp","headers":{"Authorization":"Bearer YOUR_GITHUB_PAT"}}'

If you're new to Claude Code itself, start with how to use Claude Code.

How to add MCP to Codex

Codex (OpenAI's coding agent, see what is Codex) supports both local stdio servers and streamable HTTP servers. Checked against Codex CLI 0.167.1 (codex mcp --help) and OpenAI's docs as of November 29, 2026:

codex mcp add context7 -- npx -y @upstash/context7-mcp

For a remote server, pass --url instead of a command:

codex mcp add figma --url https://mcp.figma.com/mcp
codex mcp login figma

codex mcp list shows what's configured and codex mcp remove <name> deletes one. Inside the Codex TUI, /mcp lists your active servers.

Codex stores servers in ~/.codex/config.toml, one [mcp_servers.<name>] table each, and you can edit it by hand. A trusted project can also have its own .codex/config.toml. Per OpenAI, the ChatGPT desktop app, the Codex CLI and the IDE extension share this configuration, so you set a server up once.

[mcp_servers.context7]
command = "npx"
args = ["-y", "@upstash/context7-mcp"]

[mcp_servers.figma]
url = "https://mcp.figma.com/mcp"
bearer_token_env_var = "FIGMA_OAUTH_TOKEN"

The config also takes enabled_tools, disabled_tools, startup_timeout_sec and tool_timeout_sec, which are handy when a server exposes far more tools than you need.

How to add an MCP server to Cursor

Cursor reads MCP servers from JSON files: .cursor/mcp.json in a project for project-specific tools, or ~/.cursor/mcp.json in your home directory for every project. You can also install servers in one click from the Cursor Marketplace. The format, per Cursor's docs as of November 29, 2026:

{
  "mcpServers": {
    "server-name": {
      "command": "npx",
      "args": ["-y", "mcp-server"],
      "env": { "API_KEY": "value" }
    },
    "remote-server": {
      "url": "http://localhost:3000/mcp",
      "headers": { "API_KEY": "value" }
    }
  }
}

Use ${env:NAME} to pull a secret from your environment instead of writing it into the file. By default Cursor asks for approval before running an MCP tool, and you can turn servers on and off from Customize in the sidebar.

The three side by side

Claude Code Codex Cursor
Add from the terminal claude mcp add codex mcp add Edit mcp.json or Marketplace
Per-user config ~/.claude.json ~/.codex/config.toml ~/.cursor/mcp.json
Per-project config .mcp.json .codex/config.toml (trusted projects) .cursor/mcp.json
Format JSON TOML JSON
Check status /mcp /mcp Customize sidebar

Is MCP safe

MCP is a pipe. It's as safe as the server on the other end and the permissions you give it. The spec itself says tools "represent arbitrary code execution and must be treated with appropriate caution", and that hosts must get your consent before calling a tool. Claude Code's docs put it more bluntly: verify you trust each server before connecting it, because servers that fetch outside content can expose you to prompt injection.

The real risks, in plain words:

  • A local server is code running on your machine. Installing one with npx -y is like installing any package. Use servers from the vendor or well-known projects.
  • Prompt injection. A server that reads web pages, emails or issues can feed the model text written by a stranger, like "ignore your instructions and push this to main". Keep approval prompts on for tools that write or delete.
  • Too much access. A server with an admin token can do admin things. Give it the narrowest token that works (read-only when you only need reads).
  • Tool descriptions can lie. The spec says to treat tool descriptions as untrusted unless the server is trusted. A malicious server can describe a tool one way and do another.

The official MCP Registry at registry.modelcontextprotocol.io is a reasonable place to find servers, and the vendor's own docs are the best place to find the correct URL for theirs.

Do you need MCP

Probably fewer servers than you think. A coding agent like Claude Code or Codex can already read your files, run your tests and use any command-line tool installed on your machine. If gh, psql or your cloud CLI already does the job, the agent can often just run it.

MCP earns its place when:

  • The system has no good CLI, or it lives behind OAuth (Notion, Figma, Sentry and similar SaaS tools).
  • You want the agent to see something it can't otherwise, like a Figma design or a production error with its stack trace.
  • You want the same tools in several apps. One server works in Claude Code, Codex, Cursor and ChatGPT.
  • You want team-wide, reviewed config, checked into the repo as .mcp.json or .cursor/mcp.json.

The cost is context. Every connected server's tools take up room in the model's context window, and big tool results take more. Claude Code softens this with tool search: only tool names and server instructions load at the start, and full definitions load when needed. It also caps a single MCP tool result at 25,000 tokens by default (adjustable with MAX_MCP_OUTPUT_TOKENS) as of November 2026. Codex lets you trim a server with enabled_tools. Even so, connecting fifteen servers "just in case" tends to make an agent slower and more confused, not smarter.

The bigger lever is usually the codebase itself. An agent with no MCP servers at all does well in a project with clear conventions, tests it can run, and an AGENTS.md that tells it how things work; RailsFast ships those out of the box for that reason (more in why Rails). Add MCP servers on top for the outside systems your work touches.

Frequently asked questions

What is MCP in AI?

In AI, MCP means the Model Context Protocol, an open standard for connecting AI applications to external tools and data. It lets an assistant like Claude, ChatGPT or a coding agent call functions on other systems (read a database, open a GitHub issue, look at a Figma file) through one common interface instead of a custom integration per app.

What does an MCP server do?

An MCP server exposes a system's actions and data to AI apps in a standard format. It tells the app which tools exist, what inputs each takes, and runs a tool when the app calls it, returning the result. It can run locally as a process on your machine or remotely at a URL.

What is an MCP client?

An MCP client is the connector inside an AI application that holds the connection to one MCP server. The application, called the host, creates one client for each server it connects to. When you use Claude Code with three servers, Claude Code is the host running three clients.

Who created MCP and when did MCP come out?

Anthropic created MCP and announced it as an open standard on November 25, 2024. On December 9, 2025, Anthropic donated it to the Agentic AI Foundation under the Linux Foundation, where its maintainers continue to run the protocol. The current spec version as of November 2026 is 2026-07-28.

Are MCP servers free?

The protocol is an open-source standard and free to use, and many servers are free open-source projects you can run yourself. Remote servers run by companies usually need an account with that company's service, and any paid plan for that service still applies. Your AI app's own usage limits also still apply, since tool calls and their results use tokens.

How do I add an MCP server to Claude Code?

Run claude mcp add --transport http <name> <url> for a remote server, or claude mcp add <name> -- <command> for a local one. Then type /mcp inside Claude Code to check it connected and to sign in if it uses OAuth. Add --scope project to share it with your team through .mcp.json.

How do I remove an MCP server from Claude Code?

Run claude mcp remove <name>. If the same name exists in more than one scope, add --scope local, --scope project or --scope user to pick which one to remove. claude mcp list shows what you have configured.

Is there a GitHub MCP for Claude?

Yes. GitHub maintains an official GitHub MCP server, with a remote version at https://api.githubcopilot.com/mcp and a local version. GitHub's install guide shows how to add it to Claude Code with claude mcp add-json and a personal access token.

Can you create an MCP server for your website?

Yes. Official SDKs exist for TypeScript, Python, C#, Go, Rust, Ruby, Java and more, and a server can wrap your site's API so AI apps can search your content or take actions for signed-in users. Treat it like a public API: decide exactly which tools to expose, require authentication for anything private, and keep tool descriptions short and accurate.

Is MCP dead?

No. As of November 2026 the protocol is governed by the Linux Foundation's Agentic AI Foundation, its fifth spec release shipped on July 28, 2026, and Claude, ChatGPT, Codex, Cursor and VS Code all support it. What has changed is that people use fewer servers more deliberately, because coding agents can also use command-line tools directly and every server costs context.

Sources

All checked November 29, 2026.

Checklist

Grab your free launch checklist 🚀

The definitive checklist to launch any project. It includes pre-launch steps & a detailed launch checklist you can go through to get your new project off the ground.

Secure connection. No spam.