🔌

GitHub MCP Server

Version Control31,400

GitHub's official MCP server for connecting AI tools to GitHub - repos, issues, PRs, Actions, and security analysis.

VS CodeClaude DesktopCursorWindsurfClaude Code

Overview

GitHub's official MCP server for connecting AI tools to GitHub - repos, issues, PRs, Actions, and security analysis.

Setup

Run with npx:

Remote: https://api.githubcopilot.com/mcp/ or Docker: ghcr.io/github/github-mcp-server

Configuration

OAuth or GitHub PAT authentication, configurable toolsets for granular access

Documentation

GitHub MCP Server

Overview

GitHub MCP Server is GitHub's official MCP server that connects AI tools directly to GitHub's platform. With over 31,000 GitHub stars, it enables AI agents, assistants, and chatbots to interact with GitHub through natural language, allowing them to read repositories and code files, manage issues and PRs, analyze code, and automate workflows.

This official server provides the most comprehensive and secure integration between AI agents and GitHub's platform. Unlike third-party solutions, GitHub MCP Server has direct access to GitHub's APIs and is maintained by the GitHub team, ensuring stability, security, and feature parity with GitHub's evolving platform.

The server offers extensive capabilities across repository management, issue and PR automation, CI/CD intelligence, code analysis, and team collaboration. It supports granular toolsets for controlling which functions are available to agents, making it suitable for enterprise deployments with strict access controls.

Features

  • Repository Management: Browse code, search files, analyze commits, understand project structures
  • Issue & PR Automation: Create, update, and manage issues and pull requests
  • CI/CD & Workflow Intelligence: Monitor GitHub Actions runs, analyze build failures, manage releases
  • Code Analysis: Examine security findings, review Dependabot alerts, get codebase insights
  • Team Collaboration: Access discussions, manage notifications, analyze team activity
  • Granular Toolsets: Control which functions are available (repos, issues, PRs, actions, security)
  • Multiple Deployment Options: Remote server, Docker, or local binary
  • Flexible Authentication: OAuth or GitHub Personal Access Token
  • Enterprise Support: GitHub Enterprise Server compatible with local hosting

Installation

Option 1: Remote Server (Easiest)

The hosted server is managed by GitHub and requires:

  • Compatible MCP host with remote server support (VS Code 1.101+, Claude Desktop, Cursor, Windsurf)

Configuration:

{
  "mcpServers": {
    "github": {
      "url": "https://api.githubcopilot.com/mcp/"
    }
  }
}

Authentication via OAuth or GitHub PAT.

Option 2: Docker (Local Server)

Requires Docker installed and running:

{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-p",
        "127.0.0.1:8085:8085",
        "-e",
        "GITHUB_TOKEN",
        "ghcr.io/github/github-mcp-server"
      ]
    }
  }
}

Option 3: Build from Source

For those without Docker:

# Clone the repository
git clone https://github.com/github/github-mcp-server.git
cd github-mcp-server

# Build the server
go build ./cmd/github-mcp-server

# Run locally
./github-mcp-server

Available Tools

Repository Tools

ToolDescription
list_reposList repositories accessible to the authenticated user
get_repoGet repository details including metadata
search_codeSearch code across repositories
get_fileGet file contents from a repository
list_filesList files and directories in a repository
get_commitGet commit details and changes
list_commitsList commits with optional filters

Issue Management

ToolDescription
list_issuesList issues in a repository
get_issueGet issue details
create_issueCreate a new issue
update_issueUpdate an existing issue
comment_on_issueAdd comment to an issue
search_issuesSearch issues across repositories

Pull Request Tools

ToolDescription
list_prsList pull requests
get_prGet PR details including diff
create_prCreate a new pull request
update_prUpdate PR (title, body, state)
merge_prMerge a pull request
request_reviewRequest reviewers for a PR
get_pr_reviewGet PR review details

Actions & CI/CD

