skip to content

Security Model

Three key principles the protocol itself cannot enforce, the injection channel every server opens into the model context, and the OAuth 2.1 profile remote servers authorize with.

part ofAPI stylesoverview, primer and where to startread it →
on this pageshow

questions

21

In MCP, what OAuth 2.1 role does a remote server play, and what does it do with a token?

level: juniorimportance: must knowfreq 55%

basics

~20 s

A remote MCP server is an OAuth 2.1 resource server, never an authorization server. It issues no tokens and runs no login screen: it validates the bearer token presented on every HTTP request and rejects one not issued for itself.

open as a page

In MCP, why can't a client trust readOnlyHint to decide a tool call is safe?

level: juniorimportance: must knowfreq 62%

basics

~20 s

ToolAnnotations are self-reported labels written by the same server whose behaviour they describe. MCP revision 2026-07-28 requires clients to treat them as untrusted unless the server itself is trusted out of band, so they may shape the UI but never gate a call.

open as a page

What is a Client ID Metadata Document in MCP's OAuth profile?

level: middleimportance: must knowfreq 52%

basics

~20 s

A Client ID Metadata Document lets an MCP client use an HTTPS URL with a path as its client_id. The authorization server dereferences that URL to read the client's metadata — client_name, redirect_uris — with no prior registration.

open as a page

How does an MCP client discover which authorization server protects a remote MCP server?

level: middleimportance: must knowfreq 68%

basics

~20 s

Through RFC 9728 protected-resource metadata. The client fetches the document at the MCP server's /.well-known/oauth-protected-resource path and reads its authorization_servers field. A 401 may point there with WWW-Authenticate, but that challenge is optional, so the well-known fallback is mandatory.

open as a page

In MCP, why are tool names, descriptions and schemas an injection channel?

level: middleimportance: must knowfreq 70%

basics

~20 s

Everything a server sends about its tools — names, descriptions, schema field descriptions, annotations, and the content blocks a call returns — is rendered into the model's context so the model can choose and use the tool. Prose written there reads to the model exactly like instructions.

open as a page

Why must an MCP server reject a token that was not issued for it (token passthrough)?

level: seniorimportance: must knowfreq 72%

basics

~20 s

Because a token names an intended audience, and honouring one issued for a different service turns the MCP server into a place any stolen or borrowed token can be spent. MCP requires audience-bound tokens, requested with the RFC 8707 resource parameter and validated on arrival.

open as a page

How should an MCP client obtain a client_id, in priority order?

level: middleimportance: should knowfreq 44%

basics

~20 s

Prefer, in order: a pre-registered client_id arranged out of band; then a Client ID Metadata Document, an HTTPS URL used as the client_id; then RFC 7591 dynamic registration, deprecated in MCP 2026-07-28; and last, prompting the user for one.

open as a page

MCP mandates PKCE — what must a client check before starting an MCP authorization flow?

level: middleimportance: should knowfreq 50%

basics

~20 s

Before starting the flow, an MCP client must read the authorization server's metadata and confirm that code_challenge_methods_supported advertises S256. If that field is absent or lacks S256, the client must not proceed — there is no legal fallback to a flow without PKCE.

open as a page

How must an MCP client validate the iss parameter on an OAuth callback?

level: seniorimportance: should knowfreq 33%

basics

~20 s

Bind each authorization request to the issuer that was resolved for it: record that issuer with the request's state, and when the callback carries an iss value, compare it to the recorded string exactly. Any mismatch aborts the flow.

open as a page

Why is a static client_id unsafe in an MCP server that proxies OAuth?

level: seniorimportance: should knowfreq 38%

basics

~20 s

Because the upstream provider sees one client for every user. Once any user has approved it, the provider skips its consent screen on later requests, so an attacker who gets a callback registered can have a victim's authorization code delivered to them.

open as a page

An MCP tools/call needs a scope the token lacks — what should the server return?

level: seniorimportance: should knowfreq 42%

basics

~20 s

A 403 with error="insufficient_scope", not a JSON-RPC error and not a bare failure. The client then runs a fresh authorization flow asking for the extra scope and re-issues the same call as a brand-new request with a new JSON-RPC id.

open as a page

In MCP, how should a client handle two servers exposing the same tool name?

level: seniorimportance: should knowfreq 44%

basics

~20 s

MCP requires tool names to be unique only within one server, so collisions across servers are legal and expected. An aggregating client should prefix each name with its own identifier for that server — never with the server's self-reported serverInfo name.

open as a page

In MCP, what stops a server changing a tool's description after you approve it?

level: seniorimportance: should knowfreq 48%

basics

~20 s

Nothing in the protocol. MCP revision 2026-07-28 requires only that a server's tool set not vary per connection; it may change over time, and the spec defines no signature, pin or attestation. Detecting drift is entirely the client's job.

open as a page

Your remote MCP server fronts three downstream SaaS APIs — how do you design its credentials?

level: principalimportance: should knowfreq 33%

basics

~20 s

The incoming MCP token never leaves the server. Each upstream gets its own credential, held and rotated by the server, with the authenticated caller mapped onto the right upstream identity — and the MCP server's own scopes chosen so a token's power matches the damage it could do.

open as a page

How should an authorization server decide which MCP CIMD client_ids to trust?

level: principalimportance: nice to knowfreq 22%

basics

~20 s

A Client ID Metadata Document proves only control of its HTTPS URL, never who wrote it. Treat the document as unverified claims, show the URL rather than the display name, and grade privilege by how much you know about the client.

open as a page

How would you decide which third-party MCP servers an organization may connect?

level: principalimportance: nice to knowfreq 33%

basics

~20 s

Treat each server as untrusted code supplying text into a model's prompt. Tier servers by provenance, allowlist what may be connected, pin and diff their tool definitions, isolate low-trust servers from sensitive contexts, and scope their credentials so a compromise buys little.

open as a page