academy/mcp-authorizationfreeenglishinteractive

MCP authorization, from the first 401 to the Bearer token.

MCP Authorization. OAuth 2.1 for the Model Context Protocol, from the first 401 to the 2026-07-28 spec. How an MCP client that has never seen your server ends up with a short-lived, scoped token bound to it: OAuth 2.1 from scratch, the RFCs MCP builds on, what every revision changed, and the attack behind each rule. With hands-on labs and a quiz in every lesson.

7parts
46lessons
10interactive labs
~2 hof reading
who it is for

Anyone securing an MCP server or client

Developers who build or connect remote MCP servers over HTTP and need to understand the authorization flow, not just copy it. No prior OAuth knowledge needed: parts 1 and 2 build it from scratch.

the thread

Every rule has an attack behind it

PKCE, the resource parameter, the audience check, the iss comparison: each rule is taught next to the attack it stops, so you know what breaks when you skip it.

revision by revision

2024-11-05 to 2026-07-28

MCP authorization changed in every revision. Part 4 walks through each one and compares them, so you can tell which rules apply to the clients and servers you talk to.

curriculum

7 parts, 46 lessons.

Read in order, or jump in where you need it. Every lesson ends with a quiz; the exam draws from all of them, and the glossary defines every term.

the parts

What each part covers.

  1. 1

    Foundations: before OAuth

    Authentication vs. authorization, why a static token is not enough, the classic HTTP credentials, 401/403 with WWW-Authenticate, and discovery under /.well-known/.

    Start with 1.1 Authentication vs. authorization →5 lessons

  2. 2

    OAuth 2.1 from scratch

    The four roles, what OAuth 2.1 removed, access and refresh tokens, the authorization code grant with PKCE, client credentials, redirect_uri and state, scopes, and how a resource server validates a token.

    Start with 2.1 The four OAuth roles →10 lessons

  3. 3

    The satellite RFCs MCP relies on

    How a client gets a client_id, Authorization Server Metadata (RFC 8414), OpenID Connect Discovery, Protected Resource Metadata (RFC 9728), Dynamic Client Registration, Client ID Metadata Documents, Resource Indicators (RFC 8707) and iss (RFC 9207).

    Start with 3.1 Client identity: the client_id and how to get one →8 lessons

  4. 4

    MCP authorization, revision by revision

    Where authorization fits in MCP, the transports, the three valid paths, and what each revision changed: 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25 and 2026-07-28, compared side by side.

    Start with 4.1 What MCP is and where authorization fits →9 lessons

  5. 5

    Security: the attack behind each rule

    Code interception, token reuse across servers, token passthrough and the confused deputy, mix-up attacks, and the non-optional rules each one explains.

    Start with 5.1 Authorization code theft and interception →5 lessons

  6. 6

    In practice

    The complete flow end to end, building a protected MCP server and the client side, when a custom mechanism makes sense, and how to debug authorization errors.

    Start with 6.1 The complete flow, end to end →5 lessons

  7. 7

    Reference

    A cheat sheet of endpoints and parameters, a map of the RFCs and specifications, a non-optional checklist per revision, and the primary sources.

    Start with 7.1 Cheat sheet: endpoints and parameters →4 lessons

questions

Before you start.

Is OAuth mandatory in MCP?

No. Authorization is optional in MCP, and it only applies to HTTP transports (stdio servers take credentials from the environment). If an HTTP server does protect itself, the specification says it SHOULD conform to the MCP authorization rules, which are built on OAuth 2.1; a custom mechanism stays valid but generic clients cannot discover it.

If I already have an API key, why OAuth?

The Bearer header looks the same in both cases. The difference is everything before it: OAuth lets a client that has never seen your server discover who issues tokens, get the user's consent, and receive a short-lived token limited to some scopes and bound to one server, with no manual configuration.

What changed in MCP 2025-06-18?

The roles split: the MCP server became an OAuth resource server only, advertising its authorization servers through Protected Resource Metadata (RFC 9728). Clients must send the resource parameter (RFC 8707) and servers must reject tokens issued for someone else; token passthrough is forbidden.

Do I need to know OAuth before starting?

No. Parts 1 and 2 build HTTP authentication and OAuth 2.1 from scratch. If you already know OAuth well, start at part 3 (the RFCs MCP adds) or part 4 (the per-revision changes).

Want the specification, rule by rule?

The MCP Guide for Governance reads the whole protocol at the level of its normative requirements.