mcp-use TypeScript API
    Preparing search index...

    Type Alias McpUserInfoState

    McpUserInfoState:
        | { status: "idle" }
        | { status: "loading" }
        | { claims: McpUserInfoClaims; issuer?: string; status: "available" }
        | {
            reason:
                | "not_authenticated"
                | "no_userinfo_endpoint"
                | "session_changed";
            status: "unavailable";
        }
        | { error: string; status: "error" }

    UserInfo is supplemental to the MCP connection and resolves independently.

    Type Declaration

    • { status: "idle" }
      • status: "idle"

        No UserInfo request is in progress.

    • { status: "loading" }
      • status: "loading"

        A UserInfo request is in progress.

    • { claims: McpUserInfoClaims; issuer?: string; status: "available" }
      • claims: McpUserInfoClaims

        Claims returned by the UserInfo endpoint.

      • Optionalissuer?: string

        Authorization server issuer from discovered metadata.

      • status: "available"

        UserInfo claims were returned.

    • {
          reason: "not_authenticated" | "no_userinfo_endpoint" | "session_changed";
          status: "unavailable";
      }
      • reason: "not_authenticated" | "no_userinfo_endpoint" | "session_changed"

        Why UserInfo is unavailable.

      • status: "unavailable"

        UserInfo cannot be fetched for this session.

    • { error: string; status: "error" }
      • error: string

        Failure message; call getUserInfo() to retry.

      • status: "error"

        The UserInfo request failed.