MCP authorisation
The part of the MCP specification that protects remote servers with OAuth: the server acts as a resource server and accepts only bearer tokens issued for it.
In more detail
A request without a valid token gets 401 with a WWW-Authenticate header pointing to the server's protected resource metadata. The client runs an authorisation code flow with PKCE naming the server as the resource, identifying itself with a Client ID Metadata Document now that dynamic registration is deprecated. The server must never pass the token on to another API.
Related terms
- OAuth 2.0 — A framework for delegated authorization: a user lets an application call an API on their behalf without giving it their password.
- protected resource metadata — A JSON document, defined in RFC 9728, in which an OAuth-protected server names its authorisation servers and supported scopes.
- token passthrough — An anti-pattern in which a server accepts a client's token and forwards it to another service instead of getting its own.
- bearer token — A token that grants access to whoever presents it, sent as Authorization: Bearer <token>, without any further proof of identity.
Taught in
- Remote Servers And Trust — AI Engineering: LLM Apps, RAG & Agents