Add GitHub CLI authentication support#2
Merged
christian-andersson merged 2 commits intomainfrom Jan 23, 2026
Merged
Conversation
Add support for automatic token resolution via gh CLI as a fallback authentication method. This improves developer experience by allowing the service to use existing gh CLI credentials without requiring manual token configuration. Changes: - Add gh CLI token resolution in token-resolver.ts - Make token resolution async to support command execution - Update client to lazily resolve tokens on first request - Add --allow-run=gh permission to all configurations - Update documentation with gh CLI setup instructions Authentication resolution order: 1. Org-specific tokens (GITHUB_TOKEN_<ORG>) 2. Environment variable (GITHUB_TOKEN) 3. GitHub CLI (gh auth token) - NEW 4. Unauthenticated Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Add .mcp.json to configure the project to use its own MCP server for local development and testing. This demonstrates "dogfooding" and provides a working example for contributors. Configuration includes: - Relative path to main.ts for local development - All required permissions including --allow-run=gh - MIN_RELEASE_AGE_DAYS environment variable Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
SagenKoder
approved these changes
Jan 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
gh auth token) as an authentication fallback method.mcp.jsonconfiguration for "dogfooding" the MCP server during developmentChanges
Authentication Enhancement
getGhCliToken()method intoken-resolver.tsto executegh auth tokencommandresolveToken()async to support command executionGitHubClientto lazily resolve tokens on first request (async support)Authentication Resolution Order
GITHUB_TOKEN_<ORG>) - for multi-org scenariosGITHUB_TOKEN) - explicit configurationgh auth token) - NEW automatic fallbackConfiguration Updates
--allow-run=ghpermission to all Deno run commands.mcp.jsonfor local development (demonstrates dogfooding)Documentation
Benefits
ghCLI authenticated, it just worksTesting
Tested with:
gh auth login)🤖 Generated with Claude Code