UNPKG

@auth0/auth0-mcp-server

Version:

Auth0 Model Context Protocol (MCP) Server (Beta) — A secure and extendable implementation of an MCP server that provides AI assistants with controlled access to the Auth0 Management API through natural language. This project is in beta and not intended fo

117 lines (116 loc) • 4.25 kB
/** * Service name used for keychain operations */ export declare const KEYCHAIN_SERVICE_NAME = "auth0-mcp"; /** * Keychain item keys for Auth0 related tokens and configuration * @readonly * @enum {string} */ export declare const KeychainItem: { /** Access token for Auth0 Management API */ readonly TOKEN: "AUTH0_TOKEN"; /** Auth0 tenant domain */ readonly DOMAIN: "AUTH0_DOMAIN"; /** OAuth refresh token for obtaining new access tokens */ readonly REFRESH_TOKEN: "AUTH0_REFRESH_TOKEN"; /** Timestamp when the current token expires */ readonly TOKEN_EXPIRES_AT: "AUTH0_TOKEN_EXPIRES_AT"; }; /** * Array of all keychain item keys for operations that need to process all items * @type {string[]} */ export declare const ALL_KEYCHAIN_ITEMS: ("AUTH0_TOKEN" | "AUTH0_DOMAIN" | "AUTH0_REFRESH_TOKEN" | "AUTH0_TOKEN_EXPIRES_AT")[]; /** * Type representing the result of a keychain operation */ export type KeychainOperationResult = { item: string; success: boolean; error?: Error; }; /** * Keychain service for securely storing Auth0 credentials * Provides type-safe methods for working with Auth0 tokens and settings */ declare class KeychainService { private serviceName; /** * Creates a new KeychainService instance * @param serviceName - The keychain service name to use */ constructor(serviceName?: string); /** * Store the Auth0 access token in the keychain * @param token - The access token to store * @returns A promise that resolves to true if successful, false otherwise */ setToken(token: string): Promise<boolean>; /** * Retrieve the Auth0 access token from the keychain * @returns A promise that resolves to the access token or null if not found */ getToken(): Promise<string | null>; /** * Store the Auth0 domain in the keychain * @param domain - The domain to store * @returns A promise that resolves to true if successful, false otherwise */ setDomain(domain: string): Promise<boolean>; /** * Retrieve the Auth0 domain from the keychain * @returns A promise that resolves to the domain or null if not found */ getDomain(): Promise<string | null>; /** * Store the Auth0 refresh token in the keychain * @param refreshToken - The refresh token to store * @returns A promise that resolves to true if successful, false otherwise */ setRefreshToken(refreshToken: string): Promise<boolean>; /** * Retrieve the Auth0 refresh token from the keychain * @returns A promise that resolves to the refresh token or null if not found */ getRefreshToken(): Promise<string | null>; /** * Store the token expiration timestamp in the keychain * @param timestamp - The expiration timestamp in milliseconds since epoch * @returns A promise that resolves to true if successful, false otherwise */ setTokenExpiresAt(timestamp: number): Promise<boolean>; /** * Retrieve the token expiration timestamp from the keychain * @returns A promise that resolves to the timestamp as a number or null if not found */ getTokenExpiresAt(): Promise<number | null>; /** * Delete all Auth0 related items from the keychain * @returns A promise that resolves to an array of results for each deletion operation */ clearAll(): Promise<KeychainOperationResult[]>; /** * Delete a specific item from the keychain * @param key - The key to delete * @returns A promise that resolves to true if successful, false otherwise */ delete(key: string): Promise<boolean>; /** * Internal method to store a value in the system keychain * @param key - The key to store the value under * @param value - The value to store * @returns A promise that resolves to true if successful, false otherwise * @private */ private set; /** * Internal method to retrieve a value from the system keychain * @param key - The key to retrieve * @returns A promise that resolves to the stored value or null if not found * @private */ private get; } export declare const keychain: KeychainService; export {};