Table of Contents
- Official MCP Server — Scope and Rating
- Picking an Auth Method — PAT, GitHub App, OAuth
- Tool Surface — Repos, Issues, PRs, Projects, Actions, Secret Scanning
- The Three-Layer Rate Limit and GraphQL Optimization
- Five Production Pitfalls
- Enterprise HTTP Mode and Shared MCP Strategy
- Production Checklist
- FAQ
Official MCP Server — Scope and Rating
GitHub shipped a major update to its official MCP server on January 28, 2026, and the project lives at github/github-mcp-server. It exposes repository browsing, file reads, issue and PR management, code analysis, and workflow automation as MCP tools that AI agents, assistants, and chatbots can call.
KanseiLink rates GitHub grade A (trust score 0.7). OAuth 2.0 support, documentation depth, the existence of an official MCP server, and overall API stability all rank near the top — but the three-layer rate limit (auth class × API family × secondary limit) is intricate enough to keep it out of AA territory.
GitHub MCP — Verified Spec ✅
Picking an Auth Method — PAT, GitHub App, OAuth
GitHub MCP supports three auth paths. The production decision is straightforward.
| Method | Rate Limit | Scope Granularity | Use Case |
|---|---|---|---|
| Fine-grained PAT | 5,000/hr | High (per repo) | Solo dev, PoC, CI |
| Classic PAT | 5,000/hr | Low (whole user) | Legacy compatibility only |
| GitHub App | 15,000/hr/installation | High (per install) | Org rollout, production |
| OAuth App (user) | 5,000/hr/user | Medium | Multi-user SaaS |
The January 2026 update added automatic OAuth scope filtering for classic PATs only — the server detects token scopes and hides tools the caller can't use (GitHub Changelog 2026-01-28). It's a mechanical guardrail against scenarios like "calling create_issue with a PAT that lacks the issues scope and getting stuck in retry loops." Fine-grained PATs already enforce scopes strictly, so the filter doesn't apply to them.
For a new agent, go fine-grained PAT (solo / PoC) → GitHub App (org rollout). There's no defensible reason to start a 2026 deployment on a classic PAT.
Tool Surface — Repos, Issues, PRs, Projects, Actions, Secret Scanning
As of May 2026, GitHub's official MCP server exposes the tool families below (per GitHub documentation and the 2026-01-28 / 2026-05-05 changelogs).
- Repository management — browse repos, search code, analyze commits, fetch files
- Issue & PR automation — create, update, comment on, and merge issues and PRs
- Projects (added 2026-01-28) — consolidated tools like
projects_listandprojects_getto manage GitHub Projects - CI/CD & Actions intelligence — inspect workflow runs, debug build failures, manage releases
- Code analysis — review Dependabot alerts, surface security findings
- Secret Scanning (GA 2026-05-05) — detect secrets before commits or PRs ✅
- Insiders mode (opt-in) — early access to experimental features
Why the May 5 Secret Scanning GA matters
The GA announcement on May 5, 2026 (GitHub Changelog) lands as a last line of defense for AI-assisted coding. Before an agent commits, an official MCP tool can scan for API keys, tokens, and credentials. Because Cursor, Claude Desktop, VS Code, Copilot and other MCP-aware editors call this tool directly, the "agent accidentally commits a secret" failure mode now has a structural fix.
The Three-Layer Rate Limit and GraphQL Optimization
GitHub's rate limit isn't one number — it's three layers stacked together.
- Primary rate limit — hourly cap per auth subject (PAT 5,000 / GitHub App 15,000). REST and GraphQL share the bucket.
- Search API limit — a separate, stricter 30 requests/minute cap. Agents that lean on code or issue search hit this first.
- Secondary rate limit — dynamic throttling triggered by abuse heuristics (sudden bursts, high concurrency). May return HTTP 403 with a Retry-After header.
Three patterns for conserving quota
// 1. Inspect X-RateLimit-Remaining on every response
const remaining = parseInt(res.headers['x-ratelimit-remaining'] || '5000');
if (remaining < 100) {
// Defer non-critical work below 100
await scheduleLowPriorityRetry();
}
// 2. Conditional requests via ETag / If-None-Match → 304 costs no quota
const cached = cache.get(`gh:${url}`);
const headers: Record = {
'Authorization': `Bearer ${token}`,
'X-GitHub-Api-Version': '2022-11-28',
};
if (cached?.etag) headers['If-None-Match'] = cached.etag;
const res = await fetch(url, { headers });
if (res.status === 304) return cached.body; // 0 quota
// 3. Collapse heavy reads into a single GraphQL v4 query
// REST: repo metadata + issues + PRs + commits = 4 calls
// GraphQL: 1 query covers everything → ~25% quota savings
Always send X-GitHub-Api-Version: 2022-11-28. Without it, the API can silently roll forward on the next major version and break your agent. KanseiLink's get_service_detail surfaces this as the single most important agent tip for GitHub.
Five Production Pitfalls
Pitfall 1: Files larger than 1MB are unreadable
The Contents API (/repos/{owner}/{repo}/contents/{path}) only returns Base64 content up to 1MB. Larger JSON files, build logs, and PDFs need to fall back to Git Data API blobs (/repos/{owner}/{repo}/git/blobs/{file_sha}). The official MCP server handles the branching for you; if you call REST directly, you must implement it.
Pitfall 2: The Search API is the first thing to throttle
30 requests/minute, on a separate quota. Agents that loop over code searches saturate it inside 60 seconds. Mitigations: (a) cache results, (b) consolidate multiple searches into one query, (c) move to GraphQL v4 search.
Pitfall 3: Issue/PR numbers aren't globally unique
GitHub numbers issues and PRs per repo. An agent that touches multiple repos must always carry the {owner}/{repo} tuple. Storing "PR #42" alone is a recurring bug — the reference becomes meaningless across repositories.
Pitfall 4: Classic PAT permission spread
A classic PAT applies to every repository the user can access. A token issued for one repo still grants org-wide access if it leaks. Migrating to fine-grained PATs is the 2026 baseline for least-privilege agent design.
Pitfall 5: Skipping ETag and burning quota on unchanged data
An agent polling a repo's issue list every 5 minutes that fetches a full response each time will exhaust quota fast. With ETag + If-None-Match, the server returns 304 — a cache hit at zero quota cost. This is GitHub's documented best practice.
Enterprise HTTP Mode and Shared MCP Strategy
The January 2026 release added an HTTP server mode to the GitHub MCP server (GitHub Changelog 2026-01-28). The server accepts an OAuth token via the Authorization header on each request and works with GitHub Enterprise Server.
Practically, this means a single shared MCP server inside the org, with each agent authenticating via its own OAuth token is now an officially supported pattern. Compared to having every agent run its own npx instance, this gives you (1) centralized credential rotation, (2) unified logging and audit, and (3) a single place to manage backoff under secondary rate limits.
The shared model puts per-agent token handling in the spotlight as a leak surface. Pair it with Authorization header logging redaction, short token expiration policies, and Zero Trust / corporate VPN access restrictions.
Production Checklist
- Auth uses fine-grained PAT or GitHub App (no new classic PAT deployments)
- Every request sets X-GitHub-Api-Version: 2022-11-28
- X-RateLimit-Remaining is checked on every response and non-critical work backs off when low
- Conditional requests use ETag / If-None-Match
- Heavy reads (>5 calls) collapse into a single GraphQL v4 query
- Search API usage is wrapped in caching and query consolidation, staying under 30/min
- Issue and PR numbers are stored with their
{owner}/{repo}scope - Files over 1MB fall back from Contents API to Git Data API blobs
- Secret Scanning (GA 2026-05-05) runs on the agent side before commits and PRs
- Org rollouts evaluated GitHub App + HTTP mode as a shared MCP architecture
FAQ
Q1. What's the fastest way to get GitHub MCP running?
Generate a fine-grained PAT and run npx @github/mcp-server for solo or PoC work. For org rollouts, install a GitHub App (15,000 req/hour). For Enterprise or shared deployments, the HTTP server mode with OAuth token forwarding is the recommended pattern as of April 2026.
Q2. Fine-grained PAT or classic PAT?
Fine-grained, by default. Classic PATs apply to every repo the user touches, so a leak has org-wide blast radius. Fine-grained PATs constrain repos, permissions, and expiration. There's no good reason to start a new 2026 deployment on classic.
Q3. What is the May 2026 Secret Scanning integration?
On May 5, 2026 (GitHub Changelog), Secret Scanning in the GitHub MCP server reached GA. Agents can now invoke an official MCP tool to detect API keys, tokens, and credentials before commits or PRs. Because MCP-aware IDEs call it directly, the "agent leaks a secret" failure mode now has a structural mitigation.
Q4. What are the rate limits?
(1) PAT: 5,000 req/hour shared across REST + GraphQL. (2) GitHub App per-installation: 15,000 req/hour. (3) Search API: 30 req/minute on a separate quota. (4) Secondary rate limits trigger on abuse heuristics. Conserve quota with X-RateLimit-Remaining checks, ETag conditional requests, and GraphQL consolidation.
Q5. How do I fetch files larger than 1MB?
Contents API caps at 1MB. Anything larger needs the Git Data API blobs endpoint (/repos/.../git/blobs/{file_sha}). The official MCP server branches automatically; direct REST callers have to implement the fallback.
Q6. How does KanseiLink rate GitHub MCP?
Grade A, trust score 0.7. The official MCP server, three-method auth, deep documentation, and overall API stability all score high. The three-layer rate limit (auth class × API family × secondary) is what keeps it out of AA. See DevTools SaaS AEO Comparison 2026 for a full ranking against GitLab, AWS, and Playwright.
The GitHub MCP specifications cited in this article — auth methods, rate limit values, tool inventory, the 2026-01-28 Projects integration, the 2026-05-05 Secret Scanning GA, Insiders mode, and HTTP server mode — are verified against the GitHub Changelog (github.blog/changelog), the official repository (github/github-mcp-server), and the GitHub REST API documentation (docs.github.com/en/rest). KanseiLink's grade A and trust score 0.7 reflect April 2026 internal evaluation and may change with the Q3 2026 update. Code examples are illustrative; production deployments require additional error handling, retry policy, and credential management. Pricing, specifications, and GA dates may change without notice — always consult the latest official documentation before deploying to production.