The authorization server URL obtained from the MCP Server's protected resource metadata, or the MCP server's URL if the metadata was not found.
Configuration options
OptionalfetchFn?: FetchLikeOptional fetch function for making HTTP requests, defaults to global fetch
OptionalprotocolVersion?: stringMCP protocol version to use, defaults to LATEST_PROTOCOL_VERSION
Promise resolving to authorization server metadata, or undefined if discovery fails
Discovers authorization server metadata with support for RFC 8414 OAuth 2.0 Authorization Server Metadata and OpenID Connect Discovery 1.0 specifications.
This function implements a fallback strategy for authorization server discovery: