configure_oauth
Set up or verify GitHub OAuth authentication for AI persona management in DollhouseMCP, enabling secure access to persona marketplace features.
Instructions
Configure GitHub OAuth client ID for authentication. If no client_id provided, shows current configuration status. If client_id provided, validates format and saves it to config. Use when users need to set up OAuth or check their configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| client_id | No | GitHub OAuth client ID (starts with 'Ov23li' followed by at least 14 alphanumeric characters) |
Implementation Reference
- src/server/tools/AuthTools.ts:43-58 (registration)Tool registration with name, description, input schema, and handler that delegates to server.configureOAuth{ tool: { name: "configure_oauth", description: "Configure GitHub OAuth client ID for authentication. If no client_id provided, shows current configuration status. If client_id provided, validates format and saves it to config. Use when users need to set up OAuth or check their configuration.", inputSchema: { type: "object", properties: { client_id: { type: "string", description: "GitHub OAuth client ID (starts with 'Ov23li' followed by at least 14 alphanumeric characters)" } } } }, handler: (args: { client_id?: string }) => server.configureOAuth(args.client_id) },
- src/config/ConfigManager.ts:517-538 (handler)Core logic for configuring (setting) the OAuth client ID, including validation and saving to config filepublic async setGitHubClientId(clientId: string): Promise<void> { if (!ConfigManager.validateClientId(clientId)) { throw new Error( `Invalid GitHub client ID format. Expected format: Ov23li followed by at least 14 alphanumeric characters (e.g., Ov23liABCDEFGHIJKLMN)` ); } if (!this.config) { this.config = this.getDefaultConfig(); } // Ensure github.auth object exists if (!this.config.github) { this.config.github = this.getDefaultConfig().github; } if (!this.config.github.auth) { this.config.github.auth = this.getDefaultConfig().github.auth; } this.config.github.auth.client_id = clientId; await this.saveConfig(); }
- src/config/ConfigManager.ts:503-512 (helper)Helper to retrieve current OAuth client ID (used when no client_id provided)public getGitHubClientId(): string | null { // Check environment variable first const envClientId = process.env.DOLLHOUSE_GITHUB_CLIENT_ID; if (envClientId) { return envClientId; } // Fall back to config file return this.config?.github?.auth?.client_id || null; }
- src/config/ConfigManager.ts:634-642 (helper)Validation helper for client ID formatpublic static validateClientId(clientId: any): boolean { if (typeof clientId !== 'string' || !clientId) { return false; } // GitHub OAuth client IDs follow the pattern: Ov23li[A-Za-z0-9]{14,} const clientIdPattern = /^Ov23li[A-Za-z0-9]{14,}$/; return clientIdPattern.test(clientId); }
- src/server/types.ts:51-51 (schema)Type definition for the delegated server.configureOAuth methodconfigureOAuth(client_id?: string): Promise<any>;