OAuth 2.0 Protected Resource Metadata
What is OAuth 2.0 Protected Resource Metadata?
OAuth 2.0 Protected Resource Metadata, defined in RFC 9728, lets a resource server such as an MCP server publish which authorization server issues valid tokens for it, discoverable from a 401 response alone. AdminKit's MCP server hardening checklist requires publishing it so unfamiliar clients can connect.
By AdminKit team, Netbase JSC · Updated
OAuth 2.0 Protected Resource Metadata, defined in RFC 9728 (current document status at its IETF Datatracker entry), is a JSON document a protected resource — such as an MCP server acting as an OAuth resource server — publishes at a well-known URL to tell a client which authorization server issues valid tokens for it, along with the scopes it supports and how it expects a bearer token to be presented — the full set of fields this document can carry is catalogued in IANA’s OAuth Protected Resource Metadata registry. Rather than a client needing this configuration in advance, the resource server returns a WWW-Authenticate header pointing to its metadata document whenever it rejects an unauthenticated request, so an unfamiliar client can discover how to authenticate from a single 401 response instead of failing with no path forward; MDN’s WWW-Authenticate reference describes that header as advertising the authentication methods that might be used to gain access to a resource. The MCP authorization specification requires an MCP server to publish this metadata specifically so a general-purpose MCP client can connect to a server it has never seen before and still complete the OAuth flow correctly, without the server’s operator and the client’s developer having coordinated configuration out of band; the current MCP authorization specification states that MCP servers MUST implement OAuth 2.0 Protected Resource Metadata and MCP clients MUST use it for authorization server discovery. The authorization server a client is pointed to in turn publishes its own OAuth 2.0 Authorization Server Metadata, the document that actually names its token endpoint and supported flows.
OAuth 2.0 Protected Resource Metadata is part of AdminKit’s AI agents & MCP cluster; the full AdminKit glossary lists other related terms.
Frequently asked questions
What does OAuth 2.0 Protected Resource Metadata let a resource server do?
Publish which authorization server issues valid tokens for it, along with its supported scopes, discoverable from a single 401 response.
How does a client discover this metadata?
The resource server returns a WWW-Authenticate header pointing to the metadata document whenever it rejects an unauthenticated request.
Why does MCP require servers to publish Protected Resource Metadata?
So a general-purpose MCP client can connect to a server it has never seen before and still discover which authorization server to use, without out-of-band coordination.
What document does the referenced authorization server publish in turn?
Its own OAuth 2.0 Authorization Server Metadata, naming its token endpoint and supported flows.
Sources
- RFC 9728 -- OAuth 2.0 Protected Resource Metadata
- RFC 6750 -- The OAuth 2.0 Authorization Framework: Bearer Token Usage
- IANA -- OAuth Protected Resource Metadata registry
- IETF Datatracker -- RFC 9728 document status
- MDN Web Docs -- WWW-Authenticate header
- Model Context Protocol specification -- Authorization