- Notifications
You must be signed in to change notification settings - Fork3.3k
Support GITHUB_ACCESS_TOKEN for OAuth and PAT compatibility#1677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
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 passCo-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
- Update e2e tests to use new GITHUB_ACCESS_TOKEN variable- Update e2e README documentationCo-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>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull request overview
This PR adds support forGITHUB_ACCESS_TOKEN as the preferred environment variable name for GitHub authentication, while maintaining backward compatibility withGITHUB_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 |
Uh oh!
There was an error while loading.Please reload this page.
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 our2 minute survey.