check_github_auth
Verify GitHub authentication status to confirm connection, display username, and identify available actions. Use to resolve queries like 'Am I connected to GitHub?' or 'What’s my GitHub status?'
Instructions
Check current GitHub authentication status. Shows whether you're connected to GitHub, your username, and what actions are available. Use when users ask 'am I connected to GitHub?', 'what's my GitHub status?', or similar questions.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server/tools/AuthTools.ts:22-30 (registration)Registers the check_github_auth MCP tool with name, description, empty input schema (no arguments), and handler that delegates to server.checkGitHubAuth()tool: { name: "check_github_auth", description: "Check current GitHub authentication status. Shows whether you're connected to GitHub, your username, and what actions are available. Use when users ask 'am I connected to GitHub?', 'what's my GitHub status?', or similar questions.", inputSchema: { type: "object", properties: {} } }, handler: () => server.checkGitHubAuth()
- src/auth/GitHubAuthManager.ts:214-242 (handler)Core implementation of GitHub auth status check. Retrieves stored token, validates by fetching user info from GitHub API, returns detailed AuthStatus including isAuthenticated, username, scopes. This is the logic executed by server.checkGitHubAuth()async getAuthStatus(): Promise<AuthStatus> { const token = await TokenManager.getGitHubTokenAsync(); if (!token) { return { isAuthenticated: false, hasToken: false }; } try { // Try to get user info to validate token const userInfo = await this.fetchUserInfo(token); return { isAuthenticated: true, hasToken: true, username: userInfo.login, scopes: userInfo.scopes }; } catch (error) { // Token might be invalid or expired ErrorHandler.logError('GitHubAuthManager.checkAuthStatus', error); return { isAuthenticated: false, hasToken: true // Has token but it's invalid }; } }
- src/server/types.ts:48-52 (schema)TypeScript interface IToolHandler defines the checkGitHubAuth(): Promise<any> method signature used by the server instance.setupGitHubAuth(): Promise<any>; checkGitHubAuth(): Promise<any>; clearGitHubAuth(): Promise<any>; configureOAuth(client_id?: string): Promise<any>; getOAuthHelperStatus(verbose?: boolean): Promise<any>;