github-pr-review-mcp
Allows reading pull request data, diffs, and posting inline review comments and submitting full reviews to GitHub pull requests.
Provides a workflow to automatically review pull requests using Claude Code in CI.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@github-pr-review-mcpReview PR #42 on my repo against our standards"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
github-pr-review-mcp
A local MCP server for reviewing GitHub pull requests: it reads PR diffs, reads your coding standards, and posts inline review comments / a full review back to the PR — all driven by whatever MCP client you connect it to (e.g. Claude Desktop or Claude Code).
Scope is intentionally narrow: this server can only read PR/repo data and post PR review comments/reviews. It cannot edit files, push commits, merge, delete, or manage anything else in your GitHub account.
Tools
Tool | Read/Write | Description |
| read | Verify the token works, show the authenticated user |
| read | List open/closed/all PRs on a repo |
| read | Full PR metadata, including |
| read | Full unified diff for a PR |
| read | Per-file patches + add/delete counts |
| read | Your local |
| read | Existing inline comments already on the PR |
| write | Post one standalone inline comment |
| write | Submit a full review: summary + verdict (COMMENT/APPROVE/REQUEST_CHANGES) + inline comments |
Related MCP server: code-reviewer-mcp
1. Create a GitHub token
GitHub → Settings → Developer settings → Fine-grained personal access tokens → Generate new token.
Resource owner: your account (or the org that owns the repos you'll review).
Repository access: select the specific repos you want this server to touch.
Permissions → Pull requests: Read and write. (Also grant Contents: Read-only if you want
github_get_review_standardsto fetch a standards file from inside the repo.)Generate and copy the token (starts with
github_pat_orghp_).
2. Install dependencies
cd github-pr-review-mcp
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -r requirements.txt3. Configure
Edit STANDARDS.md in this folder to reflect the standards you actually want
enforced (it ships with a generic starter template — trim/expand it).
Set your token as an environment variable, or wire it into your MCP client config directly (see step 4) — either works, you don't need both.
export GITHUB_TOKEN=github_pat_xxxxxxxxxxxx4. Register with your MCP client
Claude Desktop — edit claude_desktop_config.json:
{
"mcpServers": {
"github-pr-review": {
"command": "/absolute/path/to/github-pr-review-mcp/.venv/bin/python",
"args": ["/absolute/path/to/github-pr-review-mcp/server.py"],
"env": {
"GITHUB_TOKEN": "github_pat_xxxxxxxxxxxx"
}
}
}
}Claude Code — from the project directory:
claude mcp add github-pr-review \
--env GITHUB_TOKEN=github_pat_xxxxxxxxxxxx \
-- /absolute/path/to/github-pr-review-mcp/.venv/bin/python /absolute/path/to/github-pr-review-mcp/server.pyRestart the client after editing config. Then ask it to run github_whoami
to confirm the connection works.
5. Typical review flow
Once connected, a prompt like this drives the whole workflow:
Review PR #42 on ososerp-web against our standards and post comments.
Under the hood the client will typically:
github_get_review_standards(local + repo-side)github_get_pull_request(gethead_sha)github_get_pull_request_filesorgithub_get_pull_request_diffgithub_list_review_comments(avoid duplicate feedback)github_submit_pr_reviewwith inline comments and a verdict
Managing context/token usage on large PRs
Tool results stay in context for the rest of the session, so a couple of knobs help keep big PRs from flooding it:
github_get_pull_request_filestruncates each file's patch tomax_patch_chars(default 2500) and returnspatch_truncated: truewhen it cut something off. Passinclude_patch=falsefor a filenames-only overview first, then usepaths=["src/big_file.ts"]to re-fetch just the file(s) you actually need to inspect closely (optionally with a highermax_patch_chars).github_get_pull_request_difftruncates tomax_chars(default 8000). For anything beyond a small PR, prefergithub_get_pull_request_filesinstead — it lets you review file-by-file rather than pulling the whole diff at once.List-heavy tools return compact (non-pretty-printed) JSON to shave a bit more off every call.
The general pattern for a large PR: call github_get_pull_request_files with
include_patch=false first to see what changed, then selectively pull full
patches only for the files that look like they need real scrutiny.
6. Automate it: review every PR automatically
Rather than typing a prompt each time, you can trigger a review the moment a PR opens, using a GitHub Actions workflow that runs Claude headlessly.
Note: If your org is on a Claude Team/Enterprise plan, Anthropic also
offers a fully-managed Code Review feature (org admin enables it once,
no workflow file needed, tune it with a REVIEW.md in the repo). See
code review docs. What
follows is the self-hosted alternative that reuses this server and your
STANDARDS.md directly, works on any plan, and gives you full control over
the tools/prompt.
This repo already includes the pieces:
.github/workflows/pr-review.yml— triggers on PR opened/synchronize/reopenedmcp-config.json— tells Claude Code how to launch this server in CI
Setup:
Copy this whole
github-pr-review-mcp/folder (including.github/workflows/pr-review.ymlandmcp-config.json) into the root of the repo you want auto-reviewed. (Or add it as a git submodule if you want it to stay in sync across repos.)In that repo's GitHub settings → Secrets and variables → Actions, add
ANTHROPIC_API_KEY(from console.anthropic.com).Push a test PR. Within a minute or two you should see review comments posted by the
github-actions[bot]account.
Caveats:
The workflow uses the default
secrets.GITHUB_TOKEN, which only has write access for PRs within the same repo. PRs from forks run with a read-only token and no access to secrets by default (GitHub's security model) — reviewing external contributors' PRs automatically needs apull_request_targetworkflow instead, which is more advanced and requires care not to check out/execute untrusted code.Each review run costs Claude API tokens (scales with PR size); consider limiting the trigger to
openedonly (dropsynchronize) if you don't need re-review on every push.
Notes on line numbers
GitHub's review-comment API expects line to be a line number that actually
appears in the diff hunk for that file (from github_get_pull_request_files'
patch field), not an arbitrary line in the full file. If a comment call
returns a 422 error, re-check the patch/hunk for that file first.
Troubleshooting
401 error:
GITHUB_TOKENmissing, expired, or not picked up — confirm it's set in the exact process/config running the server.403 error: token lacks "Pull requests" permission on that repo, or the repo is private and the token/account can't see it.
404 error: wrong owner/repo/PR number, or no access to a private repo.
422 on posting a comment: the
line/path/sidecombination doesn't correspond to a changed line in the diff.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseDqualityDmaintenanceAn MCP server that fetches GitHub Pull Request comments with file paths, line ranges, and replies using a GitHub personal access token.Last updated13MIT
- Alicense-qualityDmaintenanceAn MCP server that performs automated code reviews by analyzing git diffs against configurable review standards with custom reviewer personas.Last updated2MIT
- Alicense-qualityBmaintenanceAn MCP server that enables checking GitHub and Codeberg PR reviews, change requests, and conversations.Last updatedMIT
- Alicense-qualityBmaintenanceAn MCP server for automated code review of GitHub pull requests. It checks security, quality, and license issues, and provides tools to list, inspect, and review PRs.Last updated4MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
Scan any public GitHub MCP-server repo for security issues. 37 MCP-specific L1 rules, 8 languages.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/iabu94/github-pr-review-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server