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

59 lines (58 loc) • 2.44 kB
/** * Result of writing credentials to file */ export interface CredentialsWriteResult { file_path: string; keys_written: string[]; file_created: boolean; } /** * Options for writing credentials */ export interface WriteCredentialsOptions { /** Full or relative path to the env file. Defaults to `.env.local` in the current working directory. */ filePath?: string; /** Whether to add the env file to .gitignore. Defaults to true. */ createGitignore?: boolean; /** Directory the resolved file path must stay within. Defaults to the current working directory. */ allowedDir?: string; } /** * Writes Auth0 credentials to an environment file (default: .env.local) * * File behavior: * - If the file does NOT exist: creates a new file with the credentials * - If the file DOES exist: comments out any lines whose keys conflict with * the incoming credentials, preserves all other content (comments, blank * lines, unrelated variables), and appends the new credentials at the end. * * Additional behavior: * - Sets restrictive file permissions (chmod 600 — owner read/write only) * - Ensures .gitignore includes the env file (unless createGitignore is false) * - Prevents credentials from appearing in MCP client logs * * @param credentials - The credentials to write * @param options - Optional configuration for file path and gitignore creation * @returns Information about where credentials were written, including whether the file was created or updated */ export declare function writeCredentialsToEnv(credentials: Record<string, string>, options?: WriteCredentialsOptions): Promise<CredentialsWriteResult>; /** * Ensures the .gitignore file includes the specified env file pattern * * @param cwd - Current working directory * @param envFileName - Name of the env file to add to .gitignore */ export declare function ensureGitignore(cwd: string, envFileName: string): boolean; /** * Parses an env file into a key/value map. * * @param filePath - Path to the env file * @returns Map of key/value pairs from the file, or an empty object if the file does not exist */ export declare function parseEnvFile(filePath: string): Record<string, string>; /** * Detects existing environment files in the current directory * * @returns Path to the first found env file, or null if none exist */ export declare function detectExistingEnvFile(dir?: string): string | null;