### Fetch Auth0 Quickstart Guide Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/grants-onboarding.md Retrieve framework-specific instructions for integrating the Auth0 SDK after onboarding. This includes dependencies, initialization code, and authentication flow examples. ```typescript // After onboarding, get integration instructions const response = await handler( { token: accessToken, parameters: { client_id: 'app_12345', framework: 'next', project_dir: '/path/to/my-app' } }, { domain: 'tenant.auth0.com' } ); // Response includes: // - npm install commands for @auth0/nextjs-auth0 // - Configuration file examples (auth0.js, etc.) // - API route handler examples // - Code snippets for protecting pages ``` -------------------------------- ### Run Auth0 MCP Server with Combined Options Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/commands.md Starts the Auth0 MCP Server with both debug logging and specific tools enabled. This example combines the DEBUG environment variable with the --tools CLI option. ```bash DEBUG=auth0-mcp AUTH0_MCP_TOOLS='auth0_list_*,auth0_get_*' npx @auth0/auth0-mcp-server run ``` -------------------------------- ### HandlerConfig Example Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/types.md An example of how to instantiate the HandlerConfig interface with a domain, server mode, and custom headers. ```typescript const config: HandlerConfig = { domain: 'example.auth0.com', mode: ServerMode.Stdio, headers: { 'User-Agent': 'auth0-mcp-server' } }; ``` -------------------------------- ### ServerOptions Interface Examples Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/server.md Configuration options for the MCP server startup. These examples show how to specify which tools are enabled and whether to operate in read-only mode. ```typescript // Enable only read operations { readOnly: true } ``` ```typescript // Enable specific tools by pattern { tools: ['auth0_list_*', 'auth0_get_*'] } ``` ```typescript // Enable application and resource server tools { tools: ['auth0_*_application*', 'auth0_*_resource_server*'] } ``` ```typescript // All tools (default behavior) { tools: ['*'] } ``` -------------------------------- ### Grants and Onboarding Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/README.md APIs for managing application grants and project onboarding, including authorizing applications, setting up projects, and retrieving quickstart guides. ```APIDOC ## Grants and Onboarding ### Description This section details the APIs for managing grants and project onboarding. It includes functionality to authorize applications to access APIs, perform one-shot project setup, and retrieve framework-specific integration guides. ### `auth0_create_application_grant` #### Description Authorizes an application to access a specific API (Resource Server). #### Method `POST` #### Endpoint `/api/v2/grants` #### Request Body - **client_id** (string) - Required - The ID of the application (client) to grant access. - **audience** (string) - Required - The identifier of the API (Resource Server) to grant access to. - **scopes** (array) - Optional - An array of scopes to grant. ### `auth0_onboarding` #### Description Performs a one-shot setup for a new project, configuring necessary Auth0 resources. #### Method N/A (SDK function) #### Code Example ```javascript // Example usage import { auth0_onboarding } from "@auth0/mcp-server/onboarding"; auth0_onboarding({ appName: "my-new-app", // other onboarding options... }).catch(console.error); ``` ### `auth0_get_quickstart_guide` #### Description Retrieves a framework-specific integration guide to help set up your project. #### Method `GET` #### Endpoint `/api/v2/quickstarts/{framework}` #### Parameters ##### Path Parameters - **framework** (string) - Required - The name of the framework (e.g., 'nextjs', 'react', 'express'). ### Supported Frameworks This API supports integration guides for various frameworks including Next.js, React, Express, Flask, FastAPI, and more. Refer to the full documentation for a complete list and specific configuration details. ``` -------------------------------- ### ClientOptions Usage Example Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/types.md Demonstrates how to instantiate the ClientOptions interface with specific tool patterns and a read-only setting. ```typescript const options: ClientOptions = { tools: ['auth0_list_*', 'auth0_get_*'], readOnly: false }; ``` -------------------------------- ### Initiate Device Auth Flow Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Start the device authorization flow for the MCP server using the npx command. This is part of the setup process. ```bash # Initiate device auth flow npx . init ``` -------------------------------- ### Enable All Tools Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Start the server with all available tools enabled using the `--tools '*'` flag. This is generally not recommended for production environments. ```bash npx @auth0/auth0-mcp-server run --tools '*' ``` -------------------------------- ### Example MCP Tool Definition Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/types.md An example of how to define a tool, such as 'auth0_list_applications', including its name, description, input schema, and required metadata. ```typescript const tool: Tool = { name: 'auth0_list_applications', description: 'List all applications in the Auth0 tenant', inputSchema: { type: 'object', properties: { page: { type: 'number' }, per_page: { type: 'number' } } }, _meta: { requiredScopes: ['read:clients'], readOnly: true }, annotations: { title: 'List Auth0 Applications', readOnlyHint: true, idempotentHint: true } }; ``` -------------------------------- ### Run Auth0 MCP Server with All Tools Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/commands.md Starts the Auth0 MCP Server with all available tools enabled. This is the default behavior when no specific tools are provided. ```bash npx @auth0/auth0-mcp-server run ``` -------------------------------- ### Tool Configuration Example Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/endpoints.md Illustrates how to define a tool with its name, description, input schema, and the internal _meta field, including required scopes and read-only status. ```typescript const tool: Tool = { name: 'auth0_list_applications', description: '...', inputSchema: {...}, _meta: { requiredScopes: ['read:clients'], readOnly: true } } ``` -------------------------------- ### Server Initialization Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/README.md Details on how to initialize and start the Auth0 MCP Server, including available options and lifecycle management. ```APIDOC ## Server Initialization and Startup ### Description This section covers the main server initialization and startup procedures for the Auth0 MCP Server. It includes details about the `startServer()` function, the `ServerOptions` interface, and server lifecycle management. ### Method `startServer(options: ServerOptions): Promise` ### Endpoint N/A (SDK function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```javascript // Example usage of startServer import { startServer } from "@auth0/mcp-server"; const options = { port: 3000, // other options... }; startServer(options).catch(console.error); ``` ### Response #### Success Response - **void**: The server starts successfully. #### Response Example None (asynchronous operation) ### ServerOptions Interface ```typescript interface ServerOptions { port?: number; // ... other configuration options } ``` ``` -------------------------------- ### Start Auth0 MCP Server Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/server.md Initializes and starts the Auth0 MCP server. Use this to provide AI assistants with secure, controlled access to Auth0 Management API capabilities. The server can be started with default settings, read-only mode, or filtered tools. ```typescript import { startServer } from '@auth0/auth0-mcp-server'; // Start server with all tools enabled const server = await startServer(); // Start with read-only tools only const readOnlyServer = await startServer({ readOnly: true }); // Start with filtered tools const filteredServer = await startServer({ tools: ['auth0_list_*', 'auth0_get_*'], readOnly: false }); ``` -------------------------------- ### startServer Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/server.md Initializes and starts the Auth0 MCP server. This server provides AI assistants with secure, controlled access to Auth0 Management API capabilities. ```APIDOC ## startServer(options?: ServerOptions) ### Description Initializes and starts the Auth0 MCP server to provide AI assistants with secure, controlled access to Auth0 Management API capabilities. ### Method ```typescript async function startServer(options?: ServerOptions): Promise ``` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters #### Options - **options** (ServerOptions) - Optional - Configuration for tool filtering and read-only mode - **tools** (string[]) - Optional - Array of tool patterns to enable (supports glob patterns like `auth0_list_*`). Defaults to `['*']`. - **readOnly** (boolean) - Optional - If true, only expose read-only tools (list and get operations). Defaults to `false`. ### Return Type `Promise` - The initialized MCP server instance. ### Throws - **Error**: Configuration validation fails (missing token, invalid domain, expired credentials). - **Error**: Server setup encounters transport connection errors. - **Error**: Configuration cannot be loaded or refreshed. ### Example ```typescript import { startServer } from '@auth0/auth0-mcp-server'; // Start server with all tools enabled const server = await startServer(); // Start with read-only tools only const readOnlyServer = await startServer({ readOnly: true }); // Start with filtered tools const filteredServer = await startServer({ tools: ['auth0_list_*', 'auth0_get_*'], readOnly: false }); ``` ``` -------------------------------- ### Example HandlerRequest Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/types.md An example of a HandlerRequest object, showing the structure for the access token and tool parameters. ```typescript const request: HandlerRequest = { token: 'eyJhbGciOiJSUzI1NiIs...', parameters: { page: 0, per_page: 50 } }; ``` -------------------------------- ### ToolAnnotations Interface Example Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/types.md Provides an example of how to instantiate the ToolAnnotations interface with specific metadata for a tool. Useful for describing tool capabilities. ```typescript const annotations: ToolAnnotations = { title: 'List Auth0 Applications', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }; ``` -------------------------------- ### Install Dependencies for Auth0 MCP Server Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Install the necessary Node.js dependencies for the Auth0 MCP Server project using npm. This command should be run after cloning the repository. ```bash # Install dependencies npm install ``` -------------------------------- ### Example CallToolRequest JSON Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/endpoints.md Demonstrates how to format a JSON request to call the 'auth0_list_applications' tool with pagination arguments. ```json { "method": "tools/call", "params": { "name": "auth0_list_applications", "arguments": { "page": 0, "per_page": 50 } } } ``` -------------------------------- ### Run Auth0 MCP Server with Specific Tools Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/commands.md Starts the Auth0 MCP Server with a specific set of tools enabled, defined by comma-separated patterns. Use the --tools option to specify patterns like 'auth0_list_*' or 'auth0_get_*'. ```bash npx @auth0/auth0-mcp-server run --tools 'auth0_list_*,auth0_get_*' ``` -------------------------------- ### Auth0 Lucene Query Examples Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/logs-forms.md Provides examples of Lucene query syntax for filtering Auth0 logs based on type, user ID, IP address, email, client name, and combinations thereof. ```text type:s # Successful authentication logs type:f # Failed authentication logs type:ss # Successful signup logs type:fs # Failed signup logs user_id:"google-oauth2|123" # Logs for specific user ip:"192.108.92.3" # Logs from specific IP email:"user@example.com" # Logs for specific email client_name:"My App" # Logs for specific application type:s AND client_name:"My App" # Multiple conditions ``` -------------------------------- ### Example ListToolsResponse Structure Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/endpoints.md Illustrates the JSON structure of a response to a ListToolsRequest, detailing the properties of each available tool. ```json { "tools": [ { "name": "auth0_list_applications", "description": "List all applications in the Auth0 tenant or search by name", "inputSchema": { "type": "object", "properties": { "page": { "type": "number", "description": "Page number (0-based)" }, "per_page": { "type": "number", "description": "Number of applications per page" }, "include_totals": { "type": "boolean", "description": "Include total count" } } }, "annotations": { "title": "List Auth0 Applications", "readOnlyHint": true, "destructiveHint": false, "idempotentHint": true, "openWorldHint": false } }, { "name": "auth0_create_application", "description": "Create a new Auth0 application with the tenant...", "inputSchema": { "type": "object", "properties": { "name": { "type": "string" }, "app_type": { "type": "string", "enum": ["spa", "native", "non_interactive", "regular_web"] }, "callbacks": { "type": "array", "items": { "type": "string" } } }, "required": ["name"] }, "annotations": { "title": "Create Auth0 Application", "readOnlyHint": false, "destructiveHint": false, "idempotentHint": false, "openWorldHint": false } } ] } ``` -------------------------------- ### Display All Auth0 MCP Server Commands Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Use this command to view all available commands and options for the Auth0 MCP Server. This is a good starting point for troubleshooting. ```bash npx @auth0/auth0-mcp-server help ``` -------------------------------- ### Resource Server Scope Structure Example Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/resource-servers.md Defines the structure for resource server scopes, including value and description. Follows naming conventions for granular permissions. ```json [ { "value": "read:users", "description": "Read user profiles" }, { "value": "write:users", "description": "Update user profiles" }, { "value": "delete:users", "description": "Delete users" }, { "value": "read:posts", "description": "View blog posts" }, { "value": "write:posts", "description": "Create/edit blog posts" } ] ``` -------------------------------- ### Auth0 MCP Server CLI Run Command Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/INDEX.md Starts the Auth0 MCP Server. The `--read-only` flag can be used to enable read-only mode. ```bash npx @auth0/auth0-mcp-server run --read-only ``` -------------------------------- ### Select All Logs and Actions Tools Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/commands.md Use wildcard patterns with the '--tools' flag to select all tools related to logs and actions, matching any tool name starting with 'auth0_' and ending with '_logs' or '_actions'. ```bash --tools 'auth0_*_logs,auth0_*_actions' ``` -------------------------------- ### Run Compiled Auth0 MCP Server Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Start the Auth0 MCP Server using the compiled JavaScript version. This command is typically used after the project has been built. ```bash # Run the compiled JavaScript version npm run start ``` -------------------------------- ### Create a New Auth0 SPA Application Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/applications.md This example demonstrates how to create a new Single Page Application (SPA) in Auth0. It specifies the application name, type, OIDC compliance, and necessary callback and allowed origin URLs. ```typescript const response = await handler( { token: accessToken, parameters: { name: 'My Next.js App', app_type: 'spa', oidc_conformant: true, callbacks: ['http://localhost:3000/api/auth/callback'], allowed_origins: ['http://localhost:3000'], allowed_logout_urls: ['http://localhost:3000'] } }, { domain: 'tenant.auth0.com' } ); ``` -------------------------------- ### Example Success CallToolResponse JSON Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/endpoints.md Shows a successful response from a tool call, containing a list of applications in the content field and isError set to false. ```json { "content": [ { "type": "text", "text": "[{"client_id": "app1", "name": "My App"}]" } ], "isError": false } ``` -------------------------------- ### Initialize Auth0 MCP Server in Read-Only Mode Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/commands.md Initialize the Auth0 MCP Server with read-only access enabled. This restricts the available tools to only list and get operations, enhancing security by preventing modifications. ```bash npx @auth0/auth0-mcp-server init --read-only ``` -------------------------------- ### HandlerResponse Error Example Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/types.md An example of an error HandlerResponse containing text content indicating an error and isError set to true. ```typescript // Error response const errorResponse: HandlerResponse = { content: [ { type: 'text', text: 'Error: Application not found' } ], isError: true }; ``` -------------------------------- ### HandlerResponse Success Example Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/types.md An example of a successful HandlerResponse containing an array of content blocks, typically text, and isError set to false. ```typescript // Success response const successResponse: HandlerResponse = { content: [ { type: 'text', text: JSON.stringify([ { client_id: 'app1', name: 'My App' }, { client_id: 'app2', name: 'Another App' } ]) } ], isError: false }; ``` -------------------------------- ### Initialize MCP Server with Specific Scopes using Glob Patterns Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/configuration.md Use glob patterns with the init command to select a set of scopes during server initialization. This allows for flexible permission management. ```bash # All read scopes npx @auth0/auth0-mcp-server init --scopes 'read:*' # All scopes for clients npx @auth0/auth0-mcp-server init --scopes '*:clients' # Multiple patterns npx @auth0/auth0-mcp-server init --scopes 'read:*,create:clients,update:actions' ``` -------------------------------- ### Onboard a Project with Auth0 Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/grants-onboarding.md Use this tool to create a new Auth0 application for a specified framework, configure callback URLs, and save credentials to a `.env` file. It supports various Node.js and Python frameworks. ```typescript const response = await handler( { token: accessToken, parameters: { framework: 'next', project_dir: '/path/to/my-app', project_name: 'My Next.js App' } }, { domain: 'tenant.auth0.com' } ); // Response includes: // - Created application with client_id, domain // - Saved .env.local with AUTH0_* variables // - Quickstart guide for integrating Auth0 SDK ``` -------------------------------- ### Valid Lucene Query Examples Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/errors.md Examples of correctly formatted Lucene queries for filtering logs. Ensure correct syntax for operators and values. ```lucene type:s ``` ```lucene type:f AND client_name:"My App" ``` ```lucene ip:"192.168.1.1" ``` ```lucene email:"user@example.com" ``` ```lucene type:s AND NOT ip:"192.168.1.1" ``` -------------------------------- ### Example of Prevented Prompt Injection Attack Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/endpoints.md Illustrates an example JSON payload that attempts to smuggle a sensitive parameter (`custom_login_page`) into a tool call, which would be rejected by the parameter validation. ```json { "method": "tools/call", "params": { "name": "auth0_create_application", "arguments": { "name": "My App", "custom_login_page": "" } } } ``` -------------------------------- ### Initialize MCP Server with All Read, Update, and Create Scopes Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Initialize the MCP server and grant broad permissions by selecting all read, update, and create scopes. Use this when troubleshooting API errors or permission issues. ```bash npx @auth0/auth0-mcp-server init --scopes 'read:*,update:*,create:*' ``` -------------------------------- ### Invalid Action Code Example Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/errors.md This example demonstrates an invalid JavaScript syntax within an Action code snippet, specifically a misplaced bracket. Ensure correct syntax and proper use of async/await. ```javascript // Invalid syntax module.exports = async (event, api => { // Wrong bracket // ... }; ``` -------------------------------- ### Configure MCP Client Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Set up your MCP Client, such as Claude Desktop, with the MCP server path. This command assists in the client configuration process. ```bash # Configure your MCP Client (e.g. Claude Desktop) with MCP server path npm run setup ``` -------------------------------- ### Initialize Auth0 MCP Server Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/commands.md Use this command to initialize the Auth0 MCP Server and configure authentication. The default behavior uses an interactive device flow that opens a browser for authentication. For non-interactive use, specify `--no-interaction`. ```bash npx @auth0/auth0-mcp-server init ``` ```bash npx @auth0/auth0-mcp-server init --no-interaction ``` -------------------------------- ### Initialize Auth0 MCP Server for Cursor with limited tools Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Initialize the Auth0 MCP Server for Cursor with a limited set of tools. This restricts the available functionalities to specific applications. ```bash npx @auth0/auth0-mcp-server init --client cursor --tools 'auth0_list_applications,auth0_get_application' ``` -------------------------------- ### Auth0 MCP Server CLI Initialization Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/INDEX.md Use this command to authenticate and configure the Auth0 MCP Server with a specific client. ```bash npx @auth0/auth0-mcp-server init --client claude-code ``` -------------------------------- ### Initialize Auth0 MCP Server with Specific Tools Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/commands.md Initialize the Auth0 MCP Server and enable only a specific set of tools using glob patterns. This allows fine-grained control over which functionalities are available. ```bash npx @auth0/auth0-mcp-server init --tools 'auth0_list_*,auth0_get_*' ``` -------------------------------- ### List Available Tools with npx Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/errors.md Use this command to list all available tools for the Auth0 MCP Server. This helps in identifying correct tool names and preventing 'Unknown or restricted tool' errors. ```bash npx @auth0/auth0-mcp-server init --help ``` -------------------------------- ### Get Form Tool Definition Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/logs-forms.md Defines the `auth0_get_form` tool for retrieving detailed information about a specific Auth0 form using its ID. ```json { "name": "auth0_get_form", "description": "Get details about a specific Auth0 form", "inputSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "ID of the form to retrieve" } }, "required": ["id"] } } ``` -------------------------------- ### Example Error CallToolResponse JSON Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/endpoints.md Illustrates an error response from a tool call, with an error message in the content field and isError set to true. ```json { "content": [ { "type": "text", "text": "Error: Application not found" } ], "isError": true } ``` -------------------------------- ### Initialize Auth0 MCP Server for Cursor Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Initialize the Auth0 MCP Server for the Cursor IDE. This command sets up the server for integration with Cursor. ```bash npx @auth0/auth0-mcp-server init --client cursor ``` -------------------------------- ### Select All Application Tools Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/commands.md Use a wildcard pattern with the '--tools' flag to select all tools related to applications, matching any tool name containing 'application'. ```bash --tools 'auth0_*_application*' ``` -------------------------------- ### Get Auth0 Action by ID Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/actions.md Retrieves detailed information about a specific Auth0 action using its ID. Requires 'read:actions' scope. ```json { "name": "auth0_get_action", "description": "Get details about a specific Auth0 action", "inputSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "ID of the action to retrieve" } }, "required": ["id"] } } ``` -------------------------------- ### Get Auth0 Resource Server Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/resource-servers.md Retrieve detailed information about a specific Auth0 resource server by its ID. Requires `read:resource_servers` scope. ```typescript const response = await handler( { token: accessToken, parameters: { id: 'rs_12345' } }, { domain: 'tenant.auth0.com' } ); // Returns: { "id": "rs_12345", "name": "User API", "identifier": "https://api.example.com/users", "scopes": [ { "value": "read:users", "description": "Read user profile information" }, { "value": "write:users", "description": "Update user profile information" } ], "token_lifetime": 86400, "signing_alg": "RS256", "allow_offline_access": false } ``` -------------------------------- ### Initialize Auth0 MCP Server for Windsurf Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Initialize the Auth0 MCP Server for the Windsurf MCP Client. This command configures the server to work with Windsurf. ```bash npx @auth0/auth0-mcp-server init --client windsurf ``` -------------------------------- ### Initialize Auth0 MCP Server with Custom Scopes Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/commands.md Initialize the Auth0 MCP Server and specify custom scopes for authentication using glob patterns. This allows requesting specific permissions, such as read operations and client creation. ```bash npx @auth0/auth0-mcp-server init --scopes 'read:*,create:clients,update:actions' ``` -------------------------------- ### Get Action by ID Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/actions.md Retrieves detailed information about a specific Auth0 action using its unique identifier. This operation requires the `read:actions` scope. ```APIDOC ## auth0_get_action ### Description Get detailed information about a specific action by ID. ### Parameters #### Path Parameters - **id** (string) - Required - The ID of the action to retrieve. ### Return Type Complete action object including: `id`, `name`, `status`, `supported_triggers` (array of trigger objects with `id` and `version`), `code` (JavaScript source), `dependencies` (npm packages), `runtime` (e.g., `node18`), `secrets` (array with name and updated_at fields), `created_at`, `updated_at`. ### Required Scope `read:actions` ``` -------------------------------- ### Initialize Auth0 MCP Server for Gemini CLI Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Initialize the Auth0 MCP Server for the Gemini CLI. This command sets up the server for integration with the Gemini CLI. ```bash npx @auth0/auth0-mcp-server init --client gemini ``` -------------------------------- ### Get Auth0 Application Details Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/applications.md Retrieves detailed information for a specific Auth0 application using its client ID. Ensure you have the necessary `read:clients` scope. ```json { "name": "auth0_get_application", "description": "Get details about a specific Auth0 application", "inputSchema": { "type": "object", "properties": { "client_id": { "type": "string", "description": "Client ID of the application to retrieve" } }, "required": ["client_id"] } } ``` ```typescript const response = await handler( { token: accessToken, parameters: { client_id: 'abc123xyz' } }, { domain: 'tenant.auth0.com' } ); // Returns: { "content": [{ "type": "text", "text": "{...application details...}" }], "isError": false } ``` -------------------------------- ### Run MCP Server in Development Environment Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/configuration.md Configure the development environment for the MCP server by setting tools to '*' and read-only to false. This allows for full access during development. ```bash AUTH0_MCP_TOOLS='*' AUTH0_MCP_READ_ONLY=false npx @auth0/auth0-mcp-server run ``` -------------------------------- ### Handle Undeclared Parameters in Tool Calls Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/errors.md This TypeScript example demonstrates a tool call that includes an undeclared parameter (`custom_login_page`), which will be rejected. Ensure all parameters passed to a tool are defined in its `inputSchema`. ```typescript handler( { token, parameters: { client_id: 'abc123', custom_login_page: '...' // Not in inputSchema } }, { domain } ); ``` -------------------------------- ### MCP Server Redacted Response Example Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/configuration.md Illustrates how the Auth0 MCP Server automatically redacts sensitive fields like 'client_secret' in its responses, replacing them with '[REDACTED]'. This protects sensitive data. ```json { "client_id": "abc123", "name": "My App", "client_secret": "[REDACTED]" } ``` -------------------------------- ### Run All Auth0 MCP Server Tests Source: https://github.com/auth0/auth0-mcp-server/blob/main/test/README.md Execute all defined tests within the Auth0 MCP Server project. This command initiates the full test suite. ```bash # Run all tests npm test ``` -------------------------------- ### Get Specific Auth0 Log Entry Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/logs-forms.md Use this tool to retrieve detailed information about a single log entry by its unique ID. Requires the log entry's ID as a parameter. ```json { "name": "auth0_get_log", "description": "Get a specific log entry by ID", "inputSchema": { "type": "object", "properties": { "id": { "type": "string", "description": "ID of the log entry to retrieve" } }, "required": ["id"] } } ``` -------------------------------- ### Test API Connectivity with Environment Variables Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/errors.md Test API connectivity for the Auth0 MCP Server by setting the AUTH0_DOMAIN and AUTH0_TOKEN environment variables before running the server. Ensure you replace 'example.auth0.com' and 'eyJhbGci...' with your actual domain and token. ```bash export AUTH0_DOMAIN="example.auth0.com" export AUTH0_TOKEN="eyJhbGci..." npx @auth0/auth0-mcp-server run ``` -------------------------------- ### Run MCP Server with Specific Tools Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/configuration.md For development, specify only the necessary tools to minimize the attack surface. This ensures that only explicitly allowed operations can be performed. ```bash npx @auth0/auth0-mcp-server run --tools 'auth0_list_*,auth0_create_application' ``` -------------------------------- ### Handler Function Signature Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/grants-onboarding.md Defines the signature for handler functions used in Auth0's server-side operations for grants and onboarding. This signature is consistent across various tools like application grants, onboarding, and quickstarts. ```typescript async function handler( request: HandlerRequest, config: HandlerConfig ): Promise ``` -------------------------------- ### Initialize MCP Server with Specific Scopes Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/configuration.md Initialize the MCP server by requesting specific scopes for required operations, such as 'read:clients' and 'create:clients'. This adheres to the principle of least privilege. ```bash npx @auth0/auth0-mcp-server init --scopes 'read:clients,create:clients' ``` -------------------------------- ### Build Auth0 MCP Server Project Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Compile the Auth0 MCP Server project from source using npm. This command generates the production-ready JavaScript files. ```bash # Build the project npm run build ``` -------------------------------- ### Initialize Auth0 MCP Server for VS Code with limited tools and read-only Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Initialize the Auth0 MCP Server for VS Code with limited tools and read-only access. This configuration restricts capabilities to specific read operations. ```bash npx @auth0/auth0-mcp-server init --client vscode --tools 'auth0_list_*,auth0_get_*' --read-only ``` -------------------------------- ### Initialize Auth0 MCP Server for VS Code Source: https://github.com/auth0/auth0-mcp-server/blob/main/README.md Initialize the Auth0 MCP Server for VS Code. This command configures the server for integration with the VS Code editor. ```bash npx @auth0/auth0-mcp-server init --client vscode ``` -------------------------------- ### Configure Stdio Server Transport Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/endpoints.md Initialize and connect the server using the StdioServerTransport. Ensure this is done within a Promise.race to handle connection timeouts. ```typescript const transport = new StdioServerTransport(); await server.connect(transport); ``` ```typescript await Promise.race([ server.connect(transport), new Promise((_, reject) => setTimeout(() => reject(new Error('Connection timeout')), 5000) ) ]); ``` -------------------------------- ### Set Auth0 Domain Environment Variable Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/errors.md Configure the Auth0 domain by setting the AUTH0_DOMAIN environment variable. This is necessary if the domain is not stored during initialization or if the configuration file is corrupted. ```bash export AUTH0_DOMAIN="example.auth0.com" npx @auth0/auth0-mcp-server run ``` -------------------------------- ### ClientOptions Interface Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/types.md Configuration options for setting up the MCP client. This interface defines the properties that can be passed during client initialization. ```APIDOC ## ClientOptions Interface ### Description Configuration options for MCP client setup. This interface defines the properties that can be passed during client initialization. ### Properties #### `tools` * **Type**: string[] * **Required**: Yes * **Description**: Tool patterns to enable (supports glob patterns). #### `readOnly` * **Type**: boolean * **Required**: No * **Description**: If true, restrict to read-only tools. ### Usage Example ```typescript const options: ClientOptions = { tools: ['auth0_list_*', 'auth0_get_*'], readOnly: false }; ``` ``` -------------------------------- ### auth0_create_resource_server Source: https://github.com/auth0/auth0-mcp-server/blob/main/_autodocs/api-reference/resource-servers.md Creates a new Auth0 resource server (API) with specified configurations including name, identifier, and scopes. ```APIDOC ## auth0_create_resource_server ### Description Create a new Auth0 resource server (API) with specified scopes. ### Parameters #### Request Body - **name** (string) - Required - Display name for the API (e.g., "User API"). - **identifier** (string) - Required - Unique identifier URI (typically a URL like `https://api.example.com/users`). - **scopes** (object[]) - Optional - Array of scope definitions with `value` and `description`. Defaults to an empty array. - **value** (string) - Required - Scope value/name. - **description** (string) - Optional - Scope description. - **token_lifetime** (number) - Optional - Access token lifetime in seconds (max 2592000 = 30 days). Defaults to 86400. - **signing_alg** (string) - Optional - Token signing algorithm: `HS256` or `RS256`. Defaults to RS256. - **allow_offline_access** (boolean) - Optional - Whether to allow refresh token requests. Defaults to false. ### Return Type Created resource server object with assigned `id` and full configuration. ### Required Scope `create:resource_servers` ### Example ```typescript const response = await handler( { token: accessToken, parameters: { name: 'Inventory API', identifier: 'https://api.example.com/inventory', scopes: [ { value: 'read:inventory', description: 'Read inventory items' }, { value: 'write:inventory', description: 'Create/update inventory items' }, { value: 'delete:inventory', description: 'Delete inventory items' } ], token_lifetime: 3600, signing_alg: 'RS256', allow_offline_access: true } }, { domain: 'tenant.auth0.com' } ); // Returns created resource server with assigned ID ``` ```