Book an Appointment

MCP Authorization with OAuth 2.1

Since the June 2025 specification revision, a protected MCP server is an OAuth 2.1 resource server with clearly separated roles. This deep dive explains the discovery chain, client registration, token rules and audience binding – and shows where implementations fail in practice.

Early MCP servers ran locally over stdio, with API keys in environment variables – for remote servers over HTTP, that model does not hold. That is why the MCP specification has defined an authorization model based on OAuth 2.1 since revision 2025-03-26: optional for the protocol as a whole, but a fixed set of rules once an HTTP transport implements it. Revision 2025-06-18 fundamentally sharpened the model – role separation, mandatory metadata discovery per RFC 9728 and RFC 8414, audience binding per RFC 8707 – and revisions 2025-11-25 and 2026-07-28 continue to evolve it. Practice lags behind: a credential audit of 5,200 MCP servers in October 2025 found only 8.5 percent OAuth usage – reason enough to understand the model and its pitfalls in detail.

The Essentials at a Glance

01

Role model: the MCP server as resource server

Since revision 2025-06-18, a protected MCP server acts as an OAuth 2.1 resource server: it accepts and validates access tokens but does not issue them itself; the MCP client acts as an OAuth client on the user's behalf. The authorization server is a separate role – it may be hosted alongside the resource server, but its implementation is out of scope for the specification. It was not always this way: revision 2025-03-26 effectively treated the MCP server as authorization server and resource server in one, with default endpoints /authorize, /token and /register directly on the MCP server. The formal separation relieves server operators and allows established identity providers instead of home-built token issuance.

02

Discovery chain: RFC 9728 and RFC 8414

The client locates the responsible authorization server at runtime instead of through configuration: to a request without a valid token, the MCP server responds with 401 Unauthorized and points via the WWW-Authenticate header to its Protected Resource Metadata (RFC 9728) – a mandatory document whose authorization_servers field names at least one authorization server. From there, the client fetches the Authorization Server Metadata per RFC 8414 (/.well-known/oauth-authorization-server) with authorize, token and registration endpoints; only then does the actual OAuth 2.1 flow begin. This runtime discovery replaces hard-coded configuration – crucial for agents that are assigned tools only at runtime. Revision 2025-11-25 adds OpenID Connect Discovery and a .well-known fallback without the header; revision 2026-07-28 adds issuer validation per RFC 9207 against mix-up attacks.

03

Client registration: RFC 7591 and CIMD

Because arbitrary MCP clients encounter arbitrary servers, manual client registration does not scale. Revision 2025-06-18 therefore recommends (SHOULD) Dynamic Client Registration per RFC 7591: the client registers itself at the registration endpoint and receives its own client_id – in practice usually as a public client without a client secret; alternatives are a pre-provisioned client ID or manual entry. Revision 2026-07-28, however, declares DCR deprecated and relies on the Client ID Metadata Documents (CIMD) introduced with revision 2025-11-25: URL-based client identities. At the same time, it clarifies that stored client credentials are bound to the issuing authorization server and must not be reused across server boundaries. DCR continues to work transitionally for compatibility reasons – new implementations should know both paths.

04

OAuth 2.1 ground rules: PKCE, headers, short lifetimes

OAuth 2.1 clears out insecure legacy features of OAuth 2.0: the implicit grant and password grant are removed, redirect URIs are matched only exactly, and PKCE is mandatory – MCP clients MUST implement PKCE, in practice with the S256 challenge method instead of “plain”. Access tokens belong in the Authorization header of every single request as bearer tokens and must never appear in the URI query string; all authorization server endpoints run over HTTPS, and redirect URIs are restricted to localhost or HTTPS. Refresh tokens for public clients must, under OAuth 2.1, be sender-constrained or one-time tokens with rotation. Common practical recommendations add short-lived access tokens of a few minutes plus reuse detection that revokes the entire token family when an old refresh token is reused.

05

Audience binding (RFC 8707) and the token passthrough ban

A token must be issued for exactly one MCP server: clients MUST send the resource parameter per RFC 8707 in the authorization and token request, specifying the canonical URI of the target server; the server MUST verify that it is the intended audience and reject foreign or expired tokens with 401. The passthrough ban is equally strict: an MCP server MUST NOT pass the token received from the client on to downstream APIs, but acts there as its own OAuth client with its own token. Otherwise the confused deputy problem looms – the server acts as a confused deputy with someone else's privileges, and the downstream API's rate limiting, monitoring and audit trail come to nothing. Proxy servers with a static client ID MUST additionally obtain separate user consent for every dynamically registered client, because reused consent cookies otherwise route authorization codes to attackers.

06

MCP07 in practice: findings and controls

The OWASP MCP Top 10 (version v0.1, beta – not a finalized standard) list this area as MCP07 “Insufficient Authentication & Authorization”. The real-world findings are sobering: Trend Micro found a total of 492 MCP servers exposed on the internet in 2025 without authentication or transport encryption, the Astrix audit counted 53 percent static API keys against only 8.5 percent OAuth, and CVE-2025-6514 in the npm package mcp-remote (CVSS 9.6) showed that manipulated OAuth discovery fields alone can trigger code execution. Effective controls start from the specification: OAuth 2.1 with PKCE and a separate authorization server, short-lived, audience-bound tokens instead of passthrough – with token exchange per RFC 8693 for upstream calls –, per-client consent in proxies and the MCP server as its own non-human identity in IAM. Two audit questions for internal audit and the board: is there a token passthrough anywhere in the chain – and how long does an agent token live?

Standards & Sources

The content on this page is based on the following publicly available guides and studies.

Model Context Protocol / Anthropic · 2025

Model Context Protocol – Spezifikation, Abschnitt Authorization (Revision 2025-06-18)

Normative basis: role model (resource server), RFC 9728 and RFC 8707 mandatory, PKCE requirement, token handling and passthrough ban.

Model Context Protocol / Anthropic · 2025

Model Context Protocol – Security Best Practices (Revision 2025-11-25)

Covers token passthrough, confused deputy including consent hardening, scope minimization and SSRF in OAuth metadata discovery.

Model Context Protocol Project · 2026

Model Context Protocol – Spezifikation, Changelog „Key Changes“ (Revision 2026-07-28)

Current revision: DCR deprecated in favor of Client ID Metadata Documents, issuer validation per RFC 9207, issuer-bound client credentials.

OWASP Foundation · 2025

OWASP Top 10 for Model Context Protocol, Version v0.1 (Beta)

MCP07 “Insufficient Authentication & Authorization”; early beta stage (pilot testing), not a finalized standard; CC BY-NC-SA 4.0.

JFrog Security Research · 2025

CVE-2025-6514 in mcp-remote (CVSS 9,6)

OS command injection via a manipulated authorization_endpoint field in the OAuth metadata; the package counted over 437,000 downloads (published 2025-07-09, fixed in 0.1.16).

Astrix Security · 2025

Credential-Audit über 5.200+ MCP-Server

As of October 2025: 8.5 percent OAuth usage, 53 percent static API keys or PATs, 79 percent handover via environment variables.

OAuth 2.1 in your MCP landscape?

We review your MCP authorization against the current specification – from the discovery chain through audience binding to passthrough testing – and support the implementation. Arrange a no-obligation conversation with our team.