跳到主要内容Skip to main content
← MCP

GitHub MCP ServerGitHub MCP Server

GitHub
版本控制Version control APIAPI 读写Read and write 远程Remote 本地Local 多平台Multi-platform partial lifecycle: active 核验Checked 2026-10-23

GitHub 官方自己的 MCP server(仓库自述 "GitHub's official MCP Server"), 它有本地 Docker 与远程托管两种形态。它把 GitHub 平台能力暴露给任意 MCP 客户端。

GitHub's official MCP server (repository description: "GitHub's official MCP Server"). It connects any MCP client to GitHub's platform: reading repositories and code files, managing issues and PRs, monitoring Actions, inspecting code-scanning / Dependabot findings, and reading notifications.

Two forms. The remote hosted server (https://api.githubcopilot.com/mcp/, Streamable HTTP) is "hosted by GitHub and provides the easiest method for getting up and running... no local setup or runtime required." The local server runs as an stdio process via Docker (ghcr.io/github/github-mcp-server) or a Go binary; GitHub Enterprise Server is only supported locally.

Toolsets are the headline mechanism: enable only what you need to help the LLM pick tools and shrink context. Default toolsets are context, repos, issues, pull_requests, users; 20+ groups exist in total, and the remote server adds extras (Copilot Spaces, Support Docs Search, create_pull_request_with_copilot).

Two caution notes. read-only mode is a "strict security filter" that takes precedence over everything else (write tools are skipped even if explicitly requested). Lockdown mode is explicitly "a best-effort content filter... not an authorization boundary."

Auth is OAuth (with scope challenges on the remote server) or a PAT (classic PATs get startup scope filtering; fine-grained PATs are not filtered). MIT licensed. Repository metadata (checked 2026-10-08): 33,446★, Go, latest release v2.0.2.

适合与不适合When to use it, when not to

让 MCP 客户端用自然语言操作 GitHub:读代码与仓库结构、管 issue / PR、盯 Actions、 查 code scanning 与 dependabot 告警、读通知。不想自己运维就选远程托管形态; GHES / 要自托管 HTTP / 要离线可控就选本地形态。

不适合需要本地文件系统操作的场景,那是 filesystem / git server 的职责。 也不适合需要跨会话记忆或后台续跑的场景。

Anyone who wants their MCP client (VS Code, Claude Desktop, Cursor, Windsurf, Codex, Gemini CLI, etc.) to work with GitHub in natural language — reading code and repo structure, managing issues and PRs, watching Actions, triaging code-scanning / Dependabot alerts. Users who do not want to run anything locally — pick the remote hosted form. GitHub Enterprise Server users, or anyone needing self-hosted HTTP / offline-controllable setups — pick the local form. Security-conscious setups that want read-only mode, toolset trimming and lockdown filtering.

中文生态China availability 国产 / 国内可直接用 / 备案状态 · 快照domestic / direct access / CAC filing · snapshot 2026-10-20

出品属地Origin
国外出品foreign-made 国外主体(网信办公示名单未见对应备案主体)。foreign entity (no matching filing entity in the CAC registry).
国内使用Direct access
大陆可直连direct OK 官网仓库在 GitHub,大陆直连波动(同日实测 200/000 混合);npm / PyPI 安装源实测稳定可达。Hosted on GitHub — direct reachability from mainland fluctuates (200/000 mixed on the same day); npm / PyPI install routes measured stable.
备案状态CAC filing
未见于备案名单not in filing list:未见于网信办公示名单(2026-10-20 检索 13 批附件,https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm);该产品未面向大陆公众提供服务,备案不适用。not in the CAC public registry (13 batch attachments searched 2026-10-20, https://www.cac.gov.cn/2024-04/02/c_1713729983803145.htm); the product does not serve the mainland public, so filing does not apply.

备案信息以网信办《生成式人工智能服务已备案信息》公示名单为准(按批次滚动更新,本站只抄编号不解读);「大陆可直连」是本站从大陆网络直连实测的结果,不是厂商承诺。GitHub 类站点当日实测有波动,口径写在依据里。Filing status is quoted from the CAC public registry (updated batch by batch; this site copies the number and does not interpret it). "Direct access" is this site's own reachability measurement from a mainland network, not a vendor promise. GitHub-hosted sites fluctuated on the measurement day — the note says so.

固定坐标系Fixed coordinate system

11 个维度dimensions, 与同分区其他对象逐项可比each comparable item by item against others in the same section.

模型与开放条件Model & openness

它自己不调模型。 它是被客户端调用的接口实现 —— 选哪个模型是客户端的事。

它把 GitHub 平台能力包装成 MCP 工具:仓库、issue、PR、Actions、code scanning 等。

两个细节:

  • 工具 schema 在协议版本 2026-07-28 及以后返回带类型的 structuredContent, 老客户端退回纯文本
  • 工具描述可以用 github-mcp-server-config.json 或 GITHUB_MCP_* 环境变量覆写(便于本地化)

It calls no model itself. It is an interface implementation called by clients — which model to pick is the client's business.

It wraps GitHub platform capabilities as MCP tools: repositories, issues, PRs, Actions, code scanning, etc. Two details:

  • Tool schemas return typed structuredContent on protocol version 2026-07-28 and later; older clients fall back to plain text
  • Tool descriptions can be overridden via github-mcp-server-config.json or GITHUB_MCP_* environment variables (useful for localization)
运行位置Where it runs

两种运行形态:远程托管,或本地进程。

远程托管由 GitHub 自己运营,端点 https://api.githubcopilot.com/mcp/。

本地形态有三种跑法:

  • Docker 镜像 ghcr.io/github/github-mcp-server
  • go build 出来的二进制
  • 自带 HTTP 模式 github-mcp-server http(默认端口 8082)

⚠ GitHub Enterprise Server 不支持远程托管(官方明写)。只能用本地形态。 ghe.com 可以走远程,但有独立端点。

官方对远程形态的说法:「the easiest method for getting up and running」 「no local setup or runtime required」

Two run forms: remotely hosted, or a local process.

Remote hosting is operated by GitHub itself, endpoint https://api.githubcopilot.com/mcp/.

The local form runs three ways:

  • Docker image ghcr.io/github/github-mcp-server
  • A go build binary
  • Its built-in HTTP mode github-mcp-server http (default port 8082)

⚠ GitHub Enterprise Server does not support remote hosting (stated explicitly by the official docs). Only the local form works. ghe.com can use remote hosting, but on a separate endpoint.

The official wording on the remote form: "the easiest method for getting up and running" "no local setup or runtime required"

本地文件Local files

不碰你本机的文件系统。

它操作的是 GitHub 平台:远程仓库、issue、PR。它跟你本地的 git 仓库没有直接关系。 本地 git 操作见本站的 git 条目。

唯一贴近「文件」的能力,是操作远端仓库内容:

  • get_file_contents —— 读文件或目录
  • create_or_update_file / push_files —— 写文件
  • delete_file —— 删文件

作用域是 GitHub 上的 repo / branch。容器形态下也不需要挂载本地仓库。

It never touches your local file system.

It operates on the GitHub platform: remote repositories, issues, PRs. It has no direct relation to your local git repositories. For local git operations see this site's git entry.

The only capability close to "files" is operating on remote repository content:

  • get_file_contents — read a file or directory
  • create_or_update_file / push_files — write files
  • delete_file — delete a file

The scope is repos/branches on GitHub. The container form needs no local repository mount either.

关机后的任务Tasks after shutdown

远程托管形态与你的客户端进程无关。服务在 GitHub 那边,你关机它还在线。

本地形态随客户端生死 —— stdio 子进程退出就停。 自托管 HTTP 模式则是你自己运营的常驻服务。即 github-mcp-server http 加反向代理。

⚠ 它不提供「后台任务续跑」语义。 它的模式是有状态 HTTP / stdio 会话, 官方没有断点续跑机制。所谓「一直在」指的是远程托管形态的可用性, 而这个可用性取决于 GitHub 侧的服务状态。

The remotely hosted form is independent of your client process. The service lives on GitHub's side; it stays online when you shut down.

The local form lives and dies with the client — the stdio child process stops on exit. The self-hosted HTTP mode is a resident service you operate yourself, i.e. github-mcp-server http behind a reverse proxy.

⚠ It offers no "background task resumption" semantics. Its modes are stateful HTTP / stdio sessions; there is no official checkpoint-resume mechanism. "Always on" refers to the availability of the remotely hosted form — and that availability depends on GitHub's service status.

工具与扩展Tools & extensions

工具集(toolsets)是这条目的核心机制。

裁剪能力有四层手段:

  • --toolsets / GITHUB_TOOLSETS(远程用 X-MCP-Toolsets 头,或 /x/{toolset} 路径)
  • --tools / GITHUB_TOOLS —— 精确到单个工具
  • --exclude-tools —— 排除工具
  • 远程形态下每个 toolset 一个 URL,便于按场景组合

默认工具集是 5 组:context · repos · issues · pull_requests · users。

另有 20+ 组可开:actions · code_security · dependabot · discussions · gists · git · governance · labels · notifications · orgs · projects · secret_protection · security_advisories · stargazers · code_quality · copilot 等。

远程形态还有专属工具集,如 Copilot Spaces、GitHub Support Docs Search。

Toolsets are the core mechanism of this entry.

Narrowing capability has four layers of control:

  • --toolsets / GITHUB_TOOLSETS (remote: the X-MCP-Toolsets header, or the /x/{toolset} path)
  • --tools / GITHUB_TOOLS — down to the individual tool
  • --exclude-tools — exclude tools
  • In the remote form each toolset has its own URL, easy to combine per scenario

The default toolsets are 5 groups: context · repos · issues · pull_requests · users.

Another 20+ groups can be enabled: actions · code_security · dependabot · discussions · gists · git · governance · labels · notifications · orgs · projects · secret_protection · security_advisories · stargazers · code_quality · copilot, etc.

The remote form also has exclusive toolsets, e.g. Copilot Spaces and GitHub Support Docs Search.

上下文与记忆Context & memory

没有跨会话记忆。 每次会话独立。状态在 GitHub 平台本身(仓库、issue、PR 的持久状态), 不在 server 里。

有一条官方特有的上下文控制。Insiders 模式下 list_* 工具可以返回 CSV (csv_output 特性标志),用来压缩列表类响应。

⚠ 那是响应格式优化,不是记忆机制。

官方对它的说法:「reduce response context for agents」

README 没有提供任何内建记忆或检索层。

No cross-session memory. Each session is independent. State lives on the GitHub platform itself (persistent state of repos, issues, PRs), not in the server.

One official-specific context control exists. In Insiders mode list_* tools can return CSV (the csv_output feature flag), used to compress list-type responses.

⚠ That is a response-format optimization, not a memory mechanism.

The official wording: "reduce response context for agents"

The README provides no built-in memory or retrieval layer.

权限与限制Permissions & limits

权限由 GitHub token 决定,官方另给三层收紧手段。

  • ① read-only 模式 —— --read-only / GITHUB_READ_ONLY / X-MCP-Readonly
  • ② lockdown 模式 —— --lockdown-mode / X-MCP-Lockdown
  • ③ scope filtering —— 经典 PAT 在启动时按 token scope 隐藏无权限工具; OAuth 走按需 scope challenge

read-only 是强制过滤且优先级最高:即使你显式请求写工具,也会被禁用。

⚠ lockdown 不是授权边界。 官方明确它只是 best-effort 的内容过滤器 (过滤公开仓库里无 push 权限用户产出的内容),不改变凭据本身能读写什么。

写与删除能力是齐全的:create / update / delete file、push_files、 merge_pull_request、create_repository、delete_repository 等。

高危工具要按需授权(例如 delete_repo scope)。

官方称 read-only 是「strict security filter」

Permissions are determined by the GitHub token; the official docs add three narrowing controls.

  • ① read-only mode — --read-only / GITHUB_READ_ONLY / X-MCP-Readonly
  • ② lockdown mode — --lockdown-mode / X-MCP-Lockdown
  • ③ scope filtering — classic PATs hide tools the token lacks at startup; OAuth uses on-demand scope challenges

read-only is an enforced filter with the highest precedence: even if you explicitly request write tools, they get disabled.

⚠ lockdown is not an authorization boundary. The official docs state it is only a best-effort content filter (filtering content produced by users without push access in public repositories); it does not change what the underlying credential can read or write.

Write and delete capabilities are complete: create / update / delete file, push_files, merge_pull_request, create_repository, delete_repository, etc. High-risk tools require on-demand authorization (e.g. the delete_repo scope).

The official docs call read-only a "strict security filter"

适合什么任务Best for

一句话:让任意 MCP 客户端用自然语言操作 GitHub。

客户端包括 VS Code、Claude Desktop、Cursor、Windsurf、Codex、Gemini CLI 等。

能做的事:读代码与仓库结构、管 issue 与 PR、监控 Actions。 还能查 code scanning / dependabot 安全告警、读通知。

远程托管形态适合「不想自己运维」的人。 本地 Docker 形态适合:GitHub Enterprise Server 用户 · 需要自托管 HTTP 的人 · 要离线可控的人。

不适合两类场景。一是需要操作本地文件系统,那是 filesystem / git server 的活。 二是需要跨会话记忆的场景。

In one sentence: it lets any MCP client operate GitHub in natural language.

Clients include VS Code, Claude Desktop, Cursor, Windsurf, Codex, Gemini CLI, etc. What it can do: read code and repository structure, manage issues and PRs, monitor Actions. It can also check code scanning / dependabot security alerts and read notifications.

The remotely hosted form suits people who do not want to operate it themselves. The local Docker form suits: GitHub Enterprise Server users · people who need self-hosted HTTP · people who want offline control.

Not a fit for two kinds of scenarios. First, operating the local file system — that is the filesystem / git server's job. Second, scenarios needing cross-session memory.

传输方式Transport

两种形态:本地 stdio,或远程托管 HTTP。

本地形态走 stdio,两种跑法:Docker 镜像 ghcr.io/github/github-mcp-server,或 github-mcp-server stdio 二进制。

远程托管形态走 Streamable HTTP,端点是 https://api.githubcopilot.com/mcp/。

还能自托管 HTTP 模式(github-mcp-server http),支持 OAuth 元数据端点与 scope challenge。

远程形态可以加 URL 路径修饰:

  • /readonly —— 只读
  • /insiders —— 内部特性
  • /x/{toolset} —— 只暴露某个 toolset
  • 以上可以互相组合

⚠ 不同形态的权限边界不一样,必须分别配置。

核验:官方 README 与 remote-server.md(2026-10-08)

Two forms: local stdio, or remotely hosted HTTP.

The local form uses stdio, two ways to run: the Docker image ghcr.io/github/github-mcp-server, or the github-mcp-server stdio binary.

The remotely hosted form uses Streamable HTTP, endpoint https://api.githubcopilot.com/mcp/.

You can also self-host the HTTP mode (github-mcp-server http), with OAuth metadata endpoints and scope challenges.

The remote form accepts URL path modifiers:

  • /readonly — read-only
  • /insiders — insider features
  • /x/{toolset} — expose only one toolset
  • These can be combined

⚠ The permission boundary differs between forms and must be configured separately.

Verified against: the official README and remote-server.md (2026-10-08)

认证机制Authentication

本地 stdio 有三种认证方式。

  • 浏览器 OAuth —— github.com 上官方镜像自带 app 凭据,token 只存内存
  • PAT —— 环境变量 GITHUB_PERSONAL_ACCESS_TOKEN,优先级高于 OAuth
  • GitHub App —— 给非交互式的 stdio 用

远程托管两种:OAuth(用 GitHub 凭据,缺 scope 时按需 scope challenge), 或 PAT(请求头 Authorization: Bearer)。

⚠ 一个容易踩的坑:两类 PAT 的行为不同。

  • 细粒度 PAT(github_pat_)不做 scope 过滤 —— 所有工具都显示, 权限由 API 侧强制
  • 经典 PAT(ghp_) 才在启动时按 scope 隐藏工具

GitHub Enterprise Server / ghe.com 需要自带 OAuth App 或 GitHub App。

Local stdio has three authentication methods.

  • Browser OAuth — on github.com the official mirror ships app credentials; the token is kept in memory only
  • PAT — environment variable GITHUB_PERSONAL_ACCESS_TOKEN, takes precedence over OAuth
  • GitHub App — for non-interactive stdio

Remote hosting has two: OAuth (using GitHub credentials, with on-demand scope challenges when a scope is missing), or a PAT (the Authorization: Bearer header).

⚠ An easy trap: the two PAT kinds behave differently.

  • Fine-grained PATs (github_pat_) do no scope filtering — all tools are shown, permissions are enforced API-side
  • Only classic PATs (ghp_) hide tools by scope at startup

GitHub Enterprise Server / ghe.com require your own OAuth App or GitHub App.

权限范围Permission scope

作用域就是 GitHub token 的权限范围 —— 能读,也能写和删。

可以收紧的有三层:read-only 模式强制只读(优先级最高)· toolsets 裁剪缩小暴露面 · lockdown 模式过滤不可信内容 (⚠ 官方强调它不是授权边界)。

写 / 删除能力是齐全的,例如:

  • 文件:create_or_update_file / push_files / delete_file
  • 仓库:create_repository / delete_repository(需 delete_repo)
  • PR:create_pull_request / merge_pull_request
  • 其它:label_write / projects_write / create_repository_ruleset

没有独立的审批机制。 delete_repository 会走多轮确认, 但那是交互式 elicitation,不是审批层 —— 别把它当审批用。

The scope is the permission range of the GitHub token — it can read, and also write and delete.

Three layers can narrow it: read-only mode enforces read-only (highest precedence) · toolsets trimming shrinks the exposed surface · lockdown mode filters untrusted content (⚠ the official docs stress it is not an authorization boundary).

Write / delete capabilities are complete, for example:

  • Files: create_or_update_file / push_files / delete_file
  • Repositories: create_repository / delete_repository (requires delete_repo)
  • PRs: create_pull_request / merge_pull_request
  • Others: label_write / projects_write / create_repository_ruleset

There is no independent approval mechanism. delete_repository goes through multi-round confirmation, but that is interactive elicitation, not an approval layer — do not treat it as one.

头号误解Top misconception

  • 误以为它是已归档的旧 MCP 组织参考 server——那是 servers-archived 里的 github server,本 server 是 GitHub 官方活跃产品线Mistaking it for the archived reference server in the MCP org — that one lives in servers-archived; this is GitHub's official, actively maintained product line
  • 把 lockdown 模式当安全边界——官方明文它只是 best-effort 内容过滤,不改变凭据能读写什么Treating lockdown mode as a security boundary — the official text says it is best-effort content filtering and does not change what the credentials can read or write
  • 以为 read-only 只是默认值——它是强制过滤:即使显式 --tools 请求写工具也会被禁用Assuming read-only is merely a default — it is enforced filtering: write tools stay disabled even when explicitly requested with --tools

未知项清单Known unknowns

  • 「动态工具发现」能力(--dynamic-toolsets 一类):官方当前 README 与 docs 未说明(已查 README、server-configuration.md、remote-server.md、insiders-features.md、feature-flags.md、streamable-http.md、scope-filtering.md 七页);现有运行时可调机制只有 Feature Flags(--features / X-MCP-Features)与 Insiders 模式
  • 工具级人工审批机制(官方未说明;官方只有 read-only / lockdown / OAuth 挑战三类收紧手段)
  • Hosted 形态的 SLA / 限流细则(README 与 remote-server.md 未给数字)
  • lockdown 在各工具上的完整过滤矩阵(官方只列了 issue_read / pull_request_read 下几支)
  • 自托管 HTTP 模式在反向代理下的配额与运维细节(官方给配置项,未给容量数字)
  • The "dynamic tool discovery" capability (a --dynamic-toolsets kind of thing): not stated in the current official README or docs (checked seven pages: README, server-configuration.md, remote-server.md, insiders-features.md, feature-flags.md, streamable-http.md, scope-filtering.md); the only runtime-adjustable mechanisms are Feature Flags (--features / X-MCP-Features) and Insiders mode
  • A tool-level human approval mechanism (not stated officially; the official docs offer only three narrowing controls: read-only / lockdown / OAuth challenges)
  • SLA / rate-limit details of the hosted form (neither README nor remote-server.md gives numbers)
  • The complete lockdown filtering matrix across tools (the official docs list only a few branches under issue_read / pull_request_read)
  • Quota and operational details of the self-hosted HTTP mode behind a reverse proxy (the official docs give config knobs, no capacity numbers)

证据来源Evidence sources

判断可回到以下一手源复核。本站核验日Every judgement can be rechecked against the primary sources below. Verified on 2026-10-23,内容更新日content updated on 2026-10-08。

类型Type名称Name链接Link
repogithub/github-mcp-server · 仓库(33,871★,MIT,滚动核验 2026-10-23)github/github-mcp-server · repository (33,871★, MIT, rolling re-check 2026-10-23)https://github.com/github/github-mcp-server
docs主 README(远程/本地两形态、toolsets 全表、read-only / lockdown、i18n 覆写、认证)Main README (remote/local two forms, full toolsets table, read-only / lockdown, i18n overrides, authentication)https://github.com/github/github-mcp-server/blob/main/README.md
docsRemote Server 文档(远程端点 api.githubcopilot.com/mcp/、URL 路径修饰、X-MCP-* 头)Remote Server docs (remote endpoint api.githubcopilot.com/mcp/, URL path modifiers, X-MCP-* headers)https://github.com/github/github-mcp-server/blob/main/docs/remote-server.md
docsServer Configuration 指南(toolsets / tools / exclude / read-only / lockdown / insiders / scope filtering 的配置矩阵)Server Configuration guide (configuration matrix for toolsets / tools / exclude / read-only / lockdown / insiders / scope filtering)https://github.com/github/github-mcp-server/blob/main/docs/server-configuration.md
docsPAT Scope Filtering(经典 PAT 按 scope 隐藏工具、OAuth scope challenge、细粒度 PAT 不过滤)PAT Scope Filtering (classic PAT hides tools by scope, OAuth scope challenge, fine-grained PAT no filtering)https://github.com/github/github-mcp-server/blob/main/docs/scope-filtering.md
docsStreamable HTTP Server(自托管 HTTP 模式、OAuth 元数据端点、scope challenge)Streamable HTTP Server (self-hosted HTTP mode, OAuth metadata endpoints, scope challenge)https://github.com/github/github-mcp-server/blob/main/docs/streamable-http.md
docsInsiders Features(CSV 输出压缩列表响应、实验特性标志)Insiders Features (CSV output compressing list responses, experimental feature flags)https://github.com/github/github-mcp-server/blob/main/docs/insiders-features.md
changelogReleases(最新 v2.0.2 @ 2026-10-08)Releases (latest v2.0.2 @ 2026-10-08)https://github.com/github/github-mcp-server/releases

实测记录Measured runs

本档未在真实客户端逐项跑通;工具清单与权限来自官方 README。

实测建议:这个 server 的实测重点是「收得住吗」——

#测什么为什么值得测
1只开 repos 工具集 + read-only,写工具是否真被禁官方称 read-only 优先级最高,需验证
2lockdown 下,无权用户 issue 内容是否真被过滤官方已声明它不是安全边界,验证实际强度
3经典 PAT vs 细粒度 PAT 的工具可见性差异官方说细粒度 PAT 不做 scope 过滤,易被误判为「权限一致」
4远程托管与本地 Docker 的工具集差异(Copilot 专属工具)两形态工具面不同,选型前要确认
5delete_repository 多轮确认在 HTTP 模式下的前置条件需配置 GITHUB_MCP_SERVER_MRTR_STATE_KEY,否则不暴露

This site has not completed measured runs. The test protocol is at protocols/mcp/_protocol.md.

Suggested measurement: the focus for this server is "can it be reined in" —

#What to testWhy it is worth testing
1With only the repos toolset + read-only, are write tools really disabledThe official docs claim read-only has the highest precedence; needs verification
2Under lockdown, is content from unauthorized users' issues really filteredThe official docs already say it is not a security boundary; verify its actual strength
3Tool-visibility differences between classic PAT vs fine-grained PATThe official docs say fine-grained PATs do no scope filtering — easily misread as "identical permissions"
4Toolset differences between remote hosting and local Docker (Copilot-exclusive tools)The two forms expose different tool surfaces; confirm before choosing
5Prerequisites of delete_repository's multi-round confirmation in HTTP modeRequires GITHUB_MCP_SERVER_MRTR_STATE_KEY to be configured, otherwise the tool is not exposed

GitHub MCP Server 与旧 reference server 不是同一条线⚠ First, the easiest mix-up to clear up

它不是 MCP 组织那个已归档的参考 server。原 github reference server 已归档至 servers-archived, 而本条目指的是 GitHub 官方仓库 github/github-mcp-server—— 活跃维护(滚动核验 2026-10-23:最新 release v2.0.3 @ 2026-10-21)、MIT、33k+ 星。

修这条的理由很直接:两条目同名,搜「github mcp server」会同时命中「已归档的参考实现」与 「GitHub 官方活跃产品」,而它们的能力与维护状态完全不同。

It is not the archived reference server from the MCP organization. The original github reference server was archived to servers-archived, while this entry refers to GitHub's own repository github/github-mcp-server — actively maintained (rolling re-check 2026-10-23: latest release v2.0.3 @ 2026-10-21), MIT, 33k+ stars.

The reason for fixing this entry is direct: the two entries share a name, and searching "github mcp server" hits both "the archived reference implementation" and "GitHub's official active product", whose capabilities and maintenance status are completely different.

两种形态The two forms

远程托管本地
端点 / 命令https://api.githubcopilot.com/mcp/Docker ghcr.io/github/github-mcp-server / github-mcp-server stdio
传输Streamable HTTPstdio
谁运维GitHub你
认证OAuth / PATOAuth(浏览器,token 仅内存)/ PAT
前提客户端支持远程 MCPDocker 或 Go 二进制
GHES不支持支持(--gh-host / GITHUB_HOST)

官方对远程形态的定位原话:"the easiest method for getting up and running"、 "no local setup or runtime required";本地形态是给不支持远程的客户端 / GHES 用的后备。

Remotely hostedLocal
Endpoint / commandhttps://api.githubcopilot.com/mcp/Docker ghcr.io/github/github-mcp-server / github-mcp-server stdio
TransportStreamable HTTPstdio
Who operates itGitHubYou
AuthenticationOAuth / PATOAuth (browser, token in memory only) / PAT
PrerequisiteThe client supports remote MCPDocker or the Go binary
GHESNot supportedSupported (--gh-host / GITHUB_HOST)

The official positioning of the remote form, original wording: "the easiest method for getting up and running", "no local setup or runtime required"; the local form is the fallback for clients that do not support remote MCP / for GHES.

Toolsets:本 server 最值得讲的设计Toolsets: the design most worth talking about in this server

默认只加载 5 组(context / repos / issues / pull_requests / users), 其余要显式开启——官方理由是「帮 LLM 做工具选择、减小上下文」。配置四件套:

  • --toolsets / GITHUB_TOOLSETS(远程:X-MCP-Toolsets 头 或 /x/{toolset} URL)
  • --tools / GITHUB_TOOLS(精确到单个工具)
  • --exclude-tools / GITHUB_EXCLUDE_TOOLS(排除,优先级高于前两者)
  • all 特殊值开全部工具集

远程与本地工具集不完全相同:远程额外有 Copilot Spaces、GitHub Support Docs Search, 以及调用 Copilot coding agent 的 create_pull_request_with_copilot 工具。

Only 5 groups load by default (context / repos / issues / pull_requests / users); the rest must be enabled explicitly — the official rationale is "helping LLMs choose tools and reducing context". The configuration quartet:

  • --toolsets / GITHUB_TOOLSETS (remote: the X-MCP-Toolsets header or the /x/{toolset} URL)
  • --tools / GITHUB_TOOLS (down to the individual tool)
  • --exclude-tools / GITHUB_EXCLUDE_TOOLS (exclusions; takes precedence over the previous two)
  • The special value all enables every toolset

Remote and local toolsets are not identical: remote additionally has Copilot Spaces and GitHub Support Docs Search, plus the create_pull_request_with_copilot tool that invokes the Copilot coding agent.

read-only 与 lockdown:两个容易高估的开关read-only and lockdown: two switches easy to overestimate

模式开关官方定性
read-only--read-only / X-MCP-Readonlystrict security filter,优先级最高,显式请求写工具也禁用
lockdown--lockdown-mode / X-MCP-Lockdownbest-effort 内容过滤,不是授权边界

lockdown 的边界官方写得很实。它只减少一种 prompt injection 风险:公开仓库里无 push 权限用户产出的内容。 它不改变底层凭据能读写什么。被过滤响应里隐藏的内容仍可能通过其他工具拿到。也可以直接调 GitHub API 拿到 (github-actions[bot] 与 copilot 是例外,始终视为可信)。

ModeSwitchOfficial characterization
read-only--read-only / X-MCP-Readonlystrict security filter, highest precedence; explicitly requested write tools still get disabled
lockdown--lockdown-mode / X-MCP-Lockdownbest-effort content filter, not an authorization boundary

The official docs are concrete about lockdown's boundary. It reduces exactly one prompt-injection risk: content produced by users without push access in public repositories. It does not change what the underlying credential can read or write. Content hidden from filtered responses may still be reachable through other tools, or by calling the GitHub API directly (github-actions[bot] and copilot are exceptions, always treated as trusted).

认证与权限:token 决定一切Authentication and permissions: the token decides everything

  • 经典 PAT(ghp_):启动时按 X-OAuth-Scopes 隐藏无权限工具。
  • OAuth(远程):不预隐藏,改用 scope challenge——用到缺 scope 的工具时按需提示授权。
  • 细粒度 PAT(github_pat_)/ GitHub App:不做工具过滤,全量显示,权限由 GitHub API 侧强制。

官方给的凭据最佳实践:最小 scope(repo / read:packages / read:org)、按环境分 token、 定期轮换、别硬编码。部分宿主如 Windsurf 只能硬编码,官方也点出了这个例外。

  • Classic PAT (ghp_): at startup, tools the token lacks are hidden based on X-OAuth-Scopes.
  • OAuth (remote): no pre-hiding; instead a scope challenge — when a tool missing a scope is used, authorization is requested on demand.
  • Fine-grained PAT (github_pat_) / GitHub App: no tool filtering; everything is shown; permissions are enforced by the GitHub API side.

The official credential best practices: minimal scopes (repo / read:packages / read:org), separate tokens per environment, regular rotation, no hardcoding. Some hosts such as Windsurf can only hardcode, and the official docs call out that exception too.

核验说明Verification notes

confidence: partial 的依据(2026-10-08):

八维与 mcp 三维均给出结论,但有两处官方文档本身没有内容,只能落「官方未说明」: 所谓「动态工具发现」在当前官方文档中查不到(见未知项)。工具级审批机制官方也未提供。 这些都非取证缺口,而是官方当前未提供,故不足以升到 verified。

已核到的官方页:README(两形态、toolsets 全表、认证、read-only / lockdown、i18n 覆写)、 docs/remote-server.md(端点、URL 修饰、X-MCP-* 头)、docs/server-configuration.md、 docs/scope-filtering.md、docs/streamable-http.md、docs/insiders-features.md、docs/feature-flags.md; 仓库元数据经 GitHub API 核验(33,871★、MIT、语言 Go、最近推送 2026-10-22、最新版 v2.0.3;滚动核验 2026-10-23)。

The basis for confidence: partial (2026-10-08):

All eight dimensions and the three mcp dimensions carry conclusions, but in two places the official docs themselves have no content, leaving only "not stated officially": so-called "dynamic tool discovery" cannot be found in current official docs (see unknowns). The official docs also provide no tool-level approval mechanism. These are not evidence gaps but things the official side currently does not provide, which is why it cannot be raised to verified.

Official pages verified on 2026-10-08: README (two forms, the full toolsets table, authentication, read-only / lockdown, i18n overrides), docs/remote-server.md (endpoint, URL modifiers, X-MCP-* headers), docs/server-configuration.md, docs/scope-filtering.md, docs/streamable-http.md, docs/insiders-features.md, docs/feature-flags.md; repository metadata verified via the GitHub API (33,871★, MIT, Go, last push 2026-10-22, latest release v2.0.3; rolling re-check 2026-10-23).

相关条目Related entries

  • Git MCP ServerGit MCP Server最该对照的一条:git server 只做本地仓库操作、不含 push/PR,并明确提到原 github 参考 server 已归档;本条目正是那个「远程 GitHub 操作」的官方替代。The entry to contrast most: the git server does local repository operations only, with no push/PR, and explicitly notes the original github reference server is archived; this entry is precisely the official replacement for that "remote GitHub operations" role.
  • Filesystem MCP ServerFilesystem MCP Server作用域/权限设计对照:filesystem 是本地目录白名单,github-mcp 是远端 GitHub token 作用域。Scope/permission-design contrast: filesystem is a local directory allowlist; github-mcp is a remote GitHub token scope.
  • Context7Context7同类对照:Context7 是纯远程托管、无本地权限风险;github-mcp 是「本地 + 远程」双形态且具完整写/删能力。Same-kind contrast: Context7 is purely remotely hosted with no local permission risk; github-mcp is a "local + remote" dual form with full write/delete capability.
  • GitHub CopilotGitHub Copilot另一层 · AI 编程Other layer · AI coding

本页由This page is generated from the ai-handbook 数据层生成(CC BY 4.0)。data layer (CC BY 4.0). 方法论与坐标系定义见仓库内For the methodology and coordinate definitions, see METHODOLOGY.md.