mcp-use TypeScript API
    Preparing search index...

    Type Alias OAuthAuth<TUser>

    Per-request context passed to tool/resource/prompt callbacks.

    type OAuthAuth<TUser> = {
        accessToken: string;
        clientId?: string;
        expiresAt: number;
        payload: Record<string, unknown>;
        permissions: string[];
        resource?: URL;
        scopes: string[];
        user: TUser;
    }

    Type Parameters

    • TUser
    Index
    accessToken: string

    Raw bearer token for authenticated downstream requests.

    clientId?: string

    The OAuth client identifier from the token's client_id or azp claim; undefined when the identity provider's access tokens carry no client claim (e.g. WorkOS AuthKit, Supabase).

    expiresAt: number

    Access-token expiration as Unix time in seconds.

    payload: Record<string, unknown>

    Verified access-token claims or introspection data.

    permissions: string[]

    Provider-normalized permissions granted to the user.

    resource?: URL

    Resource audience the access token authorizes, when supplied.

    scopes: string[]

    OAuth scopes granted to the access token.

    user: TUser

    Authenticated application user mapped by the OAuth provider.