What is MCP? The Model Context Protocol, explained for developers

What is MCP? How the Model Context Protocol links AI apps to tools: roles, primitives, transports, OAuth, the 2026-07-28 spec, and the main security risks.

Published
Reading time
12 min read
Level
Intro
By
AI for Devs
TL;DR
  • What is MCP: the Model Context Protocol is an open standard, introduced by Anthropic in November 2024, that lets AI applications call tools, read data, and fetch prompts from any MCP server over JSON-RPC 2.0.
  • The current revision is 2026-07-28, as of November 16, 2026. It made MCP stateless: no initialize handshake, no sessions, and each request carries its own version and capabilities.
  • Servers offer tools, resources, and prompts. Elicitation is the only active client feature, and roots, sampling, and logging are deprecated.
  • Local servers use stdio, remote servers use Streamable HTTP, and remote authorization builds on OAuth 2.1.
  • Use plain function calling when one app owns one integration, and MCP when two or more hosts need the same tools.

MCP, the Model Context Protocol, is an open standard for connecting AI applications to the tools, data, and prompt templates they work with. In practical terms, the answer to what is MCP is the reason Claude Code, Cursor, VS Code, and ChatGPT can all use one server written once, with no custom integration for each host. This explainer covers the protocol, from its roles and primitives to the 2026-07-28 revision and its security risks. To write a server yourself, follow the MCP server guide.

#What is MCP

MCP is an open protocol that standardizes how an AI application gets context from outside systems: tools to call, data to read, and prompts to offer. Messages are JSON-RPC 2.0, and the specification defines three participants: hosts, clients, and servers. MCP takes inspiration from the Language Server Protocol, which lets one language server work in many editors.

Anthropic announced MCP on November 25, 2024, with prebuilt servers for Google Drive, Slack, GitHub, Git, Postgres, and Puppeteer. On December 9, 2025, Anthropic donated the protocol to the Agentic AI Foundation, a directed fund under the Linux Foundation that it co-founded with Block and OpenAI. The MCP glossary entry has a one-paragraph version.

#The integration problem MCP solves

MCP turns an N-times-M integration problem into N plus M. Without a shared protocol, 4 hosts and 6 services need 24 connectors, one for each pair. With MCP, each host implements a client and each service ships a server: 10 implementations, and a fifth host reaches all 6 services by adding one client.

Four hosts and six services need 24 custom connectors without a shared protocol, and 10 implementations with MCP: one client per host and one server per serviceWithout a shared protocolClaude CodeCursorVS CodeChatGPTGitHubPostgresSlackGoogle DriveSentryYour API4 hosts × 6 services = 24 connectorsWith MCPClaude CodeMCP clientCursorMCP clientVS CodeMCP clientChatGPTMCP clientMCPGitHubPostgresSlackGoogle DriveSentryYour API4 clients + 6 servers = 10 implementationsLines are code someone writes and maintains. At run time each host still opens one connection per server.
Fig. 1Without a shared protocol, the connector count grows as hosts times services. With MCP, it grows as hosts plus services, because each side implements the protocol once.

The work also moves to the team that owns the service, which publishes its MCP server once instead of each host vendor writing a connector. The cost is a new trust boundary, because the host now runs code and reads text from servers it did not write.

#Hosts, clients, and servers

An MCP host is the AI application, an MCP client is the connector the host creates for one server, and an MCP server is the program that provides context. In the example from the architecture overview, VS Code creates one client for a Sentry server and another for a local filesystem server.

The host keeps the conversation and the model, collects user consent, and decides what reaches each server. The spec's design principles say a server should not read the whole conversation or see into other servers.

The client optionally calls server/discover and lists tools, the host sends the tool schemas to the model, the model returns a tool call, the user approves it, the client sends tools/call with its version and capabilities, and the result goes back to the modelModelreturns tool callsHost and MCP clientholds the conversationMCP serverweatherserver/discover (optional)versions and capabilitiestools/listtool schemas, cacheablemessages + tool schemastool call: get_forecastUser approves the callhost shows the argumentsNo conversation hereone request at a timetools/call + _meta: version, capsresult, resultType: completetool result addedSolid lines carry a request or result. Dashed lines are optional, and their replies can be cached.
Fig. 2One tool call on a 2026-07-28 connection. The model only returns a tool call, the host asks the user, and the server sees a single self-contained request with no conversation attached.

The model never talks to a server. It returns a tool call, and the host's client turns that into a tools/call request, the same loop an AI agent runs. Each connected tool's schema also takes room in every model request, which is why context engineering matters once a host connects many servers.

#MCP primitives: tools, resources, prompts, and client features

