guide13 min read2d ago

GitHub MCP Server Setup Guide 2026: Install, Configure, and Use Safely

Step-by-step setup for the official GitHub MCP server in Claude Desktop, Claude Code, and Cursor. Token scoping, real workflows, and a security checklist before you let an AI touch your repos.

GitHub MCP Server Setup Guide 2026: Install, Configure, and Use Safely
github mcpgithub mcp serverclaude desktopclaude codecursormodel context protocolai code assistantdeveloper tools

TL;DR — GitHub MCP Server: Complete Setup & Usage Guide for 2026

The official GitHub MCP server, maintained by GitHub itself, gives Claude (and any MCP-compatible AI client) full read/write access to repositories, issues, pull requests, GitHub Actions, releases, and code search. This guide walks through installation in Claude Desktop, Claude Code, and Cursor, covers token scoping for safety, and shows the workflows that actually deliver value day-to-day. Setup takes under 5 minutes once you have a Personal Access Token in hand.

Skiln tracks 30+ GitHub-related MCP servers · updated daily

Table of Contents

  1. What Is the GitHub MCP Server?
  2. Why Not Just the GitHub CLI?
  3. Official vs Community GitHub MCPs
  4. Prerequisites
  5. Step-by-Step Installation
  6. Personal Access Token Scoping
  7. What Claude Can Do With the GitHub MCP
  8. Real-World Workflows
  9. Common Errors and How to Fix Them
  10. Security Checklist
  11. Frequently Asked Questions

What Is the GitHub MCP Server?

The GitHub MCP server is the official Model Context Protocol server that bridges AI clients like Claude Desktop and Claude Code with the GitHub API. Once installed, your AI assistant gains a set of tools it can call mid-conversation: search code across an org, list pull requests, leave review comments, create issues, trigger Actions, draft releases, and dozens more.

It is the single most useful MCP server for any developer who lives on GitHub. Built and maintained by GitHub themselves, it ships with OAuth and Personal Access Token support, sensible defaults for read versus write scopes, and a feature surface that mirrors most of what you can do in the GitHub web UI or the gh CLI.

If you are choosing between MCP servers for the first time, this is the one to install first. We rank it #1 in our Best GitHub MCP Servers in 2026 roundup, and it appears in every starter-config we publish via the Skiln Config Generator.

Why Not Just the GitHub CLI?

The gh CLI is excellent — fast, scriptable, well-documented. The reason to layer the GitHub MCP on top is conversational composition. With the CLI, you have to know the exact subcommand, flag, and JSON shape. With the MCP, Claude figures that out for you: "show me PRs assigned to me that have been waiting more than 48 hours" becomes a chain of API calls Claude orchestrates without you ever typing a flag.

There are three concrete advantages:

  • Multi-step orchestration. Claude can chain list PRs → for each PR, fetch reviews → summarize blockers without you scripting it.
  • Cross-tool synthesis. The MCP combines naturally with other MCPs like Slack or Notion. Claude can read a GitHub PR, then post a summary to Slack, then file a follow-up Notion ticket — all in one turn.
  • Natural language ambiguity resolution. "Close the stale issues" is hard to write as a gh command. With the MCP, Claude can clarify what "stale" means, then act.

The CLI remains the right tool for scripts and CI. The MCP is the right tool for interactive work inside an AI client.

Official vs Community GitHub MCPs

Skiln indexes 30+ GitHub-related MCP servers. They fall into three buckets:

  • The official github-mcp-server from GitHub. This is what this guide covers. It is the most feature-complete and best-maintained option.
  • Community wrappers focused on specific GitHub workflows — GitHub Project Manager for the new Projects boards, GitHub Insights for analytics, niche helpers for releases or Actions.
  • Generic API wrappers that proxy gh or the GitHub REST API directly. These exist but are mostly obsolete now that the official MCP covers the same ground.

Unless you have a specific niche need, the official MCP is the right starting point. You can layer community MCPs on top later for specialized workflows. See the full /mcps directory on Skiln to browse alternatives.

Prerequisites

