MCP

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.

get/.well-known/oauth-protected-resource/mcp

Response

The Protected Resource Metadata document

resourcestring required

The canonical public URL of the protected resource

authorization_serversstring[] required

Issuer identifiers of the authorization servers that mint tokens for this resource

bearer_methods_supportedstring[] required

How a bearer token may be sent; the gateway reads the Authorization header only

Example response

{
  "resource": "https://gateway.example.com/mcp",
  "authorization_servers": [
    "https://keycloak.example.com/realms/inference-gateway-realm"
  ],
  "bearer_methods_supported": [
    "header"
  ]
}

Changes