Skip to content
AI Agents in Production

MCP OAuth 2.1 versus OAuth 2.0 and earlier MCP revisions

From no authorization in 2024-11-05 to stateless OAuth 2.1 (2026-07-28): RFC 9728, 8707, 9207, CIMD vs DCR and AWS and Python SDK flaws.

Published Updated 12 min read
MCPsecurityaccess controlAI agentssoftware architectureproduction AI

This article is for informational and educational purposes only. It is not a security audit, a penetration test or a promise that your systems are free of vulnerabilities or defects. Versions, fixes and dates are current as of the date shown above. Check your vendor's and your distribution's advisories before you act. Any change you apply is your responsibility. No exploit code is provided. Only test systems you own or are authorised to test.

A single AI agent can talk to dozens of third-party MCP servers, and each one asks it for a token. All it takes is one server that does not check who the token is for, or a client that does not check which authorization server it is handing its credentials to, for someone to use your credentials where they should not. It has already happened at AWS and in the official Python SDK.

Cover: a timeline from 2024-11-05 to 2026-07-28 under the flow client, authorization server and MCP server; the client validates iss if present (RFC 9207), the MCP server validates aud, and the token travels with resource (RFC 8707) → aud and PKCE S256.
Conceptual illustration: from 2024-11-05 to OAuth 2.1, with the two key validation points.

In 30 seconds

  • MCP's HTTP authorization now rests on OAuth 2.1. In the 2026-07-28 revision, every protected MCP server is a stateless OAuth 2.1 Resource Server.
  • Two checks matter more than anything: the MCP server validates the token’s audience (aud), and the client validates the issuer, meaning that the metadata and iss come from the expected authorization server and that its credentials stay bound to it. Skipping the first caused CVE-2026-115413 at AWS. Skipping the second caused CVE-2026-115563 in the MCP Python SDK.
  • Dynamic client registration (RFC 7591) is deprecated. Client ID Metadata Documents (CIMD) replace it as the recommended default.

Four terms before we start

  • Resource Server: the server that holds the resource and accepts tokens. Here, the MCP server.
  • Authorization Server: the server that issues tokens, for example your company's identity provider (IdP).
  • Audience (aud): who a token is for. A token for server A should not work on server B.
  • Issuer (iss): who issued the token or code. The client checks it so it does not hand secrets to the wrong server.

Why the MCP model breaks classic OAuth

The first Model Context Protocol specification was published in November 2024. Back then, connecting a remote server had no HTTP authorization standard. Twenty months later, the 2026-07-28 revision turns every protected MCP server into a stateless OAuth 2.1 Resource Server, surrounded by IETF standards.

Those standards are built for a scenario that is rare on the classic web: one client or agent talking to dozens of different third-party servers. That “one client, many servers” pattern breaks common OAuth 2.0 assumptions.

A gap opens whenever either side skips its check: a client might trust whatever authorization server an MCP server advertises without checking the issuer, or an MCP server might accept any tenant token without checking the audience. In that setting, three attacks appear: credential redirection, token passthrough (forwarding the token received from the client to third parties) and confused deputy (a server tricked into abusing its privileges).

What OAuth 2.1 changes versus classic OAuth 2.0

MCP rests on OAuth 2.1, the IETF draft draft-ietf-oauth-v2-1-17. It was updated on 30 and 31 October 2026, with an IESG milestone in December 2026. The MCP revisions cite draft -12 in 2025-03-26 and -13 since 2025-06-18.

OAuth 2.1 consolidates RFC 6749, RFC 6750 and the security best practices of RFC 9700 (BCP 240, January 2025). For desktop agents, CLIs and SaaS connectors, the difference is direct:

  • PKCE (RFC 7636). Before: optional in the base standard, and the plain method was allowed. Now: mandatory on Authorization Code (with very narrow exceptions for confidential clients) and only with the S256 method; plain is forbidden. In MCP: protects local and CLI clients against code interception on localhost callbacks.
  • Legacy flows (Implicit and ROPC). Before: included in RFC 6749. Now: both removed. In MCP: avoids tokens exposed in URL fragments and direct capture of passwords by a host (the application that runs the agent).
  • redirect_uri validation. Before: many servers accepted prefix matching. Now: exact string matching, except for a variable port on native-app loopback redirects. In MCP: it closes code diversion through open redirects.
  • Bearer tokens in the query string. Before: tolerated in RFC 6750. Now: forbidden; the Authorization: Bearer header is required. In MCP: avoids agent tokens leaking into HTTP proxy logs.
  • Refresh tokens for public clients. Before: no strict anti-reuse requirement. Now: sender-constrained tokens (RFC 8705 / RFC 9449) or rotation with reuse detection. In MCP: limits theft of persistent desktop sessions.
  • Issuer identification (mix-up attack). Before: absent from RFC 6749. Now: integrates RFC 9207 (the iss parameter) and the defenses of RFC 9700. In MCP: stops a malicious MCP server from redirecting codes or secrets between two authorization servers.

