
Github Mcp
io.github.jaimenbell由 GitHub 账号 jaimenbell 发布v0.1.1更新于 Nov 3, 2026
MCP server for the GitHub REST API: issues, PRs, repos; read always on, write env-gated.
概览
面向 GitHub REST API 的本地 MCP 服务器,让助手读取仓库、议题、PR、文件与提交,议题/PR 写操作默认关闭。
- 可以做什么
- 读取仓库元数据、搜索公开仓库、查询公开用户或组织资料
- 列出并获取议题与拉取请求,列出某个分支或引用上的提交
- 读取仓库文件内容,二进制文件只做识别而不解码
- 创建议题、评论议题或 PR、开关议题、添加标签、在 PR 差异行发表评审评论(写操作组,默认关闭)
- 适用场景
- 适合在桌面 MCP 宿主中让助手查询 GitHub 仓库、议题、拉取请求和文件内容;在刻意启用写操作后,也可用于提交议题或发表评论。它是作品集性质的参考实现,并非 GitHub 官方 MCP 服务器,不追求与官方版本功能对齐。
- 运行要求
- 以本地 Python 进程运行(Python 3.12 及以上),从 PyPI 包 jaimenbell-github-mcp 安装并写入 MCP 宿主配置。读取工具无需令牌即可使用,但受 GitHub 未认证速率限制;在 GITHUB_TOKEN 中提供细粒度个人访问令牌可提高限额,写操作则必须提供。写操作还需将 GITHUB_MCP_ENABLE_WRITE 设为 1。需要能访问 GitHub REST API 的网络。
安装
在 SourceWeft 中
- 打开 控制台中的 Github Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
github-mcp
[PyPI] [MCP Registry] [License: MIT] [tests] [CI]
A public read+write MCP server over the GitHub REST API, built to the desktop-mcp/rag-mcp/mcp-factory standard (own pyproject, fastmcp server, honest README, real test suite) with env-gated tool groups (write disabled by default). Not the official GitHub MCP server -- see below.
Quickstart (60 seconds)
The write tool group (issue/PR mutations) is off by default -- see
Env vars below to enable it.
What this is / is not
This is a reference portfolio implementation demonstrating a hardened read+write MCP server pattern over a real external SaaS API (GitHub) -- env-gated tool groups, typed error/rate-limit handling, auth that degrades gracefully, a real test suite. It exists to show, concretely, "I build read/write MCP servers over external APIs" with a link a client can click.
It is NOT the official GitHub MCP server. It does not aim for parity
with GitHub's own MCP offering (GraphQL, Actions, webhooks, GitHub Apps are
all out of scope -- see below). It started life as a factory-scaffolded
read-only demo (mcp-factory's
generated/github_read_server.py) and was hand-hardened into this
standalone read+write server -- the scaffold-then-harden path is itself part
of the story this repo tells.
Tools (14)
One row per tool -- the two groups below just control default-on/off state, not what exists.
read is always on and works unauthenticated (GitHub's 60 req/hr tier).
write is env-gated and OFF by default -- requires
GITHUB_MCP_ENABLE_WRITE=1 and GITHUB_TOKEN.
A disabled write call returns a structured policy_refusal error (never a
silent no-op, never a crash). A write call with the group enabled but no
token returns a structured auth_required error -- the group gate and the
token precondition are checked independently, both before any network call.
Write-safety-off-by-default
This is defense-in-depth, mirroring desktop-mcp's input group: harness-level
permission prompts are the first gate, but the server itself refuses every
write tool unless its own environment explicitly opts in with
GITHUB_MCP_ENABLE_WRITE=1, and even then refuses without a GITHUB_TOKEN.
A misconfigured or overly-permissive MCP host cannot turn on GitHub mutations
this process wasn't deliberately configured to allow. The registration this
repo ships with (see ~/.claude.json's github-mcp entry) has the write
group absent from env -- enabling it is a deliberate per-registration
operator choice, not a code change.
Honest-capabilities table
Every claim below maps to the file that implements it and the test(s) that verify it -- no capability is asserted without a corresponding implementation and test.
Limitations (read before relying on this)
- REST v1 only. No GraphQL API coverage.
- No webhooks / GitHub App auth. Fine-grained PAT only.
- No Actions/workflow-dispatch tools. Issue/PR CRUD is the v1 write surface.
- Unauthenticated read is rate-limited to 60 req/hr by GitHub itself (10
req/min for search) -- expect
rate_limitederrors under sustained unauthenticated use; setGITHUB_TOKEN(even a read-only fine-grained PAT) to raise this considerably. get_file_contenttruncates past 100KB and reports (rather than decodes) non-UTF-8 files.- No pagination beyond a single page for list endpoints (
limit, capped per-endpoint, is the only page-size control in v1). - Not registered with the mcp-factory hub. Ships as a standalone repo (own pyproject, system Python312 install), matching the rag-mcp/desktop-mcp model.
Env vars
Usage examples
Testing
CI (.github/workflows/ci.yml) runs this suite on every push/PR and fails
the build if the Tests badge above drifts from what the suite actually
reports -- see scripts/check_readme_counts.py.
Install
Setup / connect
pip install -r requirements.txton Python 3.12+.- (Optional) generate a fine-grained PAT scoped to the repos you want read+write access to (Issues: read/write, Pull requests: read/write, Contents: read is enough for v1). Read tools work with no token at all -- they just run at GitHub's unauthenticated 60 req/hr tier.
- Add to your MCP host config (e.g.
~/.claude.json):
- To enable write tools for a given deployment, add
"GITHUB_MCP_ENABLE_WRITE": "1"to that entry'senvblock. This is a registration-time operator decision, not a code change.
Registered in ~/.claude.json as github-mcp (stdio, system Python312,
read group always on, write group absent from env -- off).
Commercial support
Maintained by Jaimen Bell. For production MCP integrations, custom servers, or agent-reliability work, see jaimenbell.dev.
Building your own MCP server? The MCP Starter Kit has templates, a build playbook, and packaging war-stories from shipping this one.
mcp-name: io.github.jaimenbell/github-mcp
来源:README.md,提交 14758b7
工具
0版本历史
1- v0.1.1最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分