mcp-use TypeScript API
    Preparing search index...

    Interface OAuthProviderOptions

    Options for the browser implementation of the SDK OAuthClientProvider.

    interface OAuthProviderOptions {
        callbackUrl?: string;
        clientMetadataUrl?: string;
        clientName?: string;
        clientUri?: string;
        connectionUrl?: string;
        logoUri?: string;
        oauthProxyUrl?: string;
        onPopupWindow?: (
            url: string,
            features: string,
            window: Window | null,
        ) => void;
        preventAutoAuth?: boolean;
        proxyOAuthRequests?: boolean;
        scope?: string;
        staticClientInfo?: {};
        storageKeyPrefix?: string;
        useRedirectFlow?: boolean;
    }
    Index
    callbackUrl?: string

    OAuth redirect URI.

    clientMetadataUrl?: string

    HTTPS URL serving this public client's metadata document for CIMD.

    clientName?: string

    Human-readable OAuth client name.

    clientUri?: string

    Public website describing the OAuth client.

    connectionUrl?: string

    MCP proxy URL the transport connected to, used to re-anchor discovery.

    logoUri?: string

    Public OAuth client logo URL.

    oauthProxyUrl?: string

    Same-origin proxy endpoint for OAuth HTTP requests.

    onPopupWindow?: (url: string, features: string, window: Window | null) => void

    Called immediately before the provider opens an authorization popup.

    preventAutoAuth?: boolean

    Whether initial connection waits for an explicit authentication action.

    proxyOAuthRequests?: boolean

    When true (default), OAuth requests (.well-known metadata, token, registration, revocation, and introspection) are routed through oauthProxyUrl to bypass CORS. The routing is applied only to the scoped fetch returned by BrowserOAuthClientProvider.getProxyFetch; it never mutates the global fetch. Set to false to connect directly even when an OAuth proxy URL is available (e.g. when the MCP gateway already proxies OAuth).

    scope?: string

    OAuth scope string forwarded to the SDK via clientMetadata.scope.

    staticClientInfo?: {}

    Pre-registered OAuth client information. When set, the SDK skips Dynamic Client Registration and uses this client_id directly. Required for proxy-mode auth servers (e.g. Slack, WorkOS proxy) that strip registration_endpoint from metadata.

    storageKeyPrefix?: string

    Prefix used for persisted OAuth keys.

    useRedirectFlow?: boolean

    Whether authorization uses a full-page redirect instead of a popup.