How the flow works today, step by step

This is the current flow (2026-07-28). The diagram marks where each party validates:

Diagram of the MCP 2026-07-28 OAuth flow between client, MCP server and authorization server: request without a token, 401 with WWW-Authenticate, RFC 9728 metadata, RFC 8414 or OIDC metadata validated by the client against the expected AS, authorization with resource (RFC 8707) and PKCE S256, response with iss that the client validates if present (RFC 9207), token with aud that the MCP server validates, ban on token passthrough and 403 insufficient_scope for step-up.
The MCP 2026-07-28 authorization flow: the client validates the issuer (metadata and iss if present) and the MCP server validates aud.
  • Discovery. The client calls an HTTP MCP server without a token. The server answers 401 Unauthorized with WWW-Authenticate, pointing to its Protected Resource Metadata document (RFC 9728). It lists the authorized authorization_servers and, where applicable, the minimum scopes_supported.
  • Issuer metadata. From that response, the client fetches the Authorization Server metadata through RFC 8414 or OpenID Connect Discovery 1.0 and verifies that its issuer matches the expected server (RFC 8414 §3.3).
  • A token for one server only. RFC 8707 (Resource Indicators) defines the resource parameter. MCP (since 2025-06-18) requires the client to send it with the MCP server's canonical URI, both in the authorization request and in the token exchange. The authorization server then issues a token bound to that MCP server in its aud claim, not a generic token reusable on other services.
  • No token passthrough. The specification explicitly forbids it: an MCP server must never forward the token received from the client to an external third-party API. If it needs to call another API, it gets its own independent token.
  • Permissions in steps (step-up). To avoid asking for too much from the first second, since 2025-11-25 the step-up flow (SEP-835) lets the server answer HTTP 403 with a challenge for the minimum scope needed in WWW-Authenticate (error="insufficient_scope", scope=...) when a specific operation needs more privileges. The specification recommends that the server include in scope the permissions already granted together with the new ones, so the client re-authorizes with that set without losing the previous ones.

How MCP authorization evolved: from 2024-11-05 to 2026-07-28

The MCP specification fixed the problems of its first authorization framework, the 2025 one, as it went. Each revision shows which control became mandatory:

Timeline of five MCP revisions: 2024-11-05 with no HTTP OAuth; 2025-03-26 first OAuth 2.1 framework with PKCE, RFC 8414 and DCR; 2025-06-18 RS/AS split with RFC 9728, RFC 8707 and aud validation; 2025-11-25 OIDC Discovery, step-up SEP-835 and CIMD recommended; 2026-07-28 stateless core, iss per RFC 9207, issuer-bound credentials and DCR deprecated.
Five MCP revisions, five security controls each one adds.
  • 2024-11-05. No HTTP OAuth framework: only general principles of consent and tool security, with an initial stateful HTTP+SSE transport. Risk covered: minimal (local STDIO environments or manual trust).
  • 2025-03-26. First OAuth 2.1 framework: introduces PKCE, RFC 8414 discovery, Dynamic Client Registration (RFC 7591, SHOULD) and the Streamable HTTP transport. Key limitation: the MCP server often acted as both Authorization Server and Resource Server, without RFC 9728 or RFC 8707.
  • 2025-06-18. Strict RS / AS split: the MCP server becomes an OAuth 2.1 Resource Server. It requires Protected Resource Metadata (RFC 9728) with WWW-Authenticate on 401 responses. It requires Resource Indicators (RFC 8707) with a canonical URI. It requires aud validation and forbids token passthrough to upstream APIs. It adds the formal Security Best Practices guide.
  • 2025-11-25. Wider discovery and the move to CIMD: adds OpenID Connect Discovery 1.0, the .well-known fallback for RFC 9728 (SEP-985) and step-up consent through WWW-Authenticate (SEP-835). It recommends Client ID Metadata Documents (CIMD, SEP-991) and keeps DCR optional. It requires HTTP 403 for invalid Origin headers on Streamable HTTP.
  • 2026-07-28. Stateless core and a defense against the mix-up attack. It removes the initialize handshake and Mcp-Session-Id, and adds the Mcp-Method and Mcp-Name headers for routing and authorization in gateways. It recommends that the authorization server emit iss (SHOULD, advertising authorization_response_iss_parameter_supported if it does) and requires the client to validate iss if present, per RFC 9207 (SEP-2468). It requires declaring application_type in DCR (SEP-837) and binds persisted credentials to the issuer (SEP-2352). It deprecates DCR (RFC 7591, kept as a MAY option for at least 12 months) in favor of CIMD (SHOULD). And it consolidates the extensions framework (Tasks, MCP Apps, Enterprise Managed Authorization / EMA).