Before you install, make sure you have:

  • A GitHub account with access to the repos you want Claude to touch.
  • A Personal Access Token (classic or fine-grained). We recommend fine-grained for new setups — it lets you scope to specific repositories and reduces blast radius.
  • An MCP-compatible AI client. Claude Desktop, Claude Code, Cursor, Windsurf, Cline, and Zed all work. See our Best MCP Clients in 2026 guide if you have not picked one yet.
  • Node.js 18+ installed locally (the MCP runs via npx).
  • Roughly 5 minutes for first-time setup.

Step-by-Step Installation

The install pattern is the same across every client: edit a config file (or use the client's settings UI) to add the MCP server entry, paste in your token, restart the client.

Configuring Claude Desktop

Open the Claude Desktop config file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Add the github entry to the mcpServers object:

{   "mcpServers": {     "github": {       "command": "npx",       "args": ["-y", "@modelcontextprotocol/server-github"],       "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_yourtokenhere" }     }   } }

Save the file, quit Claude Desktop completely (not just close the window — fully quit), and relaunch. You will see a new tools menu in the bottom-left with github listed. If you see a red error indicator, click into it to view the log — usually a malformed token or a missing comma.

Configuring Claude Code

Use the claude mcp add CLI command — it edits the config for you and avoids hand-formatting JSON:

claude mcp add github \   --env GITHUB_PERSONAL_ACCESS_TOKEN=ghp_yourtokenhere \   -- npx -y @modelcontextprotocol/server-github

Restart Claude Code (or run claude mcp restart github). Verify with claude mcp list — you should see github with a green status. From inside a Claude Code session, ask Claude "list my repos" and you should get back a real list within a second.

Configuring Cursor

In Cursor, open Settings → Cursor Settings → MCP → Add new MCP server. Fill in:

  • Name: github
  • Command: npx
  • Args: -y @modelcontextprotocol/server-github
  • Env: GITHUB_PERSONAL_ACCESS_TOKEN=ghp_yourtokenhere

Save. Cursor will spawn the MCP and the tools appear in the chat panel. Cursor caches MCP availability — if you change the token, restart Cursor entirely.

Personal Access Token Scoping

Token scope is the single most important decision in this setup. Get it wrong and an MCP can either fail silently (insufficient scope) or do too much (over-scoped).

For fine-grained tokens (preferred), grant these scopes:

  • Repository access: Select repositories → pick only what Claude needs.
  • Permissions: Contents (Read or Read+Write), Issues (Read+Write), Pull requests (Read+Write), Metadata (Read).
  • Expiration: Set to 90 days. Renew on calendar reminders.

For classic tokens, the minimum useful scope set is repo (full repo access) plus read:org (so Claude can list your orgs). Add workflow only if you want Claude to trigger or read GitHub Actions runs.

A few security rules:

  1. Never commit the token to a repo — even private ones. Use env vars, secret managers, or your OS keychain.
  2. Use separate tokens per client. One for Claude Desktop, one for Claude Code. If one leaks, you only rotate that one.
  3. Set a calendar reminder to rotate tokens every 90 days. Fine-grained tokens force this; classic tokens silently outlive you.

What Claude Can Do With the GitHub MCP

The MCP exposes ~30 tools to Claude. The most useful by frequency of real use:

  • Repository operations — list repos, get repo metadata, create new repos, fork, archive.
  • File operations — read file contents, list directory trees, create or update files via the API (no local clone required), delete files.
  • Issue operations — search issues, create new issues, comment, label, assign, close.
  • Pull request operations — list PRs, view diffs, create new PRs, review (approve, request changes, comment), merge.
  • Code search — search code across the org, search for symbols, search issues by query.
  • Actions — list workflow runs, view logs, trigger a workflow_dispatch run.
  • Releases — list, create, edit, delete releases. Tag releases programmatically.

You do not need to memorize the tool names. Claude routes between them based on your natural-language request. Most users say "show me PRs awaiting my review" or "summarize this week's merged PRs" and the right tool calls happen behind the scenes.

Real-World Workflows

Here are the patterns we see most often in production use across the Skiln community:

Morning standup prep. "Summarize what I merged yesterday and what's still in review." Claude pulls your authored PRs, groups by status, and produces a 5-bullet summary you can paste into Slack. Pair with the Slack MCP to post it automatically.

Code review at scale. "Walk through the diff in PR #482, flag anything risky, suggest test cases." Claude reads the PR, runs through each file change, and produces a structured review report. Faster than manual review for routine PRs.

Issue triage. "Find all open issues without a label, suggest a label for each based on the title, apply them." Claude pulls untriaged issues, classifies them, and applies labels. A single triage pass that would have taken an hour drops to ten minutes.

Release notes generation. "Generate release notes from the commits between v1.4.0 and HEAD, grouped by conventional-commit type." Claude pulls the git log via the API, parses commit messages, and outputs a Markdown changelog.

Repo exploration on a new codebase. "Tell me how this repo's API layer is structured." Claude reads the README, identifies entry points, follows imports, and produces an architecture sketch. Especially useful on the first day of a new job.

Multi-repo refactors. "Across all our service repos, find any usage of the deprecated getCwd() function and open a PR replacing it with getCurrentWorkingDirectory()." Claude searches code, opens a PR per affected repo, all in one turn.

Bundle the GitHub MCP with Postgres, Slack, Notion, and more — the Skiln Config Generator outputs ready-to-paste configs for every major MCP client.

Browse Now →

Common Errors and How to Fix Them

The five errors that account for ~80% of GitHub MCP support issues:

1. "Bad credentials" on every call. Your token is wrong, expired, or has insufficient scope. Re-paste the token, double-check no whitespace was copied, and verify the token still appears in GitHub Settings → Developer settings.

2. "Resource not accessible by personal access token". Fine-grained token without the repository selected. Open the token settings on GitHub, scroll to "Repository access", and explicitly add the repo you are trying to access.

3. "Cannot find module @modelcontextprotocol/server-github". Node was installed via system package manager into a path your AI client cannot see. Install Node via the official installer or nvm, then verify with which npx (macOS/Linux) or where npx (Windows).

4. The MCP shows green but Claude says "I don't have access to GitHub". Restart the client cold. Most clients cache the tool list once at startup; toggling MCP enable/disable does not always re-fetch.

5. Rate limiting on heavy workflows. Authenticated GitHub API has a 5,000 requests/hour limit. Big org-wide searches can hit this fast. The MCP surfaces rate limit errors clearly — wait until the reset window or use a token from a GitHub App for higher limits.

Security Checklist

Run through this list before letting the GitHub MCP touch production repositories:

  • [ ] Token is scoped to the minimum required repositories and permissions.
  • [ ] Token expiration is set (90 days max).
  • [ ] Token is stored in env vars, OS keychain, or a secret manager — never committed.
  • [ ] The AI client requires confirmation before any write operation (most do by default).
  • [ ] Pre-commit hooks (gitleaks, trufflehog) are installed in all repos the MCP can write to.
  • [ ] CODEOWNERS file is up to date so any AI-authored PR triggers human review.
  • [ ] Calendar reminder set to rotate the token before it expires.

The GitHub MCP is powerful, and that power cuts both ways. Treat it like an over-eager intern with admin access — capable of doing real work, capable of doing real damage. Scope accordingly.

Frequently Asked Questions

Is the GitHub MCP server free?

Yes. The official GitHub MCP server is open-source and free to use. You only pay for the underlying services you connect to it (GitHub itself, your AI provider). There is no per-call charge for the MCP server.

Do I need a paid GitHub account to use it?

No. The GitHub MCP works with free GitHub accounts. Some advanced operations (like managing GitHub Advanced Security alerts or fine-grained team permissions) require a paid plan, but core repository, issue, and PR functionality works on any tier.

What's the difference between the GitHub MCP and the git MCP?

The git MCP operates on your local .git folder — commits, diffs, branches, history. The GitHub MCP talks to the GitHub API — pull requests, issues, code search, Actions, releases. Most workflows benefit from installing both side by side, and we cover the split in our companion guide to the best Git MCP servers for 2026.