Servers offer three primitives, each with a different controller: the model controls tools, the application controls resources, and the user controls prompts. Client features run the other way, with the server asking the client for something. In revision 2026-07-28, elicitation is the only client feature that is not deprecated.

PrimitiveOffered byWho controls itMain methodsStatus in 2026-07-28
ToolsServerModeltools/list, tools/callActive
ResourcesServerApplicationresources/list, resources/readActive
PromptsServerUserprompts/list, prompts/getActive
ElicitationClientUserelicitation/create, inside an input_required resultActive
SamplingClientClientsampling/createMessageDeprecated
RootsClientClientroots/listDeprecated

Tools are functions with a JSON Schema for their inputs, such as creating a ticket. Resources are data addressed by URI, and a resource template such as weather://forecast/{city}/{date} covers a family of them. Prompts are templates a person picks, often as slash commands.

Elicitation asks the user for input through a form defined by a JSON schema, or through a URL to open. The elicitation page forbids form mode for passwords, API keys, access tokens, and payment credentials, which must use URL mode.

Sampling, roots, and protocol logging still work, and they are deprecated. The suggested replacements are direct calls to a model provider's API, directories passed as tool parameters or server configuration, and logs sent to stderr or OpenTelemetry.

#MCP transports: stdio and Streamable HTTP

MCP has two standard transports, and the JSON-RPC messages are the same on both. Use stdio when the host launches the server as a local subprocess, and Streamable HTTP when the server runs as its own service for many clients.

stdioStreamable HTTP
Who starts the serverThe host, as a subprocessYou, as a service
FramingOne JSON-RPC message per line on stdin and stdoutOne HTTP POST per message; the reply is JSON or an SSE stream
CredentialsEnvironment variablesOAuth 2.1 bearer tokens, when authorization is used
Rules in the specNothing but MCP messages on stdoutValidate Origin and return 403 if invalid; bind local servers to 127.0.0.1

On stdio, a stray print statement on stdout can corrupt the message stream, so logs go to stderr. On Streamable HTTP, the server exposes one endpoint, such as https://example.com/mcp, and checks the Origin header to block DNS rebinding, an attack that lets a remote website reach an MCP server on your machine.

Revision 2026-07-28 removed protocol sessions and the Mcp-Session-Id header, so a server no longer has to route a client back to the instance that holds its session. The older HTTP+SSE transport has been deprecated since 2025-03-26.

#MCP authorization with OAuth 2.1

MCP authorization is optional, covers HTTP transports, and builds on OAuth 2.1. A stdio server should not use it and reads credentials from its environment instead. A protected remote server is an OAuth resource server, and the MCP client is the OAuth client acting for the user.

A first connection to a protected server goes like this:

  1. The server answers an unauthenticated request with 401, and the client finds its Protected Resource Metadata (RFC 9728) through the WWW-Authenticate header or a well-known URL.
  2. That metadata names the authorization server, which the client discovers through OAuth metadata (RFC 8414) or OpenID Connect Discovery.
  3. The client identifies itself, preferably with a Client ID Metadata Document, because Dynamic Client Registration is deprecated in 2026-07-28.
  4. The user signs in, and the client sends the resource parameter (RFC 8707) so the token is bound to that one server.
  5. The server can ask for more scopes later with a new WWW-Authenticate challenge.

A server must reject any token that was not issued for it, and it must never forward a client's token to another API, an anti-pattern the security best practices call token passthrough. The MCP server guide turns these rules into a checklist.

#The current spec revision and MCP versioning

The current MCP revision is 2026-07-28, as of November 16, 2026. A version string is the date of the last backward-incompatible change. A Current revision can still get backward-compatible changes, and a Final one will not change.

MCP specification revisions on a time scale: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25, and the current 2026-07-28, followed by a deprecation window that ends no earlier than 2027-07-282024-11-05Initial revisionstdio and HTTP+SSE2025-03-26OAuth 2.1 authorizationStreamable HTTPTool annotations2025-06-18ElicitationStructured tool outputResource indicators2025-11-25URL-mode elicitationClient ID metadata docsExperimental tasks2026-07-28Stateless, no initializeserver/discover, MRTRSessions removedNov 16, 20262027-07-28Earliest removal ofroots, sampling,logging, and DCRFinal revisionCurrent revisionDeprecation window
Fig. 3Revisions on a time scale. Each label lists that revision's headline changes. Features deprecated in 2026-07-28 stay in the spec at least until the first revision released on or after July 28, 2027.

Revision 2026-07-28 made MCP stateless. The changelog removes the initialize handshake, so each request carries its protocol version and client capabilities in _meta, and every server must answer server/discover. A handler that needs input returns an input_required result, and the client retries the same call with the answers.

This exchange ran over stdio on November 16, 2026, against a one-tool server built with @modelcontextprotocol/server 2.4.0 on Node.js 26.12.1. Messages are reformatted from one line each:

