MCP TypeScript SDK (V2)
    Preparing search index...

    Context passed to AuthProvider.onUnauthorized when the server responds with 401. Provides everything needed to refresh credentials.

    interface UnauthorizedContext {
        fetchFn: FetchLike;
        response: Response;
        serverUrl: URL;
    }
    Index

    Properties

    fetchFn: FetchLike

    Fetch function configured with the transport's requestInit, for making auth requests.

    response: Response

    The 401 response — inspect WWW-Authenticate for resource metadata, scope, etc.

    serverUrl: URL

    The MCP server URL, for passing to auth or discovery helpers.