github-mcp-server MCP工具 是 AI Skill Hub 本期精选MCP工具之一。在 GitHub 上收获超过 29.8k 颗 Star,综合评分 8.8 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
GitHub官方MCP服务器实现,使AI助手能直接操作GitHub仓库、问题、拉取请求等资源。采用Go语言开发,高性能稳定可靠。适合开发者、DevOps工程师集成到AI工作流中提升开发效率。
github-mcp-server MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
GitHub官方MCP服务器实现,使AI助手能直接操作GitHub仓库、问题、拉取请求等资源。采用Go语言开发,高性能稳定可靠。适合开发者、DevOps工程师集成到AI工作流中提升开发效率。
github-mcp-server MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/github/github-mcp-server
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"github-mcp-server-mcp--": {
"command": "npx",
"args": ["-y", "github-mcp-server"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 github-mcp-server MCP工具 执行以下任务... Claude: [自动调用 github-mcp-server MCP工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"github-mcp-server_mcp__": {
"command": "npx",
"args": ["-y", "github-mcp-server"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
1. To run the server in a container, you will need to have Docker installed. 2. Once Docker is installed, you will also need to ensure Docker is running. The Docker image is available at ghcr.io/github/github-mcp-server. The image is public; if you get errors on pull, you may have an expired token and need to docker logout ghcr.io. 3. Lastly you will need to Create a GitHub Personal Access Token. The MCP server can use many of the GitHub APIs, so enable the permissions that you feel comfortable granting your AI tools (to learn more about access tokens, please check out the documentation).
<details><summary><b>Handling PATs Securely</b></summary>
Note: Each MCP host application needs to configure a GitHub App or OAuth App to support remote access via OAuth. Any host application that supports remote MCP servers should support the remote GitHub server with PAT authentication. Configuration details and support levels vary by host. Make sure to refer to the host application's documentation for more info.
For other MCP host applications, please refer to our installation guides:
For a complete overview of all installation options, see our Installation Guides Index.
Note: Any host application that supports local MCP servers should be able to access the local GitHub MCP server. However, the specific configuration process, syntax and stability of the integration will vary by host application. While many may follow a similar format to the examples above, this is not guaranteed. Please refer to your host application's documentation for the correct MCP configuration syntax and setup process.
If you don't have Docker, you can use go build to build the binary in the cmd/github-mcp-server directory, and use the github-mcp-server stdio command with the GITHUB_PERSONAL_ACCESS_TOKEN environment variable set to your token. To specify the output location of the build, use the -o flag. You should configure your server to use the built executable as its command. For example:
{
"mcp": {
"servers": {
"github": {
"command": "/path/to/github-mcp-server",
"args": ["stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
}
}
}
}
}
When using Docker, you can pass the toolsets as environment variables:
docker run -i --rm \
-e GITHUB_PERSONAL_ACCESS_TOKEN=<your-token> \
-e GITHUB_TOOLSETS="repos,issues,pull_requests,actions,code_security" \
ghcr.io/github/github-mcp-server
When using Docker, you can pass specific tools as environment variables. You can also combine tools with toolsets:
```bash
Built for developers who want to connect their AI tools to GitHub context and capabilities, from simple natural language queries to complex multi-step agent workflows.
---
See Remote Server Documentation for full details on remote server configuration, toolsets, headers, and advanced usage. This file provides comprehensive instructions and examples for connecting, customizing, and installing the remote GitHub MCP Server in VS Code and other MCP hosts.
When no toolsets are specified, default toolsets are used.
Try new features early! The remote server offers an insiders version with early access to new features and experimental tools.
| Using URL Path | Using Header | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
</td> <td>
</td> </tr> </table> See Remote Server Documentation for more details and examples, and Insiders Features for a full list of what's available. GitHub EnterpriseGitHub Enterprise Cloud with data residency (ghe.com)GitHub Enterprise Cloud can also make use of the remote server. Example for
Note: When using OAuth with GitHub Enterprise with VS Code and GitHub Copilot, you also need to configure your VS Code settings to point to your GitHub Enterprise instance - see Authenticate from VS Code GitHub Enterprise ServerGitHub Enterprise Server does not support remote server hosting. Please refer to GitHub Enterprise Server and Enterprise Cloud with data residency (ghe.com) from the local server configuration. --- Environment Variables (Recommended)To keep your GitHub PAT secure and reusable across different MCP hosts:
Or create a
Note: Environment variable support varies by host app and IDE. Some applications (like Windsurf) require hardcoded tokens in config files. Tool ConfigurationThe GitHub MCP Server supports enabling or disabling specific groups of functionalities via the Toolsets are not limited to Tools. Relevant MCP Resources and Prompts are also included where applicable. When no toolsets are specified, default toolsets are used. Looking for examples? See the Server Configuration Guide for common recipes like minimal setups, read-only mode, and combining tools with toolsets. Specifying ToolsetsTo specify toolsets you want available to the LLM, you can pass an allow-list in two ways:
The environment variable Specifying Individual ToolsYou can also configure specific tools using the
This registers all tools from Important Notes:
CLI utilitiesThe -
Install in VS CodeFor quick installation, use one of the one-click install buttons above. Once you complete that flow, toggle Agent mode (located by the Copilot Chat text input) and the server will start. Make sure you're using VS Code 1.101 or later for remote MCP and OAuth support. Alternatively, to manually configure VS Code, choose the appropriate JSON block from the examples below and add it to your host configuration:
| |||||||||||||||||