Provides comprehensive tools for GitHub pull request code reviews, including PR analysis, review management, comment creation, diff inspection, pattern detection, security checks, and team standards compliance verification.
GitHub Code Review Assistant MCP Server
A comprehensive MCP (Model Context Protocol) server that provides intelligent tools for GitHub pull request code reviews. This server enables AI assistants to analyze PRs, suggest improvements, check for patterns, and ensure consistency with team standards.
Features
Comprehensive PR Analysis - Analyze code patterns, complexity, and potential issues
Review Management - Create comments, submit reviews, and manage feedback
Smart Suggestions - AI-powered review suggestions based on best practices
Standards Compliance - Check PRs against team coding standards
File & Diff Analysis - Detailed examination of changes and their impact
Workflow Integration - Tools designed for complete review workflows
Installation
Prerequisites
Python 3.8 or higher
GitHub Personal Access Token with
reposcopeMCP-compatible client (e.g., Claude Desktop, or any MCP client)
Setup
Install dependencies:
Set up your GitHub token:
Go to GitHub Settings → Developer Settings → Personal Access Tokens
Generate a new token with
reposcopeSave the token securely
Run the server:
Configuration for Claude Desktop
Add to your Claude Desktop configuration file:
Available Tools
1. github_list_pull_requests
Lists pull requests in a repository with comprehensive filtering options.
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)state: Filter by state (open/closed/all)sort: Sort by (created/updated/popularity/long-running)direction: Sort direction (asc/desc)base: Filter by base branchhead: Filter by head branchlimit: Maximum results (1-100)page: Page number for paginationresponse_format: Output format (markdown/json)
Example Usage:
2. github_get_pr_details
Retrieves comprehensive details about a specific pull request.
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)pr_number: Pull request number (required)include_reviews: Include review information (default: true)include_checks: Include status checks (default: true)response_format: Output format (markdown/json)
Example Usage:
3. github_get_pr_files
Lists all files changed in a pull request with statistics.
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)pr_number: Pull request number (required)limit: Maximum results per pagepage: Page numberresponse_format: Output format (markdown/json)
Example Usage:
4. github_get_pr_diff
Retrieves the unified diff for a pull request.
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)pr_number: Pull request number (required)file_path: Filter for specific file (optional)context_lines: Number of context lines (0-10)
Example Usage:
5. github_analyze_pr
Performs comprehensive analysis of a pull request for code quality.
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)pr_number: Pull request number (required)check_patterns: Check for code patterns (default: true)check_complexity: Analyze complexity (default: true)check_security: Basic security checks (default: true)response_format: Output format (markdown/json)
Example Usage:
6. github_get_pr_comments
Retrieves all comments on a pull request.
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)pr_number: Pull request number (required)comment_type: Type of comments (all/issue/review)limit: Maximum resultspage: Page numberresponse_format: Output format (markdown/json)
Example Usage:
7. github_create_review_comment
Creates a comment on a pull request (general or inline).
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)pr_number: Pull request number (required)body: Comment text with markdown support (required)commit_id: SHA of commit to comment on (optional)path: File path for inline comment (optional)line: Line number for inline comment (optional)side: Side of diff (LEFT/RIGHT)
Example Usage:
8. github_create_pr_review
Submits a formal review on a pull request.
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)pr_number: Pull request number (required)body: Review summary text (optional)event: Review action (APPROVE/REQUEST_CHANGES/COMMENT)comments: Array of inline review comments (optional)
Example Usage:
9. github_get_review_suggestions
Generates AI-powered review suggestions for a pull request.
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)pr_number: Pull request number (required)focus_areas: Areas to focus on (performance/security/readability/tests/documentation)response_format: Output format (markdown/json)
Example Usage:
10. github_check_team_standards
Checks if a PR complies with team coding standards.
Parameters:
owner: Repository owner (required)repo: Repository name (required)github_token: GitHub access token (required)pr_number: Pull request number (required)standards_file: Path to standards file in repo (default: .github/CODING_STANDARDS.md)response_format: Output format (markdown/json)
Example Usage:
Usage Examples
Example 1: Complete PR Review Workflow
Example 2: Focused Code Pattern Analysis
Best Practices
For Reviewers
Start with Overview: Use
github_get_pr_detailsto understand the PR contextAnalyze First: Run
github_analyze_prbefore manual reviewCheck Standards: Use
github_check_team_standardsfor consistencyGet Suggestions: Use
github_get_review_suggestionsfor comprehensive feedbackBe Constructive: When creating comments, be specific and suggest improvements
For PR Authors
Self-Review: Use the analysis tools on your own PRs before requesting review
Address Standards: Check standards compliance before submitting
Keep PRs Focused: Analysis tools work better on smaller, focused changes
Include Tests: The tools check for test coverage
Write Good Descriptions: Tools analyze PR descriptions for context
Security Considerations
Token Security: Never hardcode GitHub tokens. Use environment variables or secure credential storage
Permissions: Ensure tokens have appropriate scopes (usually
repois sufficient)Rate Limiting: GitHub API has rate limits. The tools handle this gracefully but be aware of limits
Private Repos: Ensure tokens have access to private repositories if needed
Pattern Detection
The analysis tools detect various code patterns including:
Security Issues: Hardcoded secrets, SQL injection risks, XSS vulnerabilities
Performance Issues: Nested loops, SELECT *, synchronous operations in async code
Code Quality: Console logs, commented code, empty catch blocks
Best Practices: Missing tests, large files, missing documentation
Team Standards Integration
Create a .github/CODING_STANDARDS.md file in your repository with your team's standards. The tool will automatically use this for compliance checking. Example format:
Troubleshooting
Common Issues
Authentication Failed
Verify your GitHub token is valid
Check token has required scopes
Ensure token hasn't expired
Rate Limiting
GitHub limits API calls to 5000/hour for authenticated requests
Tools will report rate limit errors
Consider implementing caching for frequently accessed data
Large PRs
Very large PRs may hit response size limits
Use pagination parameters
Filter to specific files when possible
Network Errors
Check internet connectivity
Verify GitHub API is accessible
Check for proxy/firewall issues
Contributing
Contributions are welcome! Areas for improvement:
Additional pattern detection rules
Support for GitLab/Bitbucket
Enhanced security scanning
Integration with more CI/CD systems
Custom rule definitions
Caching layer for improved performance
License
MIT License - See LICENSE file for details
Acknowledgments
Built using:
Support
For issues, questions, or suggestions:
Open an issue on GitHub
Check the documentation
Review the troubleshooting guide
Note: This tool is designed to assist with code reviews but should not replace human judgment. Always apply context and domain knowledge when reviewing code.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables AI assistants to perform comprehensive GitHub pull request code reviews, including analysis of code patterns, complexity, and security issues, while managing review comments and ensuring compliance with team coding standards.