MCP Configs2026年3月29日·1 分钟阅读

GitHub MCP Server

GitHub's official MCP server. Connect Claude Code or Cursor to GitHub for managing repos, issues, PRs, and Actions via natural language.

TO
TokRepo精选 · Community
快速使用

先拿来用,再决定要不要深挖

这里应该同时让用户和 Agent 知道第一步该复制什么、安装什么、落到哪里。

Add to your .mcp.json (VS Code / Claude Code):

{
  "servers": {
    "github": {
      "type": "http",
      "url": "https://api.githubcopilot.com/mcp/"
    }
  }
}

Or run locally with Docker:

docker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN=your_token ghcr.io/github/github-mcp-server

介绍

GitHub's official MCP server — the first-party integration that connects any MCP-compatible AI tool (Claude Code, Cursor, VS Code Copilot, Windsurf) directly to GitHub. Browse repos, manage issues and PRs, trigger Actions, review security alerts, all through natural language. 28,000+ GitHub stars.


Available Toolsets

Toolset What It Does
repos Browse files, search code, manage branches, create commits
issues Create, update, comment on issues
pull_requests Open PRs, request reviews, merge
actions List workflows, trigger runs, get job logs
code_security Code scanning alerts, secret detection
dependabot Dependency vulnerability alerts
discussions Access GitHub Discussions
notifications Manage notification inbox
projects GitHub Projects board operations

Default: repos, issues, pull_requests, users, context

Enable all: Set GITHUB_TOOLSETS="all"

Configuration Examples

Claude Code (.mcp.json with PAT)

{
  "servers": {
    "github": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-e", "GITHUB_PERSONAL_ACCESS_TOKEN", "ghcr.io/github/github-mcp-server"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_your_token_here"
      }
    }
  }
}

Select specific toolsets

docker run -i --rm   -e GITHUB_PERSONAL_ACCESS_TOKEN=your_token   -e GITHUB_TOOLSETS="repos,issues,pull_requests,actions"   ghcr.io/github/github-mcp-server

Read-only mode

docker run -i --rm   -e GITHUB_PERSONAL_ACCESS_TOKEN=your_token   -e GITHUB_READ_ONLY=1   ghcr.io/github/github-mcp-server

Key Tools

  • get_file_contents — Read any file or directory
  • search_code — Search across repositories
  • create_or_update_file — Commit file changes
  • create_pull_request / merge_pull_request — PR lifecycle
  • issue_read / issue_write — Issue management
  • get_job_logs — CI/CD debugging

Authentication

Create a PAT at github.com/settings/personal-access-tokens/new. Recommended scopes: repo, read:packages, read:org.


来源与感谢

Author: GitHub Repository: github-mcp-server — ⭐ 28,300+ License: MIT

The official GitHub MCP integration, maintained by GitHub's engineering team.

相关资产