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-serverConfiguration
OAuth or GitHub PAT authentication, configurable toolsets for granular accessDocumentation
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
| Tool | Description |
|---|---|
list_repos | List repositories accessible to the authenticated user |
get_repo | Get repository details including metadata |
search_code | Search code across repositories |
get_file | Get file contents from a repository |
list_files | List files and directories in a repository |
get_commit | Get commit details and changes |
list_commits | List commits with optional filters |
Issue Management
| Tool | Description |
|---|---|
list_issues | List issues in a repository |
get_issue | Get issue details |
create_issue | Create a new issue |
update_issue | Update an existing issue |
comment_on_issue | Add comment to an issue |
search_issues | Search issues across repositories |
Pull Request Tools
| Tool | Description |
|---|---|
list_prs | List pull requests |
get_pr | Get PR details including diff |
create_pr | Create a new pull request |
update_pr | Update PR (title, body, state) |
merge_pr | Merge a pull request |
request_review | Request reviewers for a PR |
get_pr_review | Get PR review details |
Actions & CI/CD
| Tool | Description |
|---|---|
list_workflows | List GitHub Actions workflows |
get_workflow_run | Get workflow run details |
list_workflow_runs | List workflow runs |
get_job_logs | Get job logs from a workflow run |
re_run_workflow | Re-run a workflow |
get_build_status | Get build status for a commit |
Code Security
| Tool | Description |
|---|---|
list_security_alerts | List Dependabot and security alerts |
get_security_alert | Get security alert details |
list_vulnerabilities | List vulnerability alerts |
get_code_scanning_results | Get CodeQL analysis results |
get_secret_scanning_alerts | Get 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 accessissues- Issue managementpr_review- Pull request reviewactions- CI/CD workflow managementsecurity- Security and vulnerability analysisnotifications- Notification managementprojects- GitHub Projects accessdiscussions- Community discussions
Claude Desktop Setup
- Install GitHub MCP Server (remote or Docker)
- Authenticate with GitHub (OAuth or PAT)
- Add server configuration to Claude Desktop settings
- Restart Claude Desktop
- GitHub tools will be available in conversations
Cursor Setup
- Add GitHub MCP server to Cursor settings
- Configure authentication
- Restart Cursor
- 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
