Setup Guides9 min read

GitHub MCP Server: Complete Setup Guide for Claude Desktop, Cursor & VS Code

Step-by-step guide to installing and configuring the GitHub MCP server with Claude Desktop, Cursor, and VS Code. Manage repos, issues, and PRs through AI.

By MyMCPTools Team·

The GitHub MCP server is one of the most popular MCP integrations available — and for good reason. It gives your AI assistant direct access to your GitHub repositories, letting you manage issues, review pull requests, search code, and create branches without ever leaving your AI conversation.

This guide walks you through everything: installation, configuration for each major AI client, and the most useful workflows you can unlock.

What is the GitHub MCP Server?

The GitHub MCP server is an official Model Context Protocol server maintained by GitHub (now part of Anthropic's MCP ecosystem). It exposes your GitHub account through a set of structured tools that any MCP-compatible AI client can call.

With it installed, you can ask Claude things like:

  • "Show me open issues in my repo tagged with 'bug'"
  • "Create a PR from my feature branch and add a description"
  • "Find all files that import from the auth module"
  • "What changed in the last 10 commits?"

No copy-pasting. No context switching. Your AI assistant acts directly on GitHub.

Prerequisites

  • Node.js 18+ installed
  • A GitHub Personal Access Token (PAT) with the right permissions
  • An MCP-compatible client: Claude Desktop, Cursor, VS Code with MCP extension, or Windsurf

Creating Your GitHub Personal Access Token

Go to GitHub → Settings → Developer Settings → Personal Access Tokens → Fine-grained tokens.

For most use cases, you need these permissions:

  • Contents — read (browse files and commits)
  • Issues — read and write (view and create issues)
  • Pull requests — read and write (review and create PRs)
  • Metadata — read (access repo info)

Copy the token — you'll need it in the configuration step.

Installation

The GitHub MCP server is distributed via npm. You don't need to install it globally — your MCP client will run it via npx.

npx @modelcontextprotocol/server-github

Configuration: Claude Desktop

Edit your Claude Desktop configuration file:

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

Add the GitHub server to your mcpServers section:

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

Restart Claude Desktop. You'll see a hammer icon in the chat interface when tools are active.

Configuration: Cursor

In Cursor, open Settings → MCP Servers (or edit ~/.cursor/mcp.json directly):

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

Cursor's AI Composer will now have GitHub tools available in any conversation.

Configuration: VS Code

With the MCP extension installed, add to your VS Code settings or workspace .vscode/mcp.json:

{
  "servers": {
    "github": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
      }
    }
  }
}

Available Tools

The GitHub MCP server exposes these capabilities:

ToolWhat it does
list_repositoriesBrowse your repos and organizations
get_file_contentsRead any file from any branch
search_codeFull-text code search across repos
list_issues / create_issueRead and create GitHub issues
list_pull_requestsReview open PRs and their diffs
create_pull_requestCreate PRs from your current branch
list_commitsBrowse commit history with diffs
create_branchCreate new branches
push_filesCommit and push file changes

Practical Workflows

Bug Triage Workflow

Ask: "Show me all open issues labeled 'bug' in my-repo, sorted by most reactions. For the top 3, summarize what the user is experiencing and suggest a fix."

Code Review Workflow

Ask: "Fetch PR #47 in my-repo. Review the changed files and flag any potential security issues or performance regressions."

Documentation Workflow

Ask: "Read the README.md from my-repo. Identify any outdated sections based on recent commits and rewrite them."

Troubleshooting

Tools not showing up: Restart your AI client fully (quit and reopen, not just reload).

Authentication errors: Check your PAT hasn't expired and has the required scopes. Fine-grained tokens require explicit permission per repo or org.

Rate limiting: GitHub's API allows 5,000 requests/hour on authenticated PATs. For heavy usage, consider a GitHub App token instead.

Related guides:

🔧 MCP Servers Mentioned in This Article

📚 More from the Blog