Support GITHUB_ACCESS_TOKEN for OAuth and PAT compatibility#1677
Open
Support GITHUB_ACCESS_TOKEN for OAuth and PAT compatibility#1677
Conversation
- Support GITHUB_ACCESS_TOKEN as the primary environment variable - Keep GITHUB_PERSONAL_ACCESS_TOKEN as deprecated fallback - GITHUB_ACCESS_TOKEN takes precedence when both are set - Update error message to mention both variables - All existing tests pass Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
- Update e2e tests to use new GITHUB_ACCESS_TOKEN variable - Update e2e README documentation Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
- Update README.md with GITHUB_ACCESS_TOKEN and deprecation notice - Update docs/server-configuration.md - Update all installation guides - Update script/conformance-test - Add note that server accepts any GitHub access token (PAT or OAuth) Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Update GITHUB_PERSONAL_ACCESS_TOKEN env var to access token
Support GITHUB_ACCESS_TOKEN for OAuth and PAT compatibility
Dec 23, 2025
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for GITHUB_ACCESS_TOKEN as the preferred environment variable name for GitHub authentication, while maintaining backward compatibility with GITHUB_PERSONAL_ACCESS_TOKEN. The change addresses the misleading naming that suggested only Personal Access Tokens (PATs) work, when OAuth tokens from IDEs are equally valid.
Key Changes:
- Added fallback logic in
cmd/github-mcp-server/main.goto checkGITHUB_ACCESS_TOKENfirst, thenGITHUB_PERSONAL_ACCESS_TOKEN - Updated error messages to reference both variable names
- Comprehensively updated all documentation, installation guides, examples, and test files to use the new variable name
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/github-mcp-server/main.go | Implements the environment variable fallback logic with clear precedence ordering and updated error message |
| e2e/e2e_test.go | Updates Docker environment variable and comments in end-to-end test setup |
| e2e/README.md | Updates documentation to reference the new variable name |
| script/conformance-test | Updates conformance test script to use new variable name |
| docs/server-configuration.md | Updates all configuration examples throughout the server configuration guide |
| docs/installation-guides/install-claude.md | Updates all Claude installation examples and commands |
| docs/installation-guides/install-cursor.md | Updates Docker configuration example for Cursor IDE |
| docs/installation-guides/install-gemini-cli.md | Updates Gemini CLI configuration examples for both Docker and binary installations |
| docs/installation-guides/install-windsurf.md | Updates Windsurf configuration example |
| docs/installation-guides/install-other-copilot-ides.md | Updates configuration examples for various Copilot-enabled IDEs |
| docs/installation-guides/install-antigravity.md | Updates Docker configuration example for Antigravity IDE |
| README.md | Updates all examples, prerequisites section, and Docker commands; adds deprecation notice for old variable name |
4 tasks
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
Add
GITHUB_ACCESS_TOKENenvironment variable as the preferred name, withGITHUB_PERSONAL_ACCESS_TOKENas deprecated fallback. The old name incorrectly implied only PATs work when OAuth tokens (e.g., from VS Code) are equally valid.Why
The environment variable name
GITHUB_PERSONAL_ACCESS_TOKENis too restrictive. OAuth tokens provisioned by IDEs work fine but the name suggests otherwise, forcing users toward manual PAT creation unnecessarily.What changed
cmd/github-mcp-server/main.go: CheckGITHUB_ACCESS_TOKENfirst, fallback toGITHUB_PERSONAL_ACCESS_TOKENMCP impact
Configuration change only—no MCP protocol or tool changes.
Prompts tested (tool changes only)
N/A
Security / limits
Uses existing token validation; only changes variable name lookup.
Tool renaming
Lint & tests
./script/lint./script/testDocs
All documentation and examples now use
GITHUB_ACCESS_TOKEN. Added deprecation notice for old variable name.Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.