GitHub MCP服务器的自定义打包版本,通过npx无缝运行于Windows、Linux和macOS。此包装器将Go二进制文件封装在Node.js启动器中,使得使用Claude Desktop的开发者无需Docker或手动编译即可使用GitHub MCP功能。
官方GitHub MCP服务器需要:
这些选项在Linux/macOS上工作良好,但在Windows上会中断或复杂化使用。
此包通过npx提供服务器,消除了对以下内容的需求:
github-mcp-custom命令npx -y github-mcp-custom@1.0.20 stdio
首次使用时会自动下载并运行该包。
npm install -g github-mcp-custom@1.0.20
github-mcp-custom stdio
如果NPX在Windows上有问题,请使用直接路径:
{
"mcpServers": {
"github": {
"command": "C:\\Users\\[USERNAME]\\AppData\\Roaming\\npm\\node_modules\\github-mcp-custom\\dist\\github-mcp-server.exe",
"args": ["stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
}
}
}
}
请将[USERNAME]替换为您的实际Windows用户名。
注意: 使用@1.0.20或更高版本以获得最佳Claude Desktop兼容性。
repo(用于仓库访问)read:org(用于组织访问)user(用于用户信息)repo - 私有仓库的完全控制权read:org - 查看组织和团队成员资格user - 更新用户数据将以下内容添加到位于%APPDATA%\Claude\claude_desktop_config.json的Claude Desktop配置文件中:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "github-mcp-custom@1.0.20", "stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
}
}
}
}
将以下内容添加到位于~/Library/Application Support/Claude/claude_desktop_config.json的Claude Desktop配置文件中:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "github-mcp-custom@1.0.20", "stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
}
}
}
}
将以下内容添加到位于~/.config/Claude/claude_desktop_config.json的Claude Desktop配置文件中:
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "github-mcp-custom@1.0.20", "stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
}
}
}
}
如果您已全局安装,可以使用:
{
"mcpServers": {
"github": {
"command": "github-mcp-custom",
"args": ["stdio"],
"env": {
"GITHUB_PERSONAL_ACCESS_TOKEN": "your_token_here"
}
}
}
}
配置完成后,您将能够访问以下GitHub MCP工具:
search_repositories - 搜索GitHub仓库get_file_contents - 从仓库读取文件内容create_or_update_file - 创建/修改文件create_repository - 创建新的仓库fork_repository - 分叉仓库create_branch - 创建分支push_files - 推送文件更改list_commits - 查看提交历史get_commit - 获取特定提交详情get_issue - 获取带有时间戳的问题详情create_issue - 创建新问题update_issue - 更新问题(返回带有时间戳的更新信息)search_issues - 跨问题搜索list_issues - 列出仓库中的问题get_issue_comments - 获取带有时间戳的问题评论add_issue_comment - 向问题添加评论get_pull_request - 获取PR详情create_pull_request - 创建新的PRupdate_pull_request - 更新现有的PRmerge_pull_request - 合并PRget_pull_request_files - 查看PR更改get_pull_request_comments - 获取PR评论create_and_submit_pull_request_review - 审查PRlist_code_scanning_alerts - 代码安全警报list_secret_scanning_alerts - 密码扫描警报list_notifications - 获取通知dismiss_notification - 忽略通知mark_all_notifications_read - 标记所有为已读get_me - 获取认证用户的详细信息search_users - 搜索GitHub用户直接测试命令:
npx -y github-mcp-custom@1.0.20 stdio
应输出:GitHub MCP Server running on stdio
使用Claude Desktop测试:
get_me工具❌ “服务器断开连接”在Claude Desktop中
1.0.20或更高版本❌ “命令未找到”
npm --version以验证npm是否正常工作❌ “身份验证失败”
repo,read:org,user)❌ “方法未找到”错误
npm install -g github-mcp-custom@latestgithub-mcp-custom/
├── bin/
│ └── index.js # Node.js启动器
├── dist/
│ ├── github-mcp-server.exe # Windows二进制文件
│ ├── github-mcp-server-macos # macOS二进制文件
│ └── github-mcp-server-linux # Linux二进制文件
├── package.json
└── README.md
| 平台 | 测试 | 备注 |
|---|---|---|
| ✅ Windows 10/11 | ✔️ | 不需要Docker或Go |
| ✅ Linux (Ubuntu) | ✔️ | 开箱即用 |
| ✅ macOS (Intel/M1) | ✔️ | 与NPX轻松配合 |
GOOS=linux GOARCH=amd64 go build -o dist/github-mcp-server-linux ./cmd/github-mcp-server
GOOS=darwin GOARCH=amd64 go build -o dist/github-mcp-server-macos ./cmd/github-mcp-server
GOOS=windows GOARCH=amd64 go build -o dist/github-mcp-server.exe ./cmd/github-mcp-server
bin/index.js)。package.json,具有正确的bin配置。欢迎贡献!请访问我们的GitHub存储库:
🔗 存储库: https://github.com/idletoaster/github-mcp-custom
go mod tidynpm run buildnode bin/index.js stdioMIT许可证
版权所有 (c) 2025 idletoaster
在此授权任何人免费获得此软件及其相关文档文件(以下简称“软件”),在不受限制的情况下处理软件,包括但不限于以下权利:使用、复制、修改、合并、发布、分发、再许可和/或出售软件的副本,并允许向其提供软件的人这样做,但需遵守以下条件:
上述版权声明和本许可通知必须包含在软件的所有副本或实质性部分中。
软件按“原样”提供,不附带任何形式的保证,无论是明示的还是默示的,包括但不限于适销性、特定用途适用性和非侵权性的保证。在任何情况下,作者或版权持有人都不对因软件或软件的使用或其它交易而产生的任何索赔、损害或其他责任承担任何责任,无论是在合同行为、侵权行为或其他行为中。