github-code-review-mcp-server

github-code-review-mcp-server

3.2

If you are the rightful owner of github-code-review-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

A Model Context Protocol (MCP) server for GitHub code review, providing read-only access to repositories, branches, commits, and pull requests.

GitHub Code Review MCP Server

A Model Context Protocol (MCP) server for GitHub code review. This server provides read-only access to GitHub repositories, branches, commits, and pull requests, enabling AI assistants to perform code reviews without write permissions.

Features

  • List repositories, branches, commits, and pull requests
  • Access file contents from different branches and commits
  • View pull request comments and reviews
  • Search code across repositories
  • Access code scanning alerts

Prerequisites

  1. Python 3.8 or higher
  2. A GitHub Personal Access Token with appropriate read permissions

Installation

# 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 .

Usage

Environment Setup

# Set your GitHub Personal Access Token
export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here

Running the Server

# Run the server with standard input/output
python -m github_code_review

Configuration Options

  • GITHUB_PERSONAL_ACCESS_TOKEN: Your GitHub Personal Access Token (required)
  • GITHUB_HOST: GitHub host (defaults to github.com, can be set for GitHub Enterprise)

Implementation Details

This MCP server follows the structure of the original GitHub MCP Server but is implemented in Python and focuses exclusively on read-only functionality for code review purposes.

Available Tools

  • Repository tools: list_branches, list_commits, get_commit, get_file_contents
  • Pull request tools: get_pull_request, list_pull_requests, get_pull_request_comments
  • Code scanning tools: list_code_scanning_alerts, get_code_scanning_alert

License

MIT