GitHub代码审查MCP服务器
A. 模型上下文协议(MCP) GitHub代码审查服务器。此服务器提供对GitHub存储库、分支、提交和拉取请求的只读访问,使AI助手能够在没有写权限的情况下执行代码审查。
特性
- 列出存储库、分支、提交和拉取请求
- 从不同分支访问文件内容并提交
- 查看拉取请求评论和评论
- 跨存储库搜索代码
- 访问代码扫描警报
先决条件
- Python 3.8或更高版本
- 具有适当读取权限的GitHub个人访问令牌
安装
# Clone the repository
git clone https://github.com/milind-kulshrestha/github-code-review-mcp-server.git
cd github-code-review-mcp-server
# Install dependencies
pip install -e .用法
环境设置
# Set your GitHub Personal Access Token
export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here运行服务器
# Run the server with standard input/output
python -m github_code_review配置选项
GITHUB_PERSONAL_ACCESS_TOKEN:您的GitHub个人访问令牌(必填)GITHUB_HOST:GitHub主机(默认为GitHub,可以为GitHub Enterprise设置)
实现细节
此MCP服务器遵循原始服务器的结构 但它是用Python实现的,专门用于代码审查的只读功能。
可用工具
- 存储库工具:list_branches、list_commits、get_commit、get_file_contents
- 拉取请求工具:get_Pull_request、list_Pull_requests、get_Pull_request_comments
- 代码扫描工具:list_Code_scanning_alert、get_Code_scaning_alert
许可证
麻省理工学院
