这是一个使用GitHub个人访问令牌获取GitHub拉取请求评论的Model Context Protocol (MCP)服务器。
<a href="https://glama.ai/mcp/servers/@shaileshahuja/github-pr-mcp"> <img width="380" height="200" src="https://gips3.baidu.com/it/u=1687391493,3866889329&fm=3081&app=3081&f=PNG?w=760&h=400" alt="GitHub PR Comments Server MCP服务器" /> </a>要通过Smithery自动安装github-pr-mcp到Claude Desktop:
npx -y @smithery/cli install github-pr-mcp --client claude
克隆仓库
安装依赖项:
npm install
创建一个包含你的GitHub令牌的.env文件:
GITHUB_TOKEN=your_github_token_here
构建项目:
npm run build
运行服务器:
npm start
或者直接使用GitHub令牌:
node dist/server.js your_github_token_here
该服务器公开了一个名为get_pr_comments的工具,接受以下参数:
owner: 仓库所有者(用户名或组织)repo: 仓库名称pull_number: 拉取请求编号要在Cursor的MCP服务器配置中集成,使用以下命令:
node /path/to/dist/server.js your_github_token_here
将/path/to替换为项目的实际路径,并将your_github_token_here替换为你的GitHub个人访问令牌。
包含一个测试客户端以验证服务器功能:
构建项目:
npm run build
运行测试客户端:
npm test
测试客户端将启动服务器,连接到它,并使用示例参数调用get_pr_comments工具。
服务器返回评论的格式如下:
{
"comments": [
{
"id": 123456789,
"path": "src/example.js",
"body": "这是对特定行的评论",
"line": 42,
"start_line": 20,
"user": {
"login": "username"
},
"created_at": "2023-01-01T00:00:00Z",
"replies": [
{
"id": 987654321,
"body": "这是对评论的回复",
"user": {
"login": "another-username"
},
"created_at": "2023-01-02T00:00:00Z"
}
]
}
]
}
要在开发模式下运行服务器:
npm run dev
ISC