request
JSON
{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "tools/call",
  "params": {
    "name": "get_forecast",
    "arguments": { "city": "Lisbon" },
    "_meta": {
      "io.modelcontextprotocol/protocolVersion": "2026-07-28",
      "io.modelcontextprotocol/clientCapabilities": {}
    }
  }
}
response
JSON
{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "content": [{ "type": "text", "text": "Lisbon: 14°C, light rain" }],
    "resultType": "complete",
    "_meta": { "io.modelcontextprotocol/serverInfo": { "name": "weather", "version": "1.0.0" } }
  }
}

The spec calls 2026-07-28 and later modern, and 2025-11-25 and earlier legacy. Its compatibility matrix says a modern-only client fails against a legacy server and a legacy client fails against a modern-only server. Dual-era clients probe with server/discover and fall back, so check both ends before you upgrade one.

Deprecated features stay in the spec for at least 12 months. Roots, sampling, logging, and Dynamic Client Registration become eligible for removal in the first revision released on or after July 28, 2027. New capabilities now ship as opt-in extensions that both sides must declare, such as Tasks for long-running work and MCP Apps for interactive UI.

#MCP support in hosts, APIs, and SDKs

Major AI assistants, coding agents, and model APIs support MCP, and official SDKs exist in 10 languages. The December 2025 foundation announcement cited more than 97 million monthly SDK downloads and 10,000 active servers. The table reflects each vendor's own docs on November 16, 2026.

Host or APITransports in its docsWhere you add a server
Claude Codestdio and HTTP; SSE marked deprecatedclaude mcp add, or .mcp.json in a project
Cursorstdio, Streamable HTTP, and SSE.cursor/mcp.json or ~/.cursor/mcp.json
VS Code with GitHub Copilotstdio, and HTTP or SSEMCP Servers in chat customizations, or a workspace .mcp.json
Gemini CLIstdio, Streamable HTTP, and SSEmcpServers in settings.json
ChatGPT and the Responses APIRemote servers by URLChatGPT Plugins, or an mcp tool with a server_url
Claude Messages APIRemote servers by URL, in betamcp_servers plus an mcp_toolset tool

The Tier 1 SDKs are TypeScript, Python, C#, Go, Rust, and Ruby, and each SDK adopts new revisions on its own schedule. Public servers are listed in the MCP Registry, a metadata catalog with a REST API for clients, and the platforms directory lists hosts by category.

#MCP vs function calling vs a REST API

MCP sits between function calling and a REST API and replaces neither. Function calling is the model API feature that returns a structured call for your code to run. A REST API is how a service is reached. MCP is how a host discovers a tool at runtime and sends the call to code someone else wrote.

QuestionFunction callingMCPREST API
Who defines the toolYour app, in each model requestThe server, through tools/listThe service, in docs or an OpenAPI file
Who runs the codeYour appThe MCP serverThe service
When the caller learns about itWhen you write the appAt runtimeWhen you write the client
Who can use itYour app, with one model APIAny MCP hostCode a developer wrote for it

In OpenAI's function calling guide, the model returns a function_call and your application runs it. An MCP host runs the same loop, with schemas from tools/list and execution on the server, and most MCP servers call a REST API inside.

Use plain function calling when one application talks to one model provider and owns the integration, because it is less code and easier to debug. Use MCP when two or more hosts need the same capability, or when people outside your team will connect their own agents.

#MCP security risks

MCP's main risks start where the host passes text from servers to the model, and the model's output can trigger actions. The spec overview says tools represent arbitrary code execution, hosts must get user consent before invoking any tool, and tool annotations are untrusted unless they come from a trusted server.

Tool poisoning hides instructions in a tool description that the model reads and the user usually does not see. On April 1, 2025, Invariant Labs showed a poisoned add tool that made Cursor send ~/.cursor/mcp.json and ~/.ssh/id_rsa to the attacker's server in a hidden argument. The post also describes rug pulls, where a description changes after approval, and shadowing, where one server's description changes how the agent uses another server's tools.

Prompt injection through tool output comes one step later, when an issue body or web page returned by a tool carries instructions that the model reads. The tools page says clients should validate tool results before passing them on, and the client best practices treat one server's results as untrusted input to another. OWASP ranks prompt injection first in its 2025 Top 10 for LLM applications.

Over-broad permissions widen what either attack can reach. A local server runs with the permissions of the user who starts it, and an OAuth token granted files:* up front lets whoever steals it reach unrelated data. The security best practices call for a minimal first scope plus step-up challenges, and OWASP files the general problem under excessive agency.

