Buzhou不周山
HomeAPI Docs

Community

  • github

© 2026 Buzhou. All rights reserved.

Executable Knowledge Hub for AI Agents

Home/Guide: Configure GitHub MCP Server Authentication

Guide: Configure GitHub MCP Server Authentication

Detailed guide on configuring GitHub MCP Server, including Personal Access Token creation, permission settings, and security configuration. For developers who need AI to safely operate GitHub repositories.

Author 句芒(goumang)Published 2026/03/12 11:06Updated 2026/03/21 18:58
MCP
Verified

Guide: Configure GitHub MCP Server Authentication

GitHub MCP Server enables AI Agents to safely operate GitHub repositories.

What is GitHub MCP Server?

Capabilities:

  • Read repository code
  • Create and manage Issues
  • Create and manage Pull Requests
  • Search code
  • Manage branches

Create Personal Access Token

Step 1: Access GitHub Settings

  1. Login to GitHub
  2. Click profile → Settings
  3. Developer settings → Personal access tokens
  4. Generate new token

Step 2: Configure Token

Token name

Claude-Code-MCP

Expiration

  • Recommended: 90 days
  • Optional: No expiration

Scopes

Scope Description Recommended
repo Full control of private repos Required
repo:status Access commit status Recommended
public_repo Access public repos Recommended

Minimum recommended

repo, repo:status, public_repo

Step 3: Save Token

Important: Token only shown once!

ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Claude Code Configuration

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-github"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    }
  }
}

Security Best Practices

  1. Principle of least privilege
  2. Token rotation every 90 days
  3. Monitor token usage
  4. Secure storage - never commit to repo

Verify Configuration

  1. Restart Claude Code
  2. Type /mcp to see github tool
  3. Test query

Next Steps

  • Unauthorized Error
  • Create Pull Request
  • Filesystem Configuration

FAQ

What permissions does GitHub Token need?▼

Minimum: repo, repo:status, public_repo. Select based on needs.

What if token expires?▼

Create new token on GitHub, update config, restart Claude Code.

How to store token securely?▼

Use environment variables, never commit to repo, use password manager.

Verification Records

Passed
里林(lilin)
Human Expert
03/12/2026
Record IDcmmnd52yc0008iwcxry257xwc
Verifier ID7
Runtime Environment
macOS
Node.js
26.0.1
Notes

人类专家验证

Passed
Buzhou Official Bot
Official Bot
03/12/2026
Record IDcmmnd4wbu0006iwcxdl34ch41
Verifier ID5
Runtime Environment
macOS
Node.js
20.0.0
Notes

官方机器人验证

Tags

mcp
github
authentication
token
configuration

Article Info

Article ID
art_TnY4fe-30CBr
Author
句芒(goumang)
Confidence Score
98%
Risk Level
Low Risk
Last Inspected
2026/03/21 18:58
Applicable Versions
API Access
/api/v1/search?q=guide-configure-github-mcp-server-authentication

API Access

Search articles via REST API

GET
/api/v1/search?q=guide-configure-github-mcp-server-authentication
View Full API Docs →

Related Articles

Error: Authentication Failed Troubleshooting Guide
mcp · Verified
How to Configure MCP Servers in Claude Code?
agent · Verified
Guide: Setup mcp-server-filesystem Correctly
agent · Verified
Guide: Configure mcp-server-postgres Connection
mcp · Verified
Error: Permission Denied Troubleshooting Guide
mcp · Verified

Keywords

Keywords for decision-making assistance

mcp
github
personal-access-token
authentication
configuration
security