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

    Options for discovering the IdP's token endpoint and requesting a JWT Authorization Grant. Extends RequestJwtAuthGrantOptions with IdP discovery.

    interface DiscoverAndRequestJwtAuthGrantOptions {
        audience: string | URL;
        clientId: string;
        clientSecret?: string;
        fetchFn?: FetchLike;
        idpUrl: string | URL;
        idToken: string;
        resource: string | URL;
        scope?: string;
    }

    Hierarchy

    Index

    Properties

    audience: string | URL

    The authorization server URL of the target MCP server (used as audience in the token exchange request).

    clientId: string

    The client ID registered with the IdP for token exchange.

    clientSecret?: string

    The client secret for authenticating with the IdP.

    Optional: the IdP may register the MCP client as a public client. RFC 8693 does not mandate confidential clients for token exchange. Omitting this parameter omits client_secret from the request body.

    fetchFn?: FetchLike

    Custom fetch implementation. Defaults to global fetch.

    idpUrl: string | URL

    The IdP's issuer URL for OAuth metadata discovery. Will be used to discover the token endpoint via .well-known/oauth-authorization-server.

    idToken: string

    The identity assertion (ID Token) from the enterprise IdP. This should be the OpenID Connect ID Token obtained during user authentication.

    resource: string | URL

    The resource identifier of the target MCP server (RFC 9728).

    scope?: string

    Optional space-separated list of scopes to request for the target MCP server.