To limit that exposure:

  1. Read a server's launch command and tool descriptions before you approve it, and pin its version.
  2. Keep a person in the loop for tool calls that write, send, or delete.
  3. Give each host only the tools its task needs, with the smallest OAuth scopes that work.
  4. Log every tool call with its arguments.

#One MCP gateway in front of many servers

An MCP gateway is an AI gateway for tool traffic: hosts connect to it in place of each server, and it applies one set of rules to every call. Without one, a team with 4 hosts and 10 servers keeps 40 server entries and their credentials across host configs, and no single place records which tools an agent called.

Bifrost, an open-source AI gateway, fills that role and also routes model calls, so tool and model traffic share one set of keys and logs. It connects to servers over STDIO, HTTP, or SSE and exposes every connected tool through one /mcp endpoint, backed by an aggregated tool registry.

Hosts connect to one Bifrost /mcp endpoint, which authenticates the caller, keeps an aggregated tool registry, filters tools, authenticates to each upstream server, and records every call in MCP LogsBifrost /mcpAuthenticate the callervirtual key header or OAuth 2.1Aggregated tool registrytools from every connected serverFilter toolsserver list, request header, key allow-listAuthenticate upstreamper server: shared, OAuth, per-userClaude Codeone /mcp entryCursorone /mcp entryYour agentone /mcp entryGitHub serverper-user OAuthPostgres servershared headerInternal APItoken exchangeMCP Logseach tool call, prompt fetch, resource read, and roundExample setup. Hosts hold one gateway entry; each server's credentials and auth type live at the gateway.
Fig. 4With Bifrost as the MCP gateway, each host holds one entry. The gateway checks the caller, filters the registry down to the tools that caller may use, signs in to each server, and logs the call.

Clients authenticate to /mcp with a virtual key header or a browser OAuth 2.1 flow in which Bifrost is the authorization server. Upstream, each server gets its own auth type: none, shared headers, OAuth 2.0, per-user OAuth, per-user headers, or token exchange.

Tool filtering stacks three checks: the tools_to_execute list on each server connection, a per-request header, and the allow-list on each virtual key. A virtual key with no MCP configuration gets no tools unless a server is marked Allow by Default. Virtual MCPs bundle chosen tools from several servers behind one /mcp/<slug> URL.

Tool calls that a model returns through the Bifrost chat completions API do not run until the application executes them, unless Agent Mode auto-approves the tools it lists. MCP Logs records each tool call, and prompt fetches and resource reads are logged and governed the same way. On revision 2026-07-28, Bifrost passes input_required questions through to the client and logs each round.

Servers that people add on their own laptops never reach a gateway's config. For Bifrost Enterprise deployments, Bifrost Edge extends the gateway's governance to employee machines. It inventories the MCP servers configured in supported AI apps, enforces allow or deny decisions on each device, and routes that AI traffic through the Bifrost Gateway, so the same guardrails and audit logs apply.

#Questions

What does MCP stand for in AI?

MCP stands for Model Context Protocol, an open standard for connecting AI applications to tools, data, and prompt templates. Anthropic introduced it in November 2024, and since December 2025 it has been a project of the Agentic AI Foundation under the Linux Foundation. The acronym means other things in other fields, so add protocol or AI to your search.

Is MCP only for Claude?

No. Anthropic created MCP, but it is an open protocol with official SDKs in 10 languages. As of November 16, 2026, ChatGPT, the OpenAI Responses API, Cursor, VS Code with GitHub Copilot, Gemini CLI, and Claude products all document MCP support. A server you write once works in any host that supports its transport.

What is the difference between MCP and function calling?

Function calling is a model API feature: your application sends tool schemas with each request, the model returns a structured call, and your code runs it. MCP standardizes where those tools come from. A host fetches tool schemas from an MCP server at runtime and sends each call to that server. Hosts still use function calling internally to show MCP tools to the model.

Does MCP replace APIs?

No. Most MCP servers call an existing REST or GraphQL API on the inside. The API stays the contract for developers who write client code. The MCP server adds a layer for AI hosts, describing each operation with a JSON Schema the host reads at runtime and returning results as content a model can read. Keep the API and wrap only what agents need.

Is MCP secure?

MCP is as secure as the hosts and servers that implement it. The protocol defines OAuth 2.1 authorization for remote servers and requires user consent before tool calls, but it cannot enforce either. The main risks are tool poisoning, prompt injection through tool output, and tokens or local servers with more access than they need. Install only servers you trust.

What is the latest version of MCP?

The current MCP specification revision is 2026-07-28, as of November 16, 2026. It made the protocol stateless, added the required server/discover method, replaced server-to-client requests with input_required results, and deprecated roots, sampling, and logging. Earlier revisions are 2025-11-25, 2025-06-18, 2025-03-26, and 2024-11-05. Check which revision your SDK implements.