Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
Copilot wants to merge5 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/update-env-var-name-access-token

Conversation

Copy link
Contributor

CopilotAI commentedDec 23, 2025
edited
Loading

Summary

AddGITHUB_ACCESS_TOKEN environment variable as the preferred name, withGITHUB_PERSONAL_ACCESS_TOKEN as 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 nameGITHUB_PERSONAL_ACCESS_TOKEN is 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_TOKEN first, fallback toGITHUB_PERSONAL_ACCESS_TOKEN
  • Error message now mentions both variables
  • Documentation updated: README, server-configuration.md, all installation guides, e2e tests
  • Both variables work; new one takes precedence when both set

MCP impact

  • No tool or API changes

Configuration change only—no MCP protocol or tool changes.

Prompts tested (tool changes only)

N/A

Security / limits

  • No security or limits impact

Uses existing token validation; only changes variable name lookup.

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with./script/lint
  • Tested locally with./script/test

Docs

  • Updated (README / docs / examples)

All documentation and examples now useGITHUB_ACCESS_TOKEN. Added deprecation notice for old variable name.

Original prompt

This section details on the original issue you should resolve

<issue_title>GITHUB_PERSONAL_ACCESS_TOKEN env var name assumes a PAT will be used</issue_title>
<issue_description>The GitHub MCP server must be spawned withGITHUB_PERSONAL_ACCESS_TOKEN as an environment variable set with a value to use in GitHub API calls.
But the very name of this environment variable specifies too much. Apersonal access token is an access token that is provisioned manually by the user (throughhttps://github.com/settings/tokens). This is tedious and a 'last resort' for authorizing apps.

A far preferable way to get an access token (which presumably works for this MCP server) is to use OAuth 2.0. For example, the Visual Studio keychain can produce such a token automatically for the user. But this isnot apersonal access token, but rather merely an access token.

The environment variable name suggests it must be a PAT, but in fact it's just an access token that's required.

Please consider adding support forGITHUB_ACCESS_TOKEN as an environment variable, document that, and deprecate use of the old environment variable name.</issue_description>

Comments on the Issue (you are@copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our2 minute survey.

CopilotAIand others added4 commitsDecember 23, 2025 13:51
- 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>
CopilotAI changed the title[WIP] Update GITHUB_PERSONAL_ACCESS_TOKEN env var to access tokenSupport GITHUB_ACCESS_TOKEN for OAuth and PAT compatibilityDec 23, 2025
@SamMorrowDrumsSamMorrowDrums marked this pull request as ready for reviewDecember 23, 2025 14:47
@SamMorrowDrumsSamMorrowDrums requested a review froma team as acode ownerDecember 23, 2025 14:47
CopilotAI review requested due to automatic review settingsDecember 23, 2025 14:47
Copy link
Contributor

CopilotAI left a 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 incmd/github-mcp-server/main.go to checkGITHUB_ACCESS_TOKEN first, 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
FileDescription
cmd/github-mcp-server/main.goImplements the environment variable fallback logic with clear precedence ordering and updated error message
e2e/e2e_test.goUpdates Docker environment variable and comments in end-to-end test setup
e2e/README.mdUpdates documentation to reference the new variable name
script/conformance-testUpdates conformance test script to use new variable name
docs/server-configuration.mdUpdates all configuration examples throughout the server configuration guide
docs/installation-guides/install-claude.mdUpdates all Claude installation examples and commands
docs/installation-guides/install-cursor.mdUpdates Docker configuration example for Cursor IDE
docs/installation-guides/install-gemini-cli.mdUpdates Gemini CLI configuration examples for both Docker and binary installations
docs/installation-guides/install-windsurf.mdUpdates Windsurf configuration example
docs/installation-guides/install-other-copilot-ides.mdUpdates configuration examples for various Copilot-enabled IDEs
docs/installation-guides/install-antigravity.mdUpdates Docker configuration example for Antigravity IDE
README.mdUpdates all examples, prerequisites section, and Docker commands; adds deprecation notice for old variable name

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

Copilot code reviewCopilotCopilot left review comments

@SamMorrowDrumsSamMorrowDrumsAwaiting requested review from SamMorrowDrums

At least 1 approving review is required to merge this pull request.

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

GITHUB_PERSONAL_ACCESS_TOKEN env var name assumes a PAT will be used

2 participants

@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp