GitHub MCP Server is a Model Context Protocol (MCP) server designed to seamlessly integrate with the GitHub API, providing developers and tools with advanced automation and interaction capabilities.
📦 Introducing GitHub MCP Server
GitHub MCP Server is an official open-source tool released by GitHub, based on the Model Context Protocol (MCP). It operates in a local environment, providing LLMs (Large Language Models) with access to the GitHub API via Docker or an executable file, supporting rich automation and interaction capabilities.
- Release Date: April 4, 2025, public preview released.
- Optimization Goals: Initially, Anthropic provided a reference service. GitHub then rewrote the complete functionality in Go and enhanced tool descriptions, added code scanning support, and more.
🛠️ Key Features
- MCP Toolset: Includes
repos
,issues
,pull_requests
,code_security
(code scanning),notifications
, and more, totaling 7 default modules.
⚙️ Installation and Usage
Docker Method
- Pull the image:
ghcr.io/github/github-mcp-server
- Example startup (using VS Code):
{
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
"ghcr.io/github/github-mcp-server"
],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "${input:github_token}"
}
}
- You can customize the feature set, dynamic loading, read-only mode, and custom host (GHES) via the
GITHUB_TOOLSETS
,GITHUB_DYNAMIC_TOOLSETS
,GITHUB_READ_ONLY
, andGITHUB_HOST
environment variables.
Command Line Method
- Clone the source code and execute:
cd cmd/github-mcp-server
go build -o github-mcp-server
export GITHUB_PERSONAL_ACCESS_TOKEN=<token>
./github-mcp-server stdio
- You can configure the stdio channel in clients such as VS Code / Claude Desktop to use this binary.
🧩 Use Cases
- Automation Workflows: Automatically create issues, pull requests, comments, merge, code scanning, etc.
- AI-Driven Development: Combined with AI clients like Copilot Chat and Claude Desktop, allowing models to provide intelligent suggestions and code reviews based on GitHub context.
- Data Collection and Analysis: Build robots to crawl data from repositories for statistics and analysis.
- Enterprise Cloud Service Integration: Supports GitHub Enterprise Server / Cloud, configuring private instances via the
GITHUB_HOST
environment variable.
⚙️ Configuration Example Overview
Usage Method | Configuration Method | Description |
---|---|---|
Docker | Environment variables or command-line arguments | Set token, toolset, read/write permissions, host |
Direct Binary Execution | CLI or env | Similar to Docker, suitable for CI/CD pipeline integration |
VS Code config | .vscode/mcp.json or user settings |
Shareable project configuration |
i18n / Tool Description Customization | github-mcp-server-config.json |
Change prompt messages or multi-language support |
🔧 MCP and Security
- Supports
--read-only
mode to lock to a non-writable state. - MCP itself may also bring security risks. Community research has pointed out potential attack methods. It is recommended to use it with security audit tools (such as MCPSafetyScanner, etc.).
📝 Summary
github-mcp-server
is a tool developed by GitHub based on the Anthropic MCP protocol, designed to standardize the presentation of GitHub API functionality to AI models. It features high configurability, a secure mode, and is integrated into mainstream AI clients (VS Code Copilot Chat, Claude Desktop, etc.), making it suitable for "AI-driven development" and CI/CD automation scenarios. However, it is still necessary to pay attention to the security risks of MCP itself and use it in conjunction with audit tools.