ToolDescription
list_workflowsList GitHub Actions workflows
get_workflow_runGet workflow run details
list_workflow_runsList workflow runs
get_job_logsGet job logs from a workflow run
re_run_workflowRe-run a workflow
get_build_statusGet build status for a commit

Code Security

ToolDescription
list_security_alertsList Dependabot and security alerts
get_security_alertGet security alert details
list_vulnerabilitiesList vulnerability alerts
get_code_scanning_resultsGet CodeQL analysis results
get_secret_scanning_alertsGet secret scanning alerts

Usage Examples

Code Review Automation

User: "Review PR #123 and check for security issues"
Agent: Uses get_pr to fetch PR details
Agent: Uses list_security_alerts to check for vulnerabilities
Agent: "PR #123 has 2 new files, 150 lines added. Found 1 potential SQL injection in user_query function."

Issue Triage

User: "Triage all open issues and categorize them"
Agent: Uses list_issues to get all open issues
Agent: Analyzes each issue and suggests labels
Agent: "Found 12 open issues: 5 bugs, 3 feature requests, 4 documentation updates"

CI/CD Analysis

User: "Why did the last build fail?"
Agent: Uses list_workflow_runs to find latest run
Agent: Uses get_job_logs to fetch failure logs
Agent: "Build failed in 'test' job: TypeError in auth.test.ts line 45 - undefined method 'validateToken'"

Release Management

User: "Create a release for version 2.0.0"
Agent: Uses get_repo to verify tag exists
Agent: Creates release with changelog
Agent: "Release v2.0.0 created with 45 commits, 12 contributors"

Toolset Configuration

The server supports granular toolset configuration:

{
  "mcpServers": {
    "github": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-e",
        "GITHUB_TOKEN",
        "-e",
        "TOOLS_REPO=read,repos,issues,pr_review",
        "ghcr.io/github/github-mcp-server"
      ]
    }
  }
}

Available toolsets:

  • repos - Repository browsing and file access
  • issues - Issue management
  • pr_review - Pull request review
  • actions - CI/CD workflow management
  • security - Security and vulnerability analysis
  • notifications - Notification management
  • projects - GitHub Projects access
  • discussions - Community discussions

Claude Desktop Setup

  1. Install GitHub MCP Server (remote or Docker)
  2. Authenticate with GitHub (OAuth or PAT)
  3. Add server configuration to Claude Desktop settings
  4. Restart Claude Desktop
  5. GitHub tools will be available in conversations

Cursor Setup

  1. Add GitHub MCP server to Cursor settings
  2. Configure authentication
  3. Restart Cursor
  4. Use GitHub tools in agent conversations

Pros

  • ✅ Official GitHub product with full platform access
  • ✅ Comprehensive tool coverage for most GitHub workflows
  • ✅ Multiple deployment options (remote, Docker, binary)
  • ✅ Flexible authentication (OAuth or PAT)
  • ✅ Configurable toolsets for minimizing context
  • ✅ Wide IDE/host support (VS Code, Claude Desktop, Cursor, Windsurf)
  • ✅ Enterprise-grade security and access controls
  • ✅ Active development by GitHub team

Cons

  • ❌ Requires compatible MCP host application
  • ❌ Remote server needs VS Code 1.101+ or equivalent
  • ❌ Docker required for local server installation
  • ❌ GitHub Enterprise Server only supports local hosting
  • ❌ Token/PAT management requires careful security practices
  • ❌ Some features require specific OAuth scopes

When to Use

GitHub MCP Server is ideal for:

  • Development Teams: Automate code review, issue triage, and release management
  • DevOps: Monitor and analyze CI/CD pipelines
  • Security Teams: Track and respond to vulnerability alerts
  • Project Management: Automate issue and PR workflows
  • Code Analysis: Analyze codebases at scale
  • Enterprise: Centralized GitHub access with controlled permissions

Resources