🔌

GitHub MCP

DevTools2,100

Connect to GitHub repositories, files, issues, and more.

Claude DesktopCursorWindsurfZed

Overview

Connect to GitHub repositories, files, issues, and more.

Setup

Run with npx:

npx -y @modelcontextprotocol/server-github

Configuration

export GITHUB_PERSONAL_ACCESS_TOKEN=<your-token>

Documentation

GitHub MCP Server

Overview

Connect to GitHub repositories, files, issues, and more through the Model Context Protocol.

Installation

Quick Setup

npx -y @modelcontextprotocol/server-github

Claude Desktop Configuration

Add to your claude_desktop_config.json:

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

Setup

  1. Create a GitHub Personal Access Token

    • Go to GitHub Settings > Developer settings > Personal access tokens
    • Generate a new token with appropriate scopes
    • Recommended scopes: repo, read:org, read:user
  2. Configure the MCP Server

    • Set the GITHUB_PERSONAL_ACCESS_TOKEN environment variable
    • Restart your AI application

Available Tools

ToolDescription
search_repositoriesSearch for GitHub repositories.
get_file_contentsGet contents of a file or directory.
create_issueCreate a new issue.
create_pull_requestCreate a new pull request.
list_issuesList issues in a repository.
get_issueGet details of a specific issue.
update_issueUpdate an existing issue.
list_pull_requestsList pull requests in a repository.
get_pull_requestGet details of a specific pull request.
create_pull_request_reviewCreate a review on a pull request.
merge_pull_requestMerge a pull request.
list_branchesList branches in a repository.
list_commitsList commits in a repository.
get_commitGet details of a specific commit.
compare_commitsCompare two commits or branches.

Usage Examples

Search for Repositories

{
  "name": "search_repositories",
  "arguments": {
    "query": "langgraph",
    "sort": "stars",
    "order": "desc"
  }
}

Get File Contents

{
  "name": "get_file_contents",
  "arguments": {
    "owner": "langchain-ai",
    "repo": "langgraph",
    "path": "README.md"
  }
}

Create an Issue

{
  "name": "create_issue",
  "arguments": {
    "owner": "my-org",
    "repo": "my-repo",
    "title": "Bug report",
    "body": "Description of the bug...",
    "labels": ["bug"]
  }
}

Security Notes

  • Never commit tokens - Keep your GitHub token secure.
  • Use minimal scopes - Only request the permissions you need.
  • Rotate tokens regularly - Update your token periodically.
  • Use fine-grained tokens - For better security, use fine-grained PATs.

Resources