Skip to content

[Server] scope OAuth to resource server, not authorization server#382

Open
soyuka wants to merge 1 commit into
modelcontextprotocol:mainfrom
soyuka:adr/oauth-server-out-of-scope
Open

[Server] scope OAuth to resource server, not authorization server#382
soyuka wants to merge 1 commit into
modelcontextprotocol:mainfrom
soyuka:adr/oauth-server-out-of-scope

Conversation

@soyuka

@soyuka soyuka commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

Summary

We keep getting PRs that push the SDK toward becoming a full OAuth 2.1 authorization server — minting its own tokens, registering clients, running login/consent (i.e. being an IdP). The most explicit is #373 (~3,400 lines / 50+ files), but the direction has crept in incrementally.

This PR draws the line authoritatively and removes the surface signal that invites it. No behavior change — ADR + docblock + docs only.

Why a docs/ADR change instead of code

A scope doc alone won't stop these PRs. The real driver is the API surface: the SDK already exposes the authorization-server endpoints in proxy form (OAuthProxyMiddleware answers /authorize, /token, /.well-known/oauth-authorization-server; DCR landed in #269). From a contributor's seat the SDK looks ~60% of an AS, so #373 reads as "finishing the job."

So this does two things:

  1. Authoritative ruling (ADR 0001) — a single link to cite when declining AS/IdP PRs.
  2. Reframe the proxy surface — make OAuthProxyMiddleware's delegation-only intent unmistakable, so the leap to "issue tokens here" is no longer implied.

OAuth's three roles — the SDK implements one and a half

Role Status Scope
Resource Server (validate tokens, PRM, WWW-Authenticate) shipped in scope
Delegation/proxy to an upstream AS shipped (OAuthProxyMiddleware) in scope — delegation only
Authorization Server / IdP (issue tokens, consent) absent out of scope (this is #373)

Changes

Out of scope

php -l passes on the edited middleware. No markdown linter is configured in the repo.

Record ADR 0001: the MCP server is an OAuth 2.1 Resource Server that MAY
delegate to an upstream authorization server, and will NOT issue tokens or
act as an Identity Provider. Gives a single citable ruling to decline the
recurring "native authorization server" PRs (e.g. modelcontextprotocol#373).

Also remove the surface signal that invites them: reframe the
OAuthProxyMiddleware class docblock to lead with its delegation intent and
state explicit non-goals (never mints/signs/stores/rotates tokens), and add
a "Scope" section to docs/authorization.md describing the three OAuth roles
and what the SDK does not do.

No behavior change — docblock, docs, and ADR only.
@soyuka soyuka changed the title docs(adr): scope OAuth to resource server, not authorization server [Server] scope OAuth to resource server, not authorization server Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant