Published March 30, 2026

How to Connect MCP to GitHub: Complete Setup Guide in 2026

GitHub is where developers spend a significant chunk of their day — reviewing PRs, checking issues, reading code. Now imagine your AI assistant could do all of that inside your existing chat interface, without switching tabs or context-switching between tools. That is exactly what connecting MCP to GitHub unlocks. This guide walks you through the entire setup, from prerequisites to testing with MCP Inspector, in under 30 minutes.

mcp githubmcp github integrationconnect mcp to githubmcp server githubgithub mcp claude

Why Connect MCP to GitHub?

Before diving into the how, let us talk about the why. GitHub MCP integration is one of the most practical MCP use cases because it eliminates a constant source of friction: switching between your AI assistant and your code repository.

Here is what changes once your AI is connected to GitHub via MCP:

  • Ask about code without leaving the chat — Pull request descriptions, recent commit history, file contents, and branch diffs become queryable in plain English.
  • Automate routine GitHub tasks — Create issues, post comments, label PRs, or summarize review threads using conversational prompts.
  • Faster code reviews — Feed a PR diff into your AI and get a structured review summary in seconds.
  • Context-aware coding assistance — Your AI can read the actual code in your repository, not just the code you paste into the chat.

Whether you are a solo developer or part of a team, this workflow shift — from tab-switching to conversational GitHub interaction — translates to real time savings over the course of a week.

What You Need Before Starting

Make sure you have the following ready before you begin the setup:

1. A GitHub Personal Access Token (PAT)

MCP servers authenticate to GitHub on your behalf using a PAT. Go to github.com/settings/tokens and generate a new token. Select the following scopes at minimum:

  • repo — Full repository access
  • read:user — Read user profile info
  • read:org — Read organization membership (if applicable)

Treat your PAT like a password — never commit it to version control.

2. An MCP-Compatible AI Host

You need an AI client with native MCP support. The most common options in 2026:

  • Claude Desktop — Full MCP support, easiest for beginners
  • Cursor — MCP support via settings, great for AI-first coding
  • VS Code — MCP extension available from Microsoft

3. Node.js (for MCP Inspector)

If you plan to test your GitHub MCP connection using the MCP Inspector CLI tool (which we recommend), you will need Node.js 18+ installed on your machine.

Step-by-Step: Connecting GitHub MCP to Claude Desktop

Claude Desktop is the most straightforward MCP host to configure, making it the best starting point. These steps work on macOS and Windows.

Step 1: Find the GitHub MCP Server

The most widely-used open-source GitHub MCP server is maintained by the modelcontextprotocol/servers GitHub organization. You can also find it on the MCPize Marketplace with pre-configured hosting options. For this guide, we will configure it manually using the open-source server.

Step 2: Locate Your Claude Desktop Config File

Open your terminal and open (or create) the Claude Desktop configuration file:

macOS:

~/Library/Application Support/Claude/claude_desktop_config.json

Windows:

%APPDATA%/Claude/claude_desktop_config.json

Step 3: Add the GitHub MCP Server Configuration

Edit the config file to add your GitHub MCP server. Replace YOUR_GITHUB_TOKEN_HERE with your actual GitHub Personal Access Token from Step 1.

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

Note: The npx approach downloads and runs the server on demand. For production, you may want to install it globally or use a hosted version via MCPize.

Step 4: Restart Claude Desktop

Quit Claude Desktop completely (not just minimize), then relaunch it. In the chat input box, you should now see a small hammer icon — this indicates that MCP tools are available. Click it to expand the list of available GitHub operations.

Step 5: Test with a Simple Prompt

Try asking Claude something like: "Show me the last 5 commits in your repository" or "List the open pull requests in my account." If the connection is working, Claude will call the GitHub MCP server and return real data from your GitHub account.

Using MCP Inspector CLI to Test Your Connection

MCP Inspector is a command-line tool that lets you test MCP servers in isolation before connecting them to your AI host. This is invaluable for debugging connection issues without having to restart your AI client repeatedly.

Install and Run MCP Inspector

# Install globally via npm
npm install -g @modelcontextprotocol/inspector

# Run the inspector with your GitHub server
npx @modelcontextprotocol/inspector \
  npx -y @modelcontextprotocol/server-github

Set the GITHUB_PERSONAL_ACCESS_TOKEN environment variable before running if your server requires authentication.

When MCP Inspector launches, it provides an interactive interface showing all available tools exposed by the server. You can invoke each tool directly and inspect the JSON request/response cycle. This is the fastest way to verify that your token has the correct scopes and that the server is functioning as expected.

Once you have validated the connection in MCP Inspector, you can be confident that the setup in Claude Desktop (or any other MCP host) will work correctly.

Troubleshooting Common Issues

Even with clear documentation, things can go wrong. Here are the most common issues developers hit when connecting MCP to GitHub and how to fix them.

Token scope missing

If you get a 403 error, your PAT likely lacks the required scopes. Go back to github.com/settings/tokens, edit your token, and add `repo`, `read:user`, and `read:org` scopes.

Config file not found

If Claude Desktop does not pick up your config, make sure the JSON is valid (no trailing commas). Use a JSON validator before saving. Also confirm you are editing the correct file path for your OS.

npx download fails or times out

Corporate firewalls or slow connections can block npx. Try installing the server package globally with `npm install -g @modelcontextprotocol/server-github` and update the config to point to the global install path instead of using npx.

MCP hammer icon not showing

Restart Claude Desktop fully — a simple window close does not restart the underlying MCP client process. If the icon still does not appear, check the Claude Desktop logs for MCP-related error messages.

Rate limiting from GitHub API

GitHub API rate limits apply to MCP servers too. If you are hitting rate limits, consider using a hosted MCP server solution like MCPize that manages token rotation and caching for you.

Deploying Your Own GitHub MCP Server

Running the GitHub MCP server via npx works great for local development and experimentation. But if you want a more robust setup — with automatic restarts, better performance, and support for team-wide access — you will want to deploy your own GitHub MCP server.

Deploying a self-hosted MCP server means your team shares a single authenticated server instance, which is especially useful for organizations that want centralized logging, token management, and access control.

MCPize is one of the easiest ways to deploy and manage MCP servers in production. It handles the infrastructure complexity — server uptime, scaling, environment variable management, and access control — so you can focus on building rather than operating. Their marketplace includes pre-configured GitHub MCP server templates that you can deploy in minutes.

Alternative: Deploy to Railway or Render

If you prefer a more hands-on approach, you can deploy the GitHub MCP server to platform-as-a-service providers like Railway or Render. The general pattern is:

  1. Clone the @modelcontextprotocol/server-github repository
  2. Set the GITHUB_PERSONAL_ACCESS_TOKEN as an environment variable
  3. Deploy using the provider\'s Node.js template
  4. Update your Claude Desktop config to point to the deployed server URL instead of using npx

Connecting GitHub MCP to Cursor and VS Code

While Claude Desktop is the primary example in this guide, the GitHub MCP server works with other MCP hosts too. Here is how to adapt the setup for Cursor and VS Code.

Cursor

In Cursor, open Settings → MCP Servers and add a new server with the same JSON configuration used for Claude Desktop. The GitHub server should appear as an available tool in Cursor\'s AI chat panel.

VS Code

Microsoft\'s official MCP extension for VS Code is available in the Extensions Marketplace. Install it, then add your GitHub MCP server configuration to the extension\'s settings panel. If you use Raycast, you can also connect MCP servers through Raycast\'s MCP integration, giving you a powerful command palette that doubles as an AI-powered GitHub interface.

Getting Started: Your First GitHub + MCP Project

Ready to put this into practice? Here is a quick project to validate your setup end-to-end:

  1. Generate a GitHub PAT with repo, read:user, and read:org scopes.
  2. Add the GitHub MCP server to your Claude Desktop config using the JSON example above.
  3. Test with MCP Inspector to verify the connection before launching Claude.
  4. Restart Claude Desktop and look for the MCP hammer icon.
  5. Ask Claude: "Summarize the open pull requests in my account and highlight any that are overdue for review."
  6. Scale up: Once comfortable, connect the GitHub MCP server to Cursor or VS Code, or explore deploying a production instance via MCPize.

The whole setup takes about 15–30 minutes if you have your GitHub token ready. Once connected, you will wonder how you ever managed GitHub workflows without conversational AI assistance.