Discovery Endpoints
Descope hosts a .well-known OpenID Connect discovery endpoint for each MCP server. This endpoint publishes OAuth metadata that MCP clients use to discover authorization endpoints, token endpoints, supported scopes, and other OAuth configuration details.
The discovery endpoint follows the OpenID Connect Discovery specification and includes standard OAuth 2.1 fields, plus MCP-specific extensions.
Discovery Endpoint Structure
The well-known endpoint returns a JSON document containing OAuth configuration metadata. Here's an example structure:
Field Descriptions
Standard OAuth Fields
These fields follow the standard OpenID Connect Discovery specification:
Note
The jwks_uri is the same for every MCP server within a Descope project, as the same private key is used to sign all JWTs created within your Descope project.
issuer: The unique identifier for the authorization server. Used to verify tokens and construct other endpoint URLs. The issuer URL is structured as:<Descope Base URL>/v1/apps/agentic/<Project ID>/<MCP Server ID>.
Note
The MCP Server ID is not modifiable once the MCP server is created.
jwks_uri: The URL of the JSON Web Key Set (JWKS) endpoint containing public keys for verifying signed tokens.authorization_endpoint: The endpoint where clients initiate the authorization flow.token_endpoint: The endpoint for exchanging authorization codes for access tokens.userinfo_endpoint: The endpoint for retrieving user information using an access token.scopes_supported: An array of scopes supported by the MCP server. This list is automatically updated based on the scopes you define in your MCP server configuration.claims_supported: An array of standard OAuth claims that may be included in tokens. Currently, this list cannot be modified and contains standard OpenID Connect claims such asiss,aud,sub,email,name, etc.revocation_endpoint: The endpoint for revoking access or refresh tokens.response_types_supported: Supported OAuth response types (always["code"]for authorization code flow).subject_types_supported: Supported subject identifier types (always["public"]).id_token_signing_alg_values_supported: Supported JWT signing algorithms (always["RS256"]).code_challenge_methods_supported: Supported PKCE code challenge methods (always["S256"]).
Conditional Fields (Based on MCP Client Registration Configuration)
registration_endpoint: The endpoint for Dynamic Client Registration (DCR). This field is only present when DCR is enabled for the MCP server. If DCR is disabled, this field will not appear in the discovery document.client_id_metadata_document_supported: A boolean indicating whether Client-Initiated Metadata Discovery (CIMD) is supported. This istruewhen CIMD is enabled, andfalsewhen CIMD is disabled.
OAuth Protected Resource Metadata
Note
The OAuth Protected Resource Metadata must be hosted by the MCP server developer, not by Descope. You'll need to host this JSON document at <MCP Server URL>/.well-known/oauth-protected-metadata on your MCP server.
MCP servers advertise their authorization server using OAuth Protected Resource Metadata. This metadata document is typically returned in the WWW-Authenticate header when an MCP server responds with a 401 Unauthorized error, or can be accessed via a well-known endpoint.
The protected resource metadata document references the Descope well-known discovery endpoint and provides resource-specific information:
Protected Resource Metadata Fields
authorization_servers: An array containing the issuer URL(s) of the authorization server(s) that can issue access tokens for this resource. Each URL in this array should correspond to theissuerfield from a well-known discovery document.bearer_methods_supported: The methods supported for presenting access tokens. Always["header"]for MCP servers, indicating tokens should be sent in theAuthorization: Bearer <token>header.resource: The URL of the protected resource (your MCP server URL).resource_documentation: (Optional) A URL pointing to documentation for the protected resource.scopes_supported: A subset of scopes supported by this resource. This may be a filtered list of the scopes defined in the well-known discovery document'sscopes_supportedfield.
Note
Depending on the MCP client you're using, the scopes_supported field may have to exactly match the scopes you've defined in your MCP server configuration, even though this is not required by the MCP specification.
Relationship to Well-Known Discovery Document
The protected resource metadata document references the well-known discovery endpoint through the authorization_servers field. MCP clients follow this workflow:
- Discover the protected resource metadata (via
WWW-Authenticateheader or well-known endpoint) - Extract the
authorization_serversURL(s) from the metadata - Fetch the well-known discovery document from each authorization server URL
- Use the discovery document to find OAuth endpoints (
authorization_endpoint,token_endpoint,jwks_uri, etc.) - Initiate the OAuth flow using the discovered endpoints
This two-step discovery process allows MCP servers to advertise their authorization server location independently of the detailed OAuth configuration, which is then fetched from the well-known discovery endpoint.
How MCP Clients Use the Discovery Endpoint
MCP clients use the discovery endpoint to:
- Discover OAuth endpoints without hardcoding URLs
- Understand supported scopes before initiating authorization
- Determine if DCR or CIMD is available via the
registration_endpointandclient_id_metadata_document_supportedfields - Verify token signing keys using the
jwks_uri - Understand supported authentication methods and algorithms
Here is a simplified sequence diagram of how MCP clients use the discovery endpoint:
The discovery endpoint enables MCP clients to integrate with your MCP server dynamically, adapting to configuration changes automatically.
Visit our MCP Servers documentation for more information on how to configure your MCP server and get this discovery document for your own server.