产品定位
GitHub Enterprise MCP Server 是一个中间件服务,旨在通过Cline工具链提供对GitHub API的高级访问能力,实现自动化仓库管理、代码搜索和协作功能。
核心功能
- 自动分支创建:在创建/更新文件或推送更改时自动创建不存在的分支
- 完善的错误处理:为常见问题提供清晰的错误信息
- Git历史保留:所有操作都会保留完整的Git历史记录,无需强制推送
- 批量操作:支持单文件和批量文件操作
- 高级搜索:支持代码、问题/PR和用户的搜索
适用场景
- 自动化GitHub仓库管理
- 批量文件操作和版本控制
- 跨仓库代码搜索和分析
- 问题跟踪和PR管理自动化
- 团队协作流程优化
工具列表
create_or_update_file
:创建或更新单个文件push_files
:批量推送多个文件search_repositories
:搜索GitHub仓库create_repository
:创建新仓库get_file_contents
:获取文件/目录内容create_issue
:创建新问题create_pull_request
:创建PRfork_repository
:fork仓库create_branch
:创建新分支list_issues
:列出和过滤问题update_issue
:更新问题add_issue_comment
:添加问题评论search_code
:代码搜索search_issues
:问题和PR搜索search_users
:用户搜索list_commits
:获取分支提交历史get_issue
:获取问题详情get_pull_request
:获取PR详情list_pull_requests
:列出和过滤PRcreate_pull_request_review
:创建PR评审merge_pull_request
:合并PRget_pull_request_files
:获取PR变更文件get_pull_request_status
:获取PR状态检查update_pull_request_branch
:更新PR分支get_pull_request_comments
:获取PR评论get_pull_request_reviews
:获取PR评审
常见问题解答
- 路径配置错误:检查index.js文件的绝对路径是否正确
- 权限问题:确保个人访问令牌具有必要的权限
- API URL错误:验证GitHub API URL是否正确
- 查看日志:检查错误日志获取详细信息
使用教程
使用依赖
- 安装Node.js
- 获取GitHub个人访问令牌
- 安装Cline
安装步骤
bash
git clone https://github.com/yourusername/github-enterprise-mcp.git
cd github-enterprise-mcp
npm install
npm run build
配置MCP设置
- 找到Cline MCP设置文件
- 添加GitHub Enterprise MCP服务器配置
- 设置环境变量包括个人访问令牌
调试方式
```bash
npm start
验证安装
Can you search for repositories with the keyword "react" using the GitHub Enterprise MCP server?
```