GitHub
server ทางการของ GitHub ให้ AI อ่านและจัดการโค้ด issue และ pull request ในบัญชีของคุณได้ ใช้ผ่านคลาวด์ของ GitHub หรือรันในเครื่องด้วย Docker ก็ได้
คำอธิบายจากผู้ทำ (ภาษาอังกฤษตามต้นฉบับ)
MCP server for the GitHub REST API: issues, PRs, repos; read always on, write env-gated.
สามเรื่องนี้ไม่รวมเป็นคะแนนเดียว เพราะความเห็น การวัด และความนิยม เป็นคนละเรื่องกัน
ตัวนี้ยังไม่ได้เรียบเรียงเป็นภาษาไทย ด้านล่างคือข้อเท็จจริงที่เราอ่านจาก registry
เลือกโปรแกรม AI ที่คุณใช้ แล้วคัดลอกค่าตั้งไปวาง
ต้องเตรียมก่อน
คุณใช้แอปไหน
เลือกแอปด้านบน เราจำไว้ให้ ครั้งหน้าปุ่มจะขึ้นว่า “ติดตั้งลง …”
เปิด Claude Desktop → Settings → Developer → Edit Config แล้ววางค่านี้ในไฟล์ claude_desktop_config.json
{
"mcpServers": {
"github": {
"command": "uvx",
"args": [
"jaimenbell-github-mcp"
]
}
}
}พิมพ์คำสั่งนี้ใน Terminal
claude mcp add github -- uvx jaimenbell-github-mcpวางในไฟล์ .cursor/mcp.json ของโปรเจกต์ หรือ ~/.cursor/mcp.json
{
"mcpServers": {
"github": {
"command": "uvx",
"args": [
"jaimenbell-github-mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
วางในไฟล์ .vscode/mcp.json ของโปรเจกต์
{
"servers": {
"github": {
"type": "stdio",
"command": "uvx",
"args": [
"jaimenbell-github-mcp"
]
}
}
}เบราว์เซอร์จะถามก่อนเปิดแอป จากนั้นแอปแสดงค่าตั้งให้ตรวจแล้วกดยืนยัน ช่อง key เว้นว่างไว้ให้คุณใส่เอง
ตัวนี้รันในเครื่องคุณ แต่ ChatGPT ต่อได้เฉพาะ server บนอินเทอร์เน็ต ลองเลือกแอปอื่น
ตัวเลือกเก็บในคุกกี้บนเครื่องนี้ ไม่ต้องมีบัญชี
ค่าตั้งนี้สร้างจากข้อมูลใน registry ของผู้ทำ ถ้าไม่ตรงกับ README ให้เชื่อ README
รันในเครื่องคุณ รายการเครื่องมือจะขึ้นในแอป AI หลังติดตั้ง
เราตรวจจากข้อมูลที่ใครก็เปิดดูได้ ยังไม่ได้อ่านโค้ด ข้อที่ไม่เกี่ยวกับตัวนี้ไม่นับในตัวหาร · ตรวจเมื่อ 6 พ.ย. 2569
ชื่อใน registry ยืนยันด้วยบัญชี GitHub jaimenbell ซึ่งเป็นเจ้าของ repo
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ยังไม่ได้อ่านข้อมูล repo จาก GitHub
ตัวนี้รันบนเครื่องคุณ ไม่มี endpoint บนอินเทอร์เน็ต
ตัวนี้รันบนเครื่อง ใช้ค่าที่ตั้งในเครื่องแทน
รันในเครื่องคุณ เราอ่านรายการเครื่องมือได้เฉพาะตัวที่มี endpoint บนอินเทอร์เน็ต
เทียบกับทุก server ที่ยังใช้งานในหมวดนี้ทั้งทะเบียน ดาวนับเฉพาะเมื่อผู้ลงทะเบียนเป็นเจ้าของ repo
จากการตรวจเบื้องต้นของเรา ผ่าน 1 จาก 1 ข้อที่ตรวจได้ เรายังไม่ได้อ่านโค้ด ก่อนใส่กุญแจหรือ token ให้ดูว่า server ขอสิทธิ์อะไร และเลือกกุญแจที่ทำได้เท่าที่จำเป็น
registry ไม่ได้ระบุว่าต้องใช้กุญแจ แต่บางตัวจะขอให้ล็อกอินตอนใช้ครั้งแรก
รันบนเครื่องของคุณ โปรแกรม AI จะเปิด server ขึ้นมาเองเมื่อใช้ ข้อมูลไม่ต้องผ่านเซิร์ฟเวอร์ของผู้ทำ (ยกเว้นตัวที่ไปเรียกบริการออนไลน์ต่อ)
repo บน GitHub มีการแก้โค้ดล่าสุด – และส่งรุ่นล่าสุด (0.1.1) เข้า registry 3 เดือนที่ผ่านมา
โปรแกรมที่รองรับ MCP เช่น Claude Desktop, Claude Code, Cursor และ VS Code ตัวนี้ต้องมี Python (uv) ในเครื่องด้วย
ในหมวดเดียวกันมี GitHub, Desktop Commander, Cloudflare MCP
server หมวดเดียวกันจากผู้ทำคนอื่น เรียงตามดาว
อ่านการ์ด:★ ดาว GitHubiสามเสา: รีวิว · ผลตรวจ · การใช้งานiอัปเดต = วันที่ส่งรุ่นล่าสุดเข้า registryi
server ทางการของ GitHub ให้ AI อ่านและจัดการโค้ด issue และ pull request ในบัญชีของคุณได้ ใช้ผ่านคลาวด์ของ GitHub หรือรันในเครื่องด้วย Docker ก็ได้
MCP server for terminal commands, file operations, and process management
Cloudflare MCP servers
ส่วนนี้คัดจาก repo ของผู้ทำตามต้นฉบับ PopNx MCP ไม่ได้ตรวจหรือรับรองเนื้อหา ตัด HTML รูปภาพ และสคริปต์ออกแล้ว ลิงก์จะพาออกนอกเว็บ
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.
pip install jaimenbell-github-mcp
// Add to your MCP host config (e.g. Claude Desktop/Code's mcpServers block)
{ "mcpServers": { "github-mcp": { "command": "github-mcp" } } }
The write tool group (issue/PR mutations) is off by default -- see Env vars below to enable it.
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.
One row per tool -- the two groups below just control default-on/off state, not what exists.
| Tool | Group | What it does |
|---|---|---|
get_repo | read | Repo metadata (stars, language, license, default branch, archived flag...) |
list_issues | read | List issues on a repo (PRs filtered out) |
get_issue | read | Fetch a single issue |
list_pull_requests | read | List pull requests on a repo |
get_pull_request | read | Fetch a single pull request |
get_file_content | read | Read a repo file's content (base64-decoded, binary detected not decoded) |
search_repos | read | Search public repositories |
get_user | read | Public user/org profile |
list_commits | read | List commits on a branch/ref |
create_issue | write | Open an issue |
comment_on_issue | write | Comment on an issue/PR |
update_issue_state | write | Open/close an issue |
add_labels | write | Add labels to an issue/PR |
create_pr_review_comment | write | Create a PR review comment on a diff line |
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.
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.
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.
| Claim | Implementation | Verified by |
|---|---|---|
| Repo metadata (stars, language, license, default branch, archived flag...) | github_mcp/groups/read.py::get_repo | tests/test_read.py::TestGetRepo, live: tests/test_live_smoke.py::test_live_get_repo_real_json |
| List / fetch issues (PRs filtered from list) | github_mcp/groups/read.py::list_issues, get_issue | tests/test_read.py::TestListIssues, TestGetIssue |
| List / fetch pull requests | github_mcp/groups/read.py::list_pull_requests, get_pull_request | tests/test_read.py::TestListPullRequests, TestGetPullRequest |
| Read a repo file's content (base64-decoded, binary detected not decoded) | github_mcp/groups/read.py::get_file_content | tests/test_read.py::TestGetFileContent |
| Search public repositories | github_mcp/groups/read.py::search_repos | tests/test_read.py::TestSearchRepos |
| Public user/org profile | github_mcp/groups/read.py::get_user | tests/test_read.py::TestGetUser |
| List commits on a branch/ref | github_mcp/groups/read.py::list_commits | tests/test_read.py::TestListCommits |
| Open an issue | github_mcp/groups/write.py::create_issue | tests/test_write.py::TestCreateIssue |
| Comment on an issue/PR | github_mcp/groups/write.py::comment_on_issue | tests/test_write.py::TestCommentOnIssue |
| Open/close an issue | github_mcp/groups/write.py::update_issue_state | tests/test_write.py::TestUpdateIssueState |
| Add labels to an issue/PR | github_mcp/groups/write.py::add_labels | tests/test_write.py::TestAddLabels |
| Create a PR review comment on a diff line | github_mcp/groups/write.py::create_pr_review_comment | tests/test_write.py::TestCreatePrReviewComment |
| Write group OFF by default, structured refusal when disabled | github_mcp/config.py::group_enabled, gated_write | tests/test_config.py::TestGroupEnabled, tests/test_write.py::TestGateDisabledByDefault |
| Write tools require a token even when the group is enabled | github_mcp/config.py::check_write_preconditions | tests/test_config.py::TestCheckWritePreconditions, tests/test_write.py::TestAuthRequiredWhenGroupEnabled |
| Fine-grained PAT auth, degrades to unauthenticated tier when absent | github_mcp/client.py::_headers | tests/test_client.py::TestAuthHeaderInjection, tests/test_read.py::TestUnauthDegrade |
GitHub primary rate-limit (403 + X-RateLimit-Reset) and secondary rate-limit (403 + Retry-After, no X-RateLimit-Remaining) both surface as a typed error with reset/retry time, never a crash | github_mcp/client.py::_rate_limit_error, _is_rate_limit_response | tests/test_client.py::TestRateLimitError, tests/test_client.py::TestRateLimitError::test_secondary_rate_limit_no_ratelimit_headers_retry_after_only, tests/test_read.py::TestUnauthDegrade::test_get_repo_rate_limited_without_token_is_typed |
Malformed owner/repo/path (control chars etc.) that would raise httpx.InvalidURL surfaces as a typed error, never an uncaught exception | github_mcp/client.py::request | tests/test_client.py::TestNetworkError::test_malformed_path_raises_invalid_url_caught_as_network_error |
| Generic 4xx/5xx surfaces as a typed error, never a crash | github_mcp/client.py::_api_error | tests/test_client.py::TestApiError |
| Non-JSON / malformed responses and network failures surface as typed errors | github_mcp/client.py::_handle_response, request | tests/test_client.py::TestDecodeError, TestNetworkError |
rate_limited errors under sustained unauthenticated use; set GITHUB_TOKEN (even a read-only fine-grained PAT) to raise this considerably.limit, capped per-endpoint, is the only page-size control in v1).| Var | Effect | Default |
|---|---|---|
GITHUB_MCP_ENABLE_WRITE | enable the write tool group | unset (off) |
GITHUB_TOKEN | fine-grained PAT; read works without it (degraded unauth rate), write requires it | unset |
GITHUB_MCP_LIVE | 1 to run the real-network smoke test (see Testing) | unset (skip) |
// A tool call from the MCP host, illustrative -- not a shell command.
{"tool": "get_repo", "arguments": {"owner": "anthropics", "repo": "anthropic-sdk-python"}} // -> {"ok": true, "full_name": "anthropics/anthropic-sdk-python", "stargazers_count": 1234, ...}
// write group disabled (default): {"tool": "create_issue", "arguments": {"owner": "o", "repo": "r", "title": "bug"}} // -> {"ok": false, "error": {"type": "policy_refusal", "group": "write", "required_env": "GITHUB_MCP_ENABLE_WRITE", ...}}
// write group enabled, no token set: {"tool": "create_issue", "arguments": {"owner": "o", "repo": "r", "title": "bug"}} // -> {"ok": false, "error": {"type": "auth_required", "tool": "create_issue", ...}}
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.
# unit suite (respx-mocked api.github.com, no real network touched)
python -m pytest -q
python scripts/list_tools.py
GITHUB_MCP_LIVE=1 python -m pytest -q -k live_get_repo
pip install -r requirements.txt # or: pip install .
pip install -r requirements.txt on Python 3.12+.~/.claude.json):{
"mcpServers": { "github-mcp": { "command": "C:\\Users\\ \\AppData\\Local\\Programs\\Python\\Python312\\python.exe", "args": ["C:\\Users\\ \\projects\\github-mcp\\run_server.py"], "env": { "GITHUB_TOKEN": "your-fine-grained-pat-here" // GITHUB_MCP_ENABLE_WRITE intentionally absent -- write stays off // until you deliberately opt in per-deployment. } } } }
"GITHUB_MCP_ENABLE_WRITE": "1" to that entry's env block. This is a registration-time operator decision, not a code change.Registered in ~/.claude.json as github-mcp (stdio, system Python312, `rea
ตัดมาแค่ช่วงต้น อ่านต่อใน repo