clear_github_auth
Remove GitHub authentication to disconnect from GitHub accounts, clear stored credentials, or switch between user accounts in the DollhouseMCP persona management system.
Instructions
Remove GitHub authentication and disconnect from GitHub. Use when users say 'disconnect from GitHub', 'remove my GitHub connection', 'clear authentication', or want to switch accounts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server/tools/AuthTools.ts:33-42 (registration)Registration of the 'clear_github_auth' MCP tool. Includes tool definition, description, empty input schema, and handler that delegates to server.clearGitHubAuth()tool: { name: "clear_github_auth", description: "Remove GitHub authentication and disconnect from GitHub. Use when users say 'disconnect from GitHub', 'remove my GitHub connection', 'clear authentication', or want to switch accounts.", inputSchema: { type: "object", properties: {} } }, handler: () => server.clearGitHubAuth() },
- src/server/tools/AuthTools.ts:36-39 (schema)Input schema for clear_github_auth tool: empty object (no parameters required)inputSchema: { type: "object", properties: {} }
- src/server/tools/AuthTools.ts:41-41 (handler)Tool handler lambda that invokes the server's clearGitHubAuth methodhandler: () => server.clearGitHubAuth()
- Core implementation logic for clearing GitHub authentication: clears API cache, logs security event, removes stored token via TokenManager, and handles errors. This is likely called by server.clearGitHubAuth()async clearAuthentication(): Promise<void> { try { // Get the token before clearing it const token = await TokenManager.getGitHubTokenAsync(); if (token) { // Attempt to revoke the token on GitHub // Note: GitHub OAuth tokens don't have a revocation endpoint for device flow tokens // But we'll clear the cache and remove from storage // Clear cached user info this.apiCache.clear(); // Log security event for audit trail SecurityMonitor.logSecurityEvent({ type: 'TOKEN_CACHE_CLEARED', severity: 'LOW', source: 'GitHubAuthManager.clearAuthentication', details: 'GitHub authentication cleared by user request', metadata: { hadToken: true, tokenPrefix: TokenManager.getTokenPrefix(token) } }); } // Remove from secure storage await TokenManager.removeStoredToken(); logger.info('GitHub authentication cleared successfully'); } catch (error) { ErrorHandler.logError('GitHubAuthManager.clearAuthentication', error); throw ErrorHandler.createError('Failed to clear authentication', ErrorCategory.AUTH_ERROR, undefined, error); } }
- src/server/types.ts:50-50 (schema)TypeScript interface definition for the clearGitHubAuth method on IToolHandler (return type Promise<any>)clearGitHubAuth(): Promise<any>;
- TokenManager.removeStoredToken() call that performs the actual token removal from secure storageawait TokenManager.removeStoredToken();