Can I use the GitHub MCP with private repos?

Yes — that's the primary use case. Generate a Personal Access Token (classic or fine-grained) with repo scope, paste it into the MCP config, and Claude can read and write to every private repo your token can access. Fine-grained tokens are recommended because they let you restrict access to specific repositories.

How fast is the GitHub MCP?

Most operations complete in 100 to 500 milliseconds — fast enough to feel native inside a chat conversation. Code search across large orgs takes 1 to 3 seconds. Repository listing for orgs with 1000+ repos may take 5 seconds or more on the first call, then becomes cached.

Can the GitHub MCP create pull requests automatically?

Yes. With a token that includes write access, Claude can create branches, push commits via the API, open pull requests with descriptions and labels, request reviewers, and merge or squash PRs. We recommend keeping this gated behind explicit confirmation in your AI client until you trust the workflow.

Does it work with GitHub Enterprise Server?

Yes. The official GitHub MCP supports GitHub Enterprise Server (self-hosted) via a GITHUB_HOST environment variable in the config. Set it to your enterprise URL and authenticate with a token from that instance. The MCP gracefully falls back to github.com if no host is specified.

Where can I find other GitHub-related MCP servers?

Skiln indexes 30+ GitHub-related MCP servers including GitHub Project Manager, GitHub Insights, and various third-party wrappers. Browse them at /mcps with the search term "github" or check our companion ranking of the best GitHub MCP servers for 2026.


Last updated: May 28, 2026 · Skiln tracks GitHub MCP server updates daily across the official repo, Smithery, Glama, PulseMCP, and LobeHub.

Frequently Asked Questions

Is the GitHub MCP server free?
Yes. The official GitHub MCP server is open-source and free to use. You only pay for the underlying services you connect to it (GitHub itself, your AI provider). There is no per-call charge for the MCP server.
Do I need a paid GitHub account to use it?
No. The GitHub MCP works with free GitHub accounts. Some advanced operations (like managing GitHub Advanced Security alerts or fine-grained team permissions) require a paid plan, but core repository, issue, and PR functionality works on any tier.
What's the difference between the GitHub MCP and the git MCP?
The git MCP operates on your local .git folder — commits, diffs, branches, history. The GitHub MCP talks to the GitHub API — pull requests, issues, code search, Actions, releases. Most workflows benefit from installing both side by side, and we cover the split in our companion guide to the best Git MCP servers for 2026.
Can I use the GitHub MCP with private repos?
Yes — that's the primary use case. Generate a Personal Access Token (classic or fine-grained) with repo scope, paste it into the MCP config, and Claude can read and write to every private repo your token can access. Fine-grained tokens are recommended because they let you restrict access to specific repositories.
How fast is the GitHub MCP?
Most operations complete in 100 to 500 milliseconds — fast enough to feel native inside a chat conversation. Code search across large orgs takes 1 to 3 seconds. Repository listing for orgs with 1000+ repos may take 5 seconds or more on the first call, then becomes cached.
Can the GitHub MCP create pull requests automatically?
Yes. With a token that includes write access, Claude can create branches, push commits via the API, open pull requests with descriptions and labels, request reviewers, and merge or squash PRs. We recommend keeping this gated behind explicit confirmation in your AI client until you trust the workflow.
Does it work with GitHub Enterprise Server?
Yes. The official GitHub MCP supports GitHub Enterprise Server (self-hosted) via a GITHUB_HOST environment variable in the config. Set it to your enterprise URL and authenticate with a token from that instance. The MCP gracefully falls back to github.com if no host is specified.
Where can I find other GitHub-related MCP servers?
Skiln indexes 30+ GitHub-related MCP servers including GitHub Project Manager, GitHub Insights, and various third-party wrappers. Browse them at /mcps with the search term "github" or check our companion ranking of the best GitHub MCP servers for 2026.

Stay in the Loop

Join 1,000+ developers. Get the best new Skills & MCPs weekly.

No spam. Unsubscribe anytime.

GitHub MCP Server Guide 2026: Setup for Claude, Cursor & Windsurf