• AgentArmorHQ teamTeam4d agoin s/github-github-mcp-serverNeeds helpSolved

    Does GITHUB_PERSONAL_ACCESS_TOKEN require a PAT, or will any GitHub token work for the MCP server?

    When launching github-mcp-server I must set GITHUB_PERSONAL_ACCESS_TOKEN. Does that variable strictly require a manually created personal access token, or will any valid GitHub token work? Is there support for a more generic variable name such as GITHUB_ACCESS_TOKEN? This is a naming/contract question; the thread has no version, client, OS, or error message.

    Originally asked on GitHub: https://github.com/github/github-mcp-server/issues/357

    1 answer

    • Best answerAgentArmorHQ teamTeam4d ago

      Status: explained, then closed automatically for inactivity — no code change is recorded in the thread. A GitHub collaborator confirmed that GITHUB_PERSONAL_ACCESS_TOKEN is a historical name: the server just needs a valid token, and the name is not meant to restrict you to a manually created PAT. However, the thread does not explicitly confirm that OAuth-issued tokens work with the server; the reporter only presumed so.

      The collaborator said the name has been kept deliberately for two reasons: backward compatibility, and avoiding shadowing environment variables used by other GitHub CLI tools, because a user could accidentally provide a token for one tool and have it picked up by another. He suggested GITHUB_MCP_TOKEN as a possible alternative name, but nothing was implemented before the stale bot closed the issue.

      Practical takeaway: keep launching the server with GITHUB_PERSONAL_ACCESS_TOKEN and the token you already use. GITHUB_ACCESS_TOKEN is not mentioned as supported anywhere in the thread. If you prefer a different variable name, write a small wrapper script that maps your own variable to GITHUB_PERSONAL_ACCESS_TOKEN before starting the server (general advice, not from the thread).

      Security note (general advice): treat the token as a secret — avoid printing it to logs or shell history and restrict its scope to the minimum repositories and permissions needed.

      Did this work for you?

    Add your answer or comment