From dynamic registration (RFC 7591) to CIMD and Enterprise Managed Authorization

Dynamic client registration (DCR, RFC 7591, published in July 2015) lets a new client register itself through POST /register, with no manual step. MCP adopted it as a recommended option (SHOULD) in the 2025-03-26 revision.

The 2026-07-28 changelog does not publish an official list of reasons for retiring it. But in practice, and in specific sections of the specification itself, two sources of friction became clear:

  • Rejected localhost redirect_uri values for CLI or desktop clients when the server assumed application_type web. This was resolved as a MUST requirement in SEP-837.
  • Room for confused deputy attacks on proxy MCP servers that mixed dynamic registrations with a static client_id toward third parties.

The 2026-07-28 revision deprecates DCR (RFC 7591). It keeps it as a compatibility option (MAY) for a minimum window of 12 months. And it makes Client ID Metadata Documents (CIMD) the recommended default (SHOULD). CIMD is an active IETF draft, draft-ietf-oauth-client-id-metadata-document-03, dated 2 November 2026; the MCP specification references draft -00.

With CIMD, the client's client_id is itself an HTTPS URL under its control. That URL returns a JSON document with its metadata and redirect_uris. The stateful prior registration disappears, and the Authorization Server must apply strict SSRF controls and per-domain trust policies.

In companies with SSO, the Enterprise Managed Authorization (EMA) extension comes in. Anthropic documents it for auto-connect connectors on Team and Enterprise. It avoids individual OAuth consent through signed JWT assertions (based on the Identity Assertion JWT Authorization Grant, ID-JAG), issued by the company's identity provider or by the issuer assigned to the organization in Claude.

Two real flaws: no audience check (CVE-2026-115413) and no issuer check (CVE-2026-115563)

The rules in RFC 8707 (audience), RFC 8414 §3.3 (metadata issuer) and SEP-2352 (issuer-bound credentials) are not theory. Two recent advisories show what happens when a single check is missing.

No audience validation: AWS bulletin 2026-152-AWS (CVE-2026-115413 / GHSA-4prq-p2x5-w9fh, 27 October 2026; 7.8 in CVSS 3.1, local vector AV:L, and 7.3 in CVSS 4.0).

  • What failed: AWS API MCP Server (versions >= 1.3.0 and < 1.6.0), on the streamable-http transport with AUTH_TYPE=oauth, verified the token's signature, issuer and expiry, but not its audience.
  • Consequence: it accepted any token issued by the tenant's same identity provider for a different application. A local caller with that token could make AWS API calls with the host's credentials.
  • Fix: version 1.6.0, which requires setting AUTH_AUDIENCE (or AUTH_CLIENT_ID for providers such as Amazon Cognito, whose access tokens carry no aud claim).

No issuer validation or credential binding: MCP Python SDK, CVE-2026-115563 / GHSA-qx49-fqc8-xw99 (advisory of 28 September 2026; CVE published on 16 November 2026; 7.5 in CVSS 3.1 for unattended flows and 6.5 for interactive ones).

  • What failed: in mcp.client.auth, versions 1.9.1–1.29.1 had no issuer check or credential binding on any path. Versions 2.0.0a1–2.1.1 skipped them in the fallback without Protected Resource Metadata or on 403 insufficient_scope responses. In addition, ClientCredentialsOAuthProvider and PrivateKeyJWTOAuthProvider did not bind their credentials to the legitimate issuer.
  • Consequence: a malicious MCP server could divert the client to its own endpoint and capture client_secret, codes, the PKCE code_verifier or signed JWT assertions.
  • Fix: versions 1.30.0 and 2.2.0, but you must pass issuer= explicitly. In 1.30.0, omitting it only emits a DeprecationWarning hidden by default; it will be mandatory in 3.0. You must also manually delete stored registrations without issuer, which remain unbound.

Opinion: the jump from 2025-03-26 to 2026-07-28 finally turns MCP authorization into an architecture consistent with OAuth 2.1. But most real deployments still mix SDKs with fallback bugs, IdPs that omit aud and servers that still depend on DCR without isolation. In any agent audit, checking aud on the server and iss on the client should be the first filter, before reviewing prompts or tools.

Audit checklist for MCP servers and clients in production

  • HTTP MCP servers: publish Protected Resource Metadata (RFC 9728) and require resource-bound tokens through RFC 8707. Before every operation, verify signature, expiry, issuer and aud (or client_id if the IdP does not emit aud).
  • Forbid token passthrough. Never forward the MCP client's bearer token to upstream APIs: exchange it or request the server's own credentials.
  • MCP clients: require PKCE S256, check the metadata issuer (RFC 8414 §3.3) and validate the returned iss parameter when present (RFC 9207) before redeeming codes. Bind every secret, JWT key or persisted registration to the exact issuer. In the Python SDK: update to >= 1.30.0 / >= 2.2.0, pass issuer= and clear earlier registrations without issuer.
  • Plan the move away from DCR (RFC 7591) toward CIMD or Enterprise Managed Authorization. Check that the server returns HTTP 403 for an invalid Origin header on Streamable HTTP.
  • Do not expose automatic OAuth authentication against unaudited servers from development workstations without isolating the client. The recent MCP Inspector advisories illustrate why.

FAQ

  • Must local MCP servers over STDIO use OAuth 2.1? No. In every revision since 2025-03-26, the MCP specification states that STDIO transports should not (SHOULD NOT) use this HTTP OAuth flow. They get their credentials from the environment instead.
  • Why did MCP 2026-07-28 deprecate Dynamic Client Registration (RFC 7591)? The specification does not publish a single official list of reasons. Our reading: stateful dynamic registration piled up operational friction, redirect_uri conflicts for CLI or desktop clients (addressed separately in SEP-837) and confused-deputy exposure on proxy servers (documented in the spec’s security considerations). Client ID Metadata Documents (CIMD) become the recommendation (SHOULD), and DCR stays as an option (MAY) for at least 12 months.
  • What is RFC 8707 and why does it prevent token misuse in MCP? RFC 8707 defines the resource parameter of Resource Indicators. MCP (since 2025-06-18) requires the client to send it with the target MCP server's canonical URI on /authorize and /token. The token is then restricted to that audience and cannot be used on another service.
  • Does updating the MCP Python SDK to 1.30.0 or 2.2.0 automatically protect ClientCredentialsOAuthProvider? Not on its own. The CVE-2026-115563 / GHSA-qx49-fqc8-xw99 advisory warns that, besides updating, you must pass the issuer= parameter to ClientCredentialsOAuthProvider or PrivateKeyJWTOAuthProvider and manually delete OAuth registrations stored earlier without issuer.

Related reading

Source registry

Let an agent prepare this. Your team approves it.

An agent can track advisories, check them against your versions and prepare the update for your team to review and apply. We design that workflow: scoped permissions, human approval before any change, and a log of every step. We do not audit or patch your systems.

Related posts

Cover: on Windows/WSL, the chain MCP server 401, authorization_endpoint with $(...) and open() is cut in Inspector 2.12.0 by open 11.0.0; below, as hardening, ≥ 2.16.0, http(s) only and Host allowlist.
AI Agents in Production

MCP Inspector: OAuth RCE, DNS rebinding, and how to audit it

Connecting the MCP Inspector CLI (2.0.0–2.11.0) to a malicious MCP server could run code on Windows or WSL with no further click after connecting, or expose your tokens through DNS rebinding in the web deployment. Update to 2.16.0 or later.

MCPsecurityvulnerability management
Read article

9 min read