GitHub PR Review MCP
December 17, 2024 ยท View on GitHub
A Model Context Protocol (MCP) server for reviewing GitHub pull requests.
Setup
- Clone the repository
- Create virtual environment:
uv venv
source .venv/bin/activate
- Install dependencies:
uv pip install -e .
- Copy
.env.exampleto.envand add your GitHub token:
cp .env.example .env
# Edit .env with your GitHub token
Connect to Claude Desktop
-
Install Claude Desktop
-
Configure Claude Desktop to use this MCP server. Edit the configuration file:
MacOS:
code ~/Library/Application\ Support/Claude/claude_desktop_config.json
Windows:
code %AppData%\Claude\claude_desktop_config.json
- Add the server configuration:
# Start of Selection
{
"mcpServers": {
"github-review": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/github-review-mcp", # Replace with your project's absolute path
"run",
"github-review"
],
"env": {
"GITHUB_TOKEN": "your_github_token_here" # Replace with your GitHub token
}
}
}
}
# End of Selection
- Restart Claude Desktop
Development and Testing
Use MCP Inspector for development and testing:
# Test the server using Inspector
npx @modelcontextprotocol/inspector uv run github-review
The Inspector provides:
- Interactive testing of tools and prompts
- Real-time logs and debugging information
- Request/response inspection
- Server connection status
Features
- Review GitHub pull requests
- Get PR summaries
- View PR comments and review history
- Analyze code changes
Usage
In Claude Desktop:
- Using tools:
Could you help me review this pull request: https://github.com/owner/repo/pull/123
- Using prompts:
/code-review https://github.com/owner/repo/pull/123
/summarize-pr https://github.com/owner/repo/pull/123