GitHub
Work with GitHub from Claude, ChatGPT or Copilot through GitHub's official MCP server: read code and commits, search repositories, triage issues, and open and review pull requests.
7 天免费 · 无需信用卡 · EU 托管
问 GitHub 任何事
通过 AnythingMCP 对 GitHub 试一个真实提示 — Claude 调用工具并返回答案。在你的消息上按 Enter 即可在 Cloud 安装。
在 Cloud 上安装 GitHubClaude 是 AI,可能会出错。请核对回答。
2 分钟设置
- 1在 cloud.anythingmcp.com 开始免费试用。
- 2在连接器商店点击 GitHub。提示时粘贴凭据。
- 3生成 MCP API 密钥,将 AI 客户端指向生成的 MCP URL。
GitHub 指南
面向主流 AI 客户端的逐步设置。
配置 GitHub
直接来自连接器定义:在哪里获取凭据、需要哪些权限,以及该适配器调用的是哪个 API。 由连接器作者以英文提供。
This connector bridges GitHub's official remote MCP server (https://api.githubcopilot.com/mcp/), hosted by GitHub and built from GitHub's open-source github-mcp-server. GitHub's own server provides the tools; with its default toolsets (context, repos, issues, pull_requests, users) that is repositories, files, branches, commits, tags and releases, issues and sub-issues, pull requests and reviews, code, commit and user search, and your own profile and teams. AnythingMCP puts them behind your MCP endpoint with OAuth for Claude and ChatGPT, per-tool roles, the audit log and response mapping, next to your other systems. Every tool gets the prefix github_, so GitHub's list_issues becomes github_list_issues and never collides with another connector's tool of the same name.
The tools come from the server. At install AnythingMCP asks GitHub's server which tools it has, so you get the set GitHub serves for your token today. GitHub changes the set regularly: open the connector and click Discover tools to pick up new ones.
Setup (about 5 minutes):
- On GitHub open Settings > Developer settings > Personal access tokens > Fine-grained tokens > Generate new token. Pick the resource owner (your account or an organization), an expiry, and Only select repositories with the repositories the AI should reach.
- Under Repository permissions give Contents, Issues and Pull requests Read-only, or Read and write where the AI should create branches, commit, open issues or pull requests (Metadata read-only is added automatically). For
get_teamsandget_team_membersadd the organization permission Members: Read-only. - If the owner is an organization, an organization owner may have to approve the token first (organization Settings > Personal access tokens > Pending requests); until then its repositories answer 403 or 404. Organizations with SAML single sign-on also need the token authorized for SSO.
- Paste the token into
GITHUB_PATand install. A classic token (ghp_, scoperepo, plusread:orgfor teams) works too, but it reaches every repository you can, so prefer a fine-grained one.
Organization policies: in organizations on Copilot Business or Copilot Enterprise, the MCP servers in Copilot policy must be enabled for the GitHub MCP server to be usable; if it is off, ask an organization or enterprise admin. Organizations can also restrict personal access tokens, and enterprises with Enterprise Managed Users may have them disabled altogether, in which case this connector cannot sign in with a token. GitHub Enterprise Cloud with data residency uses its own host: change the base URL to https://copilot-api.<your-subdomain>.ghe.com/mcp. GitHub Enterprise Server has no hosted MCP server.
Toolsets and read-only mode: to serve other toolsets, open the connector editor and add under Headers X-MCP-Toolsets with a comma-separated list, for example repos,issues,pull_requests,actions (default keeps the default set, all turns on everything). Add X-MCP-Readonly: true to expose only read tools, whatever the token could do. Then click Discover tools.
Safety: switched off at install: merge_pull_request, push_files, create_or_update_file (they change a branch's code directly), and delete_file. Tools that a toolset header adds later, such as delete_repository, arrive switched off as well. Turn one on per tool if the AI really needs it, ideally with a token limited to the repositories involved. Everything runs as the token's owner: reviews submitted with pull_request_review_write count as that person's reviews and approvals. Issue, pull request and comment text on public repositories can be written by anyone; treat it as untrusted input (the header X-MCP-Lockdown: true makes GitHub hide content from authors without push access).
Working with it: start with github_get_me (who the token is), then github_search_repositories, github_get_file_contents, github_list_issues or github_search_issues, and github_pull_request_read. A 401 means the token is wrong, expired or revoked; a 403 means a missing permission, an organization approval or SSO authorization still pending, or a policy; a 404 on a private repository usually means the token does not include it. GitHub's API rate limits apply to the token's owner, and an organization IP allow list applies to token access as well.