@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
47 lines (46 loc) • 1.7 kB
TypeScript
import type { ClientType } from '../clients/types.js';
/**
* Command options for the init command
*/
export interface InitOptions {
client: ClientType;
scopes?: string[];
tools: string[];
readOnly?: boolean;
auth0Domain?: string;
auth0ClientId?: string;
auth0ClientSecret?: string;
interaction?: boolean;
}
/**
* Initializes the Auth0 MCP server with the specified client, tools and scopes.
*
* This function orchestrates the complete initialization process by:
* 1. Resolving and validating requested scopes
* 2. Obtaining authorization through the device flow
* 3. Configuring the selected client (Claude, Claude Code, Windsurf, Cursor, VS Code or Gemini CLI)
*
* @param {InitOptions} options - Configuration options including:
* - client: The target client type to configure ('claude', 'claude-code', 'windsurf', 'cursor', 'vscode' or 'gemini')
* - scopes: Optional scope patterns for authorization (will prompt if omitted)
* - tools: Tool patterns to enable (e.g., ['auth0_list_*'])
* - (no-)interaction: Should the CLI prompt the user to press return to open the browser
*
* @returns {Promise<void>} A promise that resolves when initialization is complete
*
* @throws {Error} If authorization fails or client configuration encounters an error
*
* @example
* // Initialize with Claude client and all tools
* await init({ client: 'claude', tools: ['*'] });
*
* @example
* // Initialize with Windsurf client and specific tools
* await init({
* client: 'windsurf',
* tools: ['auth0_list_*', 'auth0_get_*'],
* scopes: ['read:*']
* });
*/
declare const init: (options: InitOptions) => Promise<void>;
export default init;