github-pr-control-mcp
Provides tools for managing GitHub pull requests, including listing, diff viewing, commenting, reviewing, and labeling.
Click on "Deploy 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-control-mcp List open PRs in facebook/react and inspect the newest one's diff"
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 Control MCP
A focused, production-ready Model Context Protocol
server for triaging and reviewing GitHub pull requests. It uses the GitHub REST
API directly—there is no gh CLI wrapper and no shell execution.
What it does
The server exposes eight typed tools:
Tool | Purpose | Default permission |
| List and paginate open, closed, or all PRs | Read |
| Fetch PR metadata, branches, labels, merge state, and counts | Read |
| Fetch and page through a raw unified diff | Read |
| Read inline reviews and top-level conversation comments | Read |
| Post an inline single- or multi-line diff comment | Write |
| Approve, comment, or request changes | Write |
| Add labels without replacing existing labels | Write |
| Submit a dedicated change-request review | Write |
Large repositories and pull requests are first-class:
list_prsandlist_pr_commentsfetch up to 20 GitHub API pages per call.get_pr_diffreturns anoffset,next_offset, andtotal_lines, so clients can process a huge diff in bounded chunks.Every response includes the last observed GitHub rate-limit budget.
GitHub failures surface the remaining budget and reset time when GitHub provides them.
Related MCP server: tai-mcp-github
Install
Requires Node.js 20 or newer.
npx github-pr-control-mcpOr install it globally:
npm install --global github-pr-control-mcp
github-pr-control-mcpAuthentication and permission model
Read-only mode is the default. Choose either a personal access token (PAT) or a GitHub App installation.
PAT: read-only
GITHUB_READ_TOKEN=github_pat_read_only npx github-pr-control-mcpGITHUB_TOKEN is accepted as an alias for GITHUB_READ_TOKEN.
PAT: separate read and write tokens
GITHUB_READ_TOKEN=github_pat_read_only \
GITHUB_WRITE_TOKEN=github_pat_write_scoped \
npx github-pr-control-mcpThe server will not run a write tool unless GITHUB_WRITE_TOKEN is present.
For a single-token setup, set GITHUB_WRITE_ENABLED=true; the configured read
token will then also handle writes.
Recommended fine-grained PAT permissions:
Read tools: Pull requests: Read, Contents: Read, Metadata: Read
Review tools: Pull requests: Read and write
Label tool: Issues: Read and write
GitHub App
GITHUB_APP_ID=123456 \
GITHUB_INSTALLATION_ID=9876543 \
GITHUB_APP_PRIVATE_KEY_PATH=/secure/path/app-private-key.pem \
npx github-pr-control-mcpYou can pass the key inline through GITHUB_APP_PRIVATE_KEY instead. Escaped
\n sequences are normalized automatically.
GitHub App installations are also read-only by default. To enable their write tools:
GITHUB_WRITE_ENABLED=trueThis explicit gate prevents an AI client from turning a broadly scoped credential into write access by accident.
Claude Desktop
Add the server to your Claude Desktop configuration:
{
"mcpServers": {
"github-pr-control": {
"command": "npx",
"args": ["-y", "github-pr-control-mcp"],
"env": {
"GITHUB_READ_TOKEN": "github_pat_read_only"
}
}
}
}Restart Claude Desktop. Try:
List open PRs in
owner/repo, inspect the newest one's diff and comments, then summarize the highest-risk changes. Do not write to GitHub.
To enable reviews, add a tightly scoped GITHUB_WRITE_TOKEN to env.
Cursor
Create .cursor/mcp.json in your project:
{
"mcpServers": {
"github-pr-control": {
"command": "npx",
"args": ["-y", "github-pr-control-mcp"],
"env": {
"GITHUB_READ_TOKEN": "${env:GITHUB_READ_TOKEN}"
}
}
}
}Reload Cursor after saving the file.
Opt-in review prompts
The server exposes two built-in MCP prompts. They appear in clients that support MCP prompts and run only when a user selects them:
triage_pull_requestgathers metadata, the relevant diff, and existing comments, then returns a read-only risk and next-action summary.review_pull_requestperforms an evidence-first review and drafts line-specific findings without publishing anything.
Both prompts accept owner, repo, pull_number, and an optional focus.
Neither prompt authorizes write tools. Publishing comments, labels, approvals,
or change requests always requires a separate explicit instruction and enabled
write credentials.
Tool examples
Paginate a repository with more than 50 PRs
{
"owner": "microsoft",
"repo": "vscode",
"state": "open",
"per_page": 50,
"max_pages": 3
}Read a large diff in chunks
First call:
{
"owner": "owner",
"repo": "repo",
"pull_number": 42,
"offset": 0,
"limit": 2000
}Pass the returned next_offset into the next call until it is null.
Post a multi-line inline comment
{
"owner": "owner",
"repo": "repo",
"pull_number": 42,
"body": "This branch can return a stale value when the cache is empty.",
"path": "src/cache.ts",
"start_line": 18,
"start_side": "RIGHT",
"line": 23,
"side": "RIGHT"
}If commit_id is omitted, the server resolves the current PR head SHA just
before posting.
Development
git clone https://github.com/nexicturbo/github-pr-control-mcp.git
cd github-pr-control-mcp
npm install
npm run ciThe test suite covers multi-page pagination, bounded diff traversal, read/write separation, opt-in prompt registration, review submission, label preservation, configuration validation, and rate-limit error messages.
Security notes
Tokens and private keys are read only from environment variables or an explicitly configured private-key path.
Credentials are never returned through MCP tool results.
No subprocess or shell command is invoked by the server.
Write tools are disabled unless the operator explicitly opts in.
Use the narrowest repository and permission scope possible.
License
Available Tools
8 toolsadd_labelsAdd pull request labelsAIdempotent
Add one or more labels to a pull request. Existing labels are preserved.
Inputs: repo (required), owner (required), labels (required), pull_number (required).
get_prGet pull requestARead-only
Fetch pull request metadata, merge state, counts, labels, and branch SHAs.
Inputs: repo (required), owner (required), pull_number (required).
get_pr_diffGet pull request diffARead-only
Fetch a raw unified diff. Use offset and limit to page through very large pull requests.
Inputs: repo (required), owner (required), pull_number (required), limit, +1 more.
list_pr_commentsList pull request commentsARead-only
List both inline review comments and top-level PR conversation comments with pagination.
Inputs: repo (required), owner (required), pull_number (required), page, +2 more.
list_prsList pull requestsARead-only
List pull requests with multi-page pagination and a compact triage-oriented response.
Inputs: repo (required), owner (required), base, head, +4 more.
post_review_commentPost inline review commentA
Post a single inline comment at a diff line. Write access must be explicitly enabled.
Inputs: body (required), line (required), path (required), repo (required), +6 more.
request_changesRequest pull request changesA
Submit a REQUEST_CHANGES review with a required explanation. Write access must be explicitly enabled.
Inputs: body (required), repo (required), owner (required), pull_number (required).
submit_reviewSubmit pull request reviewA
Submit an APPROVE, REQUEST_CHANGES, or COMMENT review. Write access must be explicitly enabled.
Inputs: repo (required), event (required), owner (required), pull_number (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Most tools are clearly distinct, but submit_review and request_changes overlap significantly since request_changes is just a specific review type. Similarly, post_review_comment vs. submit_review with COMMENT type could cause confusion. Descriptions help, but these boundary areas could lead to misselection.
All tools follow a consistent verb_noun pattern with snake_case (list_prs, get_pr_diff, submit_review, add_labels). No mixed conventions or stylistic deviations appear.
8 tools is well-scoped for a pull-request control server, covering list, get, diff, comments, reviews, and labels without unnecessary bloat.
The set thoroughly covers review workflows (comments, reviews, labels) and basic read operations, but lacks PR update, merge, or close operations, which are minor gaps for a 'control' server.
Maintenance
Related MCP Connectors
Create, deploy, and operate MCP servers directly from your GitHub repositories.
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.…
A MCP server built for developers enabling Git based project management with project and personal…
An MCP server that gives your AI access to the source code and docs of all public github repos
Related MCP Servers
- AlicenseCqualityDmaintenanceA production-ready MCP server for GitHub operations, providing tools for repository management, issues, pull requests, and more via both MCP stdio and REST API.27MIT
- FlicenseAqualityDmaintenanceA minimal MCP server that exposes a focused set of GitHub PR review tools to AI agents, enabling PR listing, detail retrieval, comment viewing, and thread management.5-
- AlicenseNot gradedqualityDmaintenanceAn 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.20 npmMIT
- AlicenseAqualityDmaintenanceAn MCP server that provides operational tooling over the GitHub API — issue triage, PR review monitoring, repo health audits, and team access reviews.111MIT