OAuth 2.0 Protected Resource Metadata for the MCP endpoint
OAuth 2.0 Protected Resource Metadata (RFC 9728) for POST /mcp, which MCP 2026-07-28 requires every protected MCP server to publish so a client can discover the authorization server on its own instead of being handed a pre-configured token.
Served without a token - it is the one route besides /health that skips gateway auth, since a client fetches it precisely because it has no credentials yet. Every 401 from POST /mcp points here through the resource_metadata parameter of its WWW-Authenticate challenge.
Returns 404 unless AUTH_ENABLED=true and the MCP endpoint is exposed (MCP_ENABLED=true and MCP_EXPOSE=true): with no authorization server there is nothing to advertise.
resource is MCP_RESOURCE_URL when set, and otherwise the request scheme (honouring X-Forwarded-Proto) and Host with /mcp appended. Behind an ingress that rewrites either, set MCP_RESOURCE_URL to the canonical public URL clients use.
Tokens must be issued for that resource (RFC 8707): when the IdP stamps the resource indicator into aud, list the same value in AUTH_OIDC_AUDIENCE.
Response
The Protected Resource Metadata document
Example response
{
"resource": "https://gateway.example.com/mcp",
"authorization_servers": [
"https://keycloak.example.com/realms/inference-gateway-realm"
],
"bearer_methods_supported": [
"header"
]
}Changes
Changed in 1 of the 77 revisions of this API.1
- ○
endpoint added
endpoint-added
- ○