@modelcontextprotocol/sdk
    Preparing search index...

    Function getOAuthProtectedResourceMetadataUrl

    • Helper function to construct the OAuth 2.0 Protected Resource Metadata URL from a given server URL. This replaces the path with the standard metadata endpoint.

      Parameters

      • serverUrl: URL

        The base URL of the protected resource server

      Returns string

      The URL for the OAuth protected resource metadata endpoint

      getOAuthProtectedResourceMetadataUrl(new URL('https://api.example.com/mcp'))
      // Returns: 'https://api.example.com/.well-known/oauth-protected-resource/mcp'