MCP Configs2026年4月2日·1 分钟阅读

GitHub MCP Server — Official GitHub AI Integration

GitHub's official MCP server that lets AI assistants manage repos, issues, PRs, Actions, and code search through the Model Context Protocol.

Agent 就绪

这个资产会安全暂存

这个资产会先安全暂存。复制的指令会要求 Agent 读取暂存文件,并在激活脚本、MCP 配置或全局配置前先确认。

Stage only · 17/100策略:需暂存
Agent 入口
任意 MCP/CLI Agent
类型
Mcp Config
安装
Stage only
信任
信任等级:Community
入口
github-mcp-server.md
安全暂存命令
npx -y tokrepo@latest install 679a2650-b97b-4e8e-af6e-b51bafcbf610 --target codex

先暂存文件;激活前需要读取暂存 README 和安装计划。

TL;DR
GitHub's official MCP server gives AI assistants direct access to repos, issues, PRs, Actions, and code search.
§01

What it is

GitHub MCP Server is the official Model Context Protocol server built by GitHub that connects AI coding assistants to the GitHub platform. It translates natural language requests into GitHub API calls, enabling AI tools to manage repositories, issues, pull requests, code reviews, Actions workflows, and security alerts.

The server targets developers using AI coding assistants like Claude Code who want their agent to interact with GitHub directly -- creating issues, reviewing PRs, searching code, and monitoring CI/CD pipelines without switching to the browser.

§02

How it saves time or tokens

Without the MCP server, interacting with GitHub from an AI assistant requires manual copy-paste of URLs, issue descriptions, and PR diffs. The MCP server provides structured access to all GitHub data, so the assistant can read, search, and write to GitHub in a single conversation. This eliminates context switching between the AI tool and the GitHub web interface.

The token estimate is approximately 636 tokens for the server configuration itself. Actual token usage depends on the scope of GitHub operations performed.

§03

How to use

  1. Add the MCP server to your AI assistant configuration:
{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<your-token>"
      }
    }
  }
}
  1. Generate a GitHub Personal Access Token with the scopes your workflow needs (repo, issues, pull requests).
  1. Start your AI assistant. The MCP server connects automatically and exposes GitHub tools.
§04

Example

Once configured, your AI assistant can perform GitHub operations directly:

# Example interactions through the MCP server:
# 'Search for open issues labeled bug in my-org/my-repo'
# 'Create a PR from feature-branch to main with this description'
# 'Show me the failing CI checks on PR #42'
# 'List recent commits on the main branch'

The server exposes tools for:

- Repository: search, browse files, list branches, read commits
- Issues: create, update, comment, label, close
- Pull Requests: create, review, merge, request changes
- Actions: list workflows, view run logs, re-run jobs
- Code Search: search across public and private repos
- Security: code scanning alerts, Dependabot, secret scanning
§05

Related on TokRepo

§06

Common pitfalls

  • The Personal Access Token scope determines what the MCP server can access. A token with only public_repo scope cannot interact with private repositories. Create a fine-grained token with exactly the permissions you need.
  • The Docker-based setup requires Docker running locally. For environments without Docker, the server can also run as a standalone Go binary.
  • Rate limiting applies to all GitHub API calls made through the MCP server. Heavy usage (bulk issue creation, large code searches) can exhaust your hourly API quota.

常见问题

What permissions does the GitHub token need?+

The token needs scopes matching your use case. For basic repo and issue operations, the repo scope is sufficient. For Actions, add the workflow scope. For security alerts, add the security_events scope. Fine-grained tokens let you limit access to specific repositories.

Does the MCP server work with private repositories?+

Yes, if the Personal Access Token has the repo scope. The MCP server accesses GitHub through the authenticated API, so it can see everything the token owner can see.

Can I use this with Claude Code?+

Yes. Add the MCP server configuration to your Claude Code MCP settings. Claude Code will discover the GitHub tools automatically and can use them during conversations.

Is the MCP server open source?+

Yes. The GitHub MCP server is MIT licensed and the source code is available on GitHub. It is built in Go and can be compiled from source or run as a Docker container.

Does it support GitHub Enterprise?+

The MCP server can be configured to point at GitHub Enterprise Server instances by setting the appropriate base URL environment variable. Check the repository README for Enterprise-specific configuration.

引用来源 (3)
🙏

来源与感谢

Thanks to the GitHub team for building the official integration that sets the standard for MCP server quality and security.

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产