Skip to main content
Glama
Festuskipkoech

github-pr-review

GitHub PR Review MCP Server

An MCP server that gives any LLM client the ability to list, read, review, and comment on GitHub pull requests — turning your AI assistant into a fully capable code reviewer.


Overview

This server wraps the GitHub REST API using FastMCP, exposing pull request operations as tools any MCP-compatible client can call. Connect it to Claude Desktop and you can ask Claude to review your open PRs, read diffs, post inline comments, approve, or request changes — all without leaving your conversation.

The server maintains a single authenticated httpx client across its lifetime, initialised on startup and shared across all tool calls via FastMCP's lifespan context.


Related MCP server: git-reviewer

Tools

Tool

Description

list_open_prs

List all open PRs with author, title, draft status, and URL

get_pr_diff

Get file changes and unified diffs for a specific PR

get_pr_comments

Get all existing review comments on a PR

post_review_comment

Post an inline comment on a specific file and line

approve_pr

Approve a PR with an optional review message

request_changes

Request changes on a PR with a review message

Note: approve_pr and request_changes require the authenticated user to be different from the PR author. GitHub does not permit self-review.


Project Structure

github-pr-mcp/
├── server.py          # FastMCP instance, lifespan, tool registration
├── config.py          # Environment variables and constants
├── tools/
│   ├── __init__.py
│   ├── prs.py         # list_open_prs, get_pr_diff
│   └── reviews.py     # get_pr_comments, post_review_comment, approve_pr, request_changes
├── .env               # Your secrets (never committed)
├── .env.example       # Template
├── requirements.txt
├── Dockerfile
└── README.md

Requirements

  • Python 3.11+

  • uv

  • A GitHub Personal Access Token with repo scope


Setup

1. Clone the repository:

git clone https://github.com/Festuskipkoech/github-pr-mcp.git
cd github-pr-mcp

2. Install dependencies:

uv sync

3. Configure your environment:

cp .env.example .env

Edit .env and fill in your values:

GITHUB_TOKEN=your_personal_access_token
GITHUB_OWNER=your_github_username
GITHUB_REPO=your_repository_name

Generate a token at GitHub Settings → Developer Settings → Personal Access Tokens. Enable full repo scope for read and write access.


Running Locally

uv run python server.py

Or with the FastMCP CLI on Streamable HTTP transport:

fastmcp run server.py:mcp --transport streamable-http

Testing with MCP Inspector

Start the server in one terminal:

fastmcp run server.py:mcp --transport streamable-http

Launch the Inspector in a second terminal:

npx -y @modelcontextprotocol/inspector

In the Inspector UI:

  • Transport: Streamable HTTP

  • URL: http://127.0.0.1:8000/mcp

  • Click Connect

Recommended test sequence:

Step

Tool

Input

1

list_open_prs

(no arguments)

2

get_pr_diff

{"pr_number": 1}

3

get_pr_comments

{"pr_number": 1}

4

post_review_comment

{"pr_number": 1, "body": "Looks good", "path": "file.py", "line": 1}


Using with Claude Desktop

Add the following to ~/.config/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "github-pr-review": {
      "command": "/home/your-user/.local/bin/uv",
      "args": [
        "run",
        "--directory",
        "/absolute/path/to/github-pr-mcp",
        "python",
        "server.py"
      ]
    }
  }
}

Use the full path to uv (find it with which uv). Credentials are read from the .env file automatically — no need to pass them in the config.

Restart Claude Desktop, then try:

List all open pull requests in my repo and show me the diff for PR number 1

Claude calls list_open_prs and get_pr_diff and returns structured results:

Claude listing open PRs and fetching the diff

Full PR diff and file changes returned inline:

PR diff results in Claude Desktop


Running with Docker

docker build -t github-pr-mcp .
docker run --env-file .env -p 8000:8000 github-pr-mcp

For Streamable HTTP transport, update server.py to run with:

mcp.run(transport="streamable-http", host="0.0.0.0", port=8000)

Troubleshooting

Error

Cause

Fix

401 Unauthorized

Invalid or expired token

Regenerate PAT on GitHub

403 Forbidden

Token lacks write scope

Enable full repo scope on your PAT

404 Not Found

Wrong owner or repo name

Check .env — use just the repo name, not the full URL

422 Unprocessable on approve

Self-review attempt

GitHub blocks approving your own PRs by design

Available Tools

6 tools
approve_prC

Approve a pull request, optionally with a review message.

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYesAn optional message to include with the approval.
pr_numberYesThe pull request number to approve.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.7/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must fully disclose behavior. It fails to mention side effects, required permissions, or the fact that the message parameter is actually required despite being described as optional. This inconsistency reduces transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is very concise at one sentence, but it omits important details and contains an inconsistency. It is not well-structured for an agent to infer correct usage.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the simple tool (2 parameters, output schema exists), the description is minimal but lacks guidance on return values or edge cases. The contradiction between description and schema further reduces completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% but the description contradicts the schema: the message is described as optional but is required in the schema. This confusion overrides the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (approve) and resource (pull request), and mentions the optional message. It distinguishes from siblings like request_changes and post_review_comment.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not provide any guidance on when to use this tool versus alternatives (e.g., request_changes or post_review_comment). No context on prerequisites or suitable scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_pr_commentsA

Get all review comments on a specific pull request.

ParametersJSON Schema
NameRequiredDescriptionDefault
pr_numberYesThe pull request number to retrieve comments for.

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It only states 'get all review comments' without disclosing behaviors like idempotency, resolved/unresolved status, pagination, or whether it's a read-only operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, clear sentence that front-loads the purpose. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple retrieval tool with one parameter and an output schema (not shown), the description is adequate. It does not cover pagination or filtering but the low complexity makes it sufficient.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The sole parameter (pr_number) is described in the schema with 'The pull request number to retrieve comments for.' The tool description adds no additional meaning beyond what the schema already provides, so baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'all review comments on a specific pull request', which is distinct from sibling tools like approve_pr, get_pr_diff, etc.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The usage is implied: use when you need all comments for a given PR. No explicit exclusions or alternatives are provided, but the simplicity of the tool makes the context clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_pr_diffB

Get the file changes and diff for a specific pull request.

ParametersJSON Schema
NameRequiredDescriptionDefault
pr_numberYesThe pull request number to retrieve the diff for.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.3/5.0
Behavior1/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden of behavioral disclosure. The description only repeats the purpose without adding any details about rate limits, authentication, side effects, or output characteristics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single sentence with no wasted words. It is efficient and front-loads the purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, output schema exists), the description is minimally adequate. It does not mention prerequisites or context, but it is complete enough for basic usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description does not add additional meaning beyond what the schema already provides for the single parameter.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Get' and the resource 'file changes and diff for a specific pull request.' It distinguishes from siblings like approve_pr and get_pr_comments, which handle different aspects of pull requests.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies that the tool should be used when a user needs the diff of a pull request. However, it does not explicitly state when not to use it or compare it to alternatives like get_pr_comments for comments.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_open_prsA

List all open pull requests in the configured repository.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It only states a read operation with no side effects, but lacks details on authorization, rate limits, pagination, or behavior when no PRs exist. The description is minimal and offers no extra behavioral context beyond the obvious read action.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, short sentence that conveys the essential purpose with no wasted words. It is front-loaded and efficiently communicates the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with no parameters and an output schema exists (though not shown). The description is adequate for the straightforward task. It could optionally mention that the output is a list of PRs, but the output schema likely covers that. Overall, it provides the necessary information to understand what the tool does.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema is empty (0 parameters). Per the guidelines, 0 parameters yields a baseline of 4. The description adds no parameter information because none is needed. Schema coverage is trivially 100%.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('list'), the resource ('open pull requests'), and the scope ('in the configured repository'). The tool name also aligns perfectly with its purpose, and the sibling tools (approve, comment, diff) are distinct actions, so there is no ambiguity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description does not explicitly state when to use this tool versus alternatives. However, the purpose is intuitive given the sibling tools; it implies usage when a list of open PRs is needed, but no explicit when-not-to-use guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

post_review_commentA

Post an inline comment on a specific file and line via a review submission.

ParametersJSON Schema
NameRequiredDescriptionDefault
bodyYesThe text content of the comment.
lineYesThe line number in the file to attach the comment to.
pathYesThe relative file path to comment on.
pr_numberYesThe pull request number to comment on.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It does not disclose whether it creates a pending review, submits immediately, or requires permissions. Missing behavioral details like side effects or prerequisites.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with essential information. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Description covers the core action and parameters. Output schema exists but not needed here. For a simple tool with 4 params, description is nearly complete; lacks only minor behavioral clarity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

All 4 parameters have descriptions in the input schema (100% coverage). The description adds no new meaning beyond consolidating the schema info. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states the action (post), the resource (inline comment), and the specifics (file, line, via review submission). It distinguishes from sibling tools like get_pr_comments or approve_pr.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use vs alternatives like request_changes. Usage is implied by context (PR review), but no exclusions or conditions provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

request_changesB

Request changes on a pull request with a review message.

ParametersJSON Schema
NameRequiredDescriptionDefault
messageYesThe review message explaining what changes are needed.
pr_numberYesThe pull request number to request changes on.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden. It only says 'request changes' without disclosing behavioral traits like whether it creates a review, blocks merging, or is reversible. No return value information is provided despite an output schema being present.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that is front-loaded with the core action. However, it may be overly brief for a mutation tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (2 parameters, output schema exists), the description is insufficient. It lacks context about the effect of the action, prerequisites, or what the response contains. A mutation tool should provide more detail.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the description adds no extra meaning beyond the parameter names and types. The baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool requests changes on a pull request with a review message. The verb 'request changes' is specific and distinct from sibling tools like approve_pr or post_review_comment.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives (e.g., post_review_comment or approve_pr). The description does not mention use cases or exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 6 tool updatesv0.1.0
    • First observedapprove_pr
    • First observedget_pr_comments
    • First observedget_pr_diff
    • First observedlist_open_prs
    • First observedpost_review_comment
    • First observedrequest_changes

TDQS

A3.6/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: listing PRs, getting diffs, getting comments, posting inline comments, approving, and requesting changes. No overlap in functionality.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern with underscores (e.g., approve_pr, get_pr_diff), making them predictable and easy to distinguish.

Tool Count5/5

Six tools is an ideal size for a focused PR review server, covering the essential actions without being overwhelming or sparse.

Completeness4/5

The set covers the core PR review workflow (list, diff, comments, approve, request changes) but lacks features like merging or dismissing reviews, which are minor gaps given the server's specific scope.

Maintenance

ActivitySlowing
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

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/Festuskipkoech/github-pr-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server