GitHub PR Diff

by highlight-ing

1 stars
Not rated
GitHub

About

Integrates with GitHub's Pull Request API to extract diff content, enabling automated code review and analysis workflows.

Details

Author
highlight-ing
Repository
highlight-ing/highlight-github-mcp
GitHub stars
1
Categories
Productivity, Developer Tools, Design, Workplace, File Management, AI, API, Infrastructure, Automation

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name GitHub PR Diff
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @highlight/mcp-server

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Required: Set the GitHub Personal Access Token as an environment variable:

export GITHUB_TOKEN=<your-github-token>

The token needs at least repo scope permissions to access private repositories. For public repositories, a token with public_repo scope is sufficient.

get_diff_pr

Retrieves the diff content from a GitHub Pull Request. Parameters: owner (string), repo (string), pr_number (integer). Returns an object containing the diff content.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "github pr diff": {
            "env": {},
            "args": [
                "-y",
                "@highlight/mcp-server"
            ],
            "command": "npx"
        }
    }
}

Linux

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Macos

{
    "env": [],
    "args": [
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "npx"
}

Windows

{
    "env": [],
    "args": [
        "/c",
        "npx",
        "-y",
        "@highlight/mcp-server"
    ],
    "command": "cmd"
}

GitHub Integration

The GitHub MCP server provides functionality to extract diffs from Pull Requests.

Available Tools

get_diff_pr

Retrieves the diff content from a GitHub Pull Request.

Parameters:
- owner: Repository owner/organization name
- repo: Repository name
- pr_number: Pull Request number

Returns: Object containing:
- content: String containing the PR diff

Authentication

Required: Set the GitHub Personal Access Token as an environment variable:

export GITHUB_TOKEN=<your-github-token>

The token needs at least repo scope permissions to access private repositories. For public repositories, a token with public_repo scope is sufficient.

Error Handling

The server implements standard error handling:
- Missing/invalid token returns ErrorCode.AuthenticationError
- Invalid repository details return ErrorCode.InvalidParams
- Non-existent PR returns ErrorCode.NotFound
- Failed diff fetches return formatted error messages
- Graceful shutdown on SIGINT

Technical Details

- Built using the Highlight AI MCP SDK
- Uses GitHub REST API v3
- Input validation via Zod
- Runs as a stdio-based MCP server
- Supports Node.js >=18.0.0

Limitations

- Rate limits apply based on GitHub API restrictions
- Large diffs may be truncated according to GitHub API limits
- Token requires appropriate repository access permissions

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.