GitHub Code Reviewer
This server enables AI-powered code review on GitHub Pull Requests by fetching diffs and posting inline comments.
Fetch PR diffs: Retrieve raw code changes from any GitHub PR using
get_pull_request_diff(providing owner, repo name, and PR number).Post inline review comments: Add Markdown-formatted comments to specific lines of changed files using
post_pr_review_comment.Draft or publish comments: Save comments as pending drafts (
PENDING) for manual approval on GitHub, or publish them immediately (PUBLIC).Guided reviews: Use the
review_prprompt for a structured, step-by-step review covering bugs, security vulnerabilities, performance, code style, and error handling.Autonomous reviews: Use
review_pr_autoto let the AI freely analyze the diff using its own judgment, without a fixed checklist.
Fetches pull request diffs and posts inline review comments on GitHub, supporting both draft and published comments.
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 Code ReviewerReview PR #42 in octocat/hello-world and post pending comments"
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.
MCP GitHub Code Reviewer
An MCP (Model Context Protocol) server that gives Claude the ability to fetch Pull Request diffs from GitHub and post inline code review comments directly on the PR — either as a pending draft for you to approve, or published immediately.
How it works
You (Claude Code) ──► MCP Server (src/index.ts) ──► GitHub API
│
Two tools + two prompts exposed:
• get_pull_request_diff
• post_pr_review_comment
• review_pr (prompt — guided)
• review_pr_auto (prompt — autonomous)When running as an MCP server, Claude can call these tools in response to natural language prompts. You describe which PR to review, and Claude fetches the diff, analyzes the code, and posts structured inline comments.
You can also use the built-in review_pr prompt to give Claude step-by-step instructions automatically — no need to describe the process manually each time.
Related MCP server: Bitbucket MCP Server
Prompts available
There are two prompts, each with a different review style:
review_pr — guided review
Instructs Claude to follow a fixed step-by-step process: fetch the diff, analyze it across specific categories, and post inline comments.
Parameter | Type | Required | Description |
| string | yes | GitHub username or organization |
| string | yes | Repository name |
| number | yes | PR number |
| string | no |
|
The prompt instructs Claude to focus on:
Bugs and logic errors
Security vulnerabilities
Performance issues
Code style and readability
Missing error handling
review_pr_auto — autonomous review
Just fetches the diff and lets the LLM review freely using its own judgment — no rigid checklist.
Parameter | Type | Required | Description |
| string | yes | GitHub username or organization |
| string | yes | Repository name |
| number | yes | PR number |
| string | no |
|
Tools available
get_pull_request_diff
Fetches the raw diff of a Pull Request from GitHub.
Parameter | Type | Description |
| string | GitHub username or organization |
| string | Repository name |
| number | PR number |
post_pr_review_comment
Posts an inline review comment on a specific line of a changed file.
Parameter | Type | Description |
| string | GitHub username or organization |
| string | Repository name |
| number | PR number |
| string | File path (e.g. |
| number | Line number where the comment will appear |
| string | Comment text in Markdown |
| string |
|
Prerequisites
Node.js 18+
A GitHub Personal Access Token with
reposcopeClaude Code (to use as an MCP server)
Installation
npm installConfiguration
Create a .env file in the project root:
GITHUB_TOKEN=ghp_YourGitHubTokenHereRunning as an MCP server (Claude Code)
Add this server to your Claude Code MCP configuration (~/.claude/claude_desktop_config.json or via claude mcp add):
{
"mcpServers": {
"github-code-reviewer": {
"command": "npx",
"args": ["tsx", "/path/to/mcp-github-reviewer/src/index.ts"],
"env": {
"GITHUB_TOKEN": "ghp_YourGitHubTokenHere"
}
}
}
}Or start the server manually:
npx -y @modelcontextprotocol/inspector@latest --mode cli npx tsx src/index.tsExample usage
Guided review (step-by-step):
Use the prompt review_pr with owner="seu-usuario", repo="seu-repo", pull_number=42Autonomous review (LLM decides):
Use the prompt review_pr_auto with owner="seu-usuario", repo="seu-repo", pull_number=42Publish comments immediately:
Use the prompt review_pr with owner="seu-usuario", repo="seu-repo", pull_number=42, status="PUBLIC"Manual prompt (without using any built-in prompt):
Review the PR 360 in seu-usuario/seu-repositorio and use post_pr_review_comment with status: "PENDING" so I can double-check everything on GitHub before publishing.
Project structure
mcp-github-reviewer/
├── src/
│ └── index.ts # MCP server — exposes tools to Claude
├── package.json
├── tsconfig.json
└── .env # GITHUB_TOKEN goes hereDependencies
Package | Role |
| MCP server framework |
| GitHub API client |
| Loads |
| Runs TypeScript directly without a build step |
Available Tools
2 toolsget_pull_request_diffA
Fetches the code changes (diff) of a specific Pull Request for analysis.
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository name | |
| owner | Yes | Repository owner | |
| pull_number | Yes | Pull Request number |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and the description only states it fetches diff. Does not disclose any behavioral traits like rate limits, authentication, size limits, or return format. Insufficient for a read operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single sentence, front-loaded with key action and purpose. No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given tool simplicity (3 simple params, no output schema), the description is adequate. Could mention output format (e.g., unified diff) but not critical.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so parameters are fully defined in schema. Description adds no extra meaning beyond what schema provides, so baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Describes exactly what the tool does: fetches the diff of a specific PR. Differentiates from sibling 'post_pr_review_comment' which is a write action.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No explicit guidance on when to use or when not to use. The purpose implies it's for analyzing the diff, but lacks comparison with alternatives or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
post_pr_review_commentA
Posts a code review comment on a specific line of a file changed in the PR. All comments must be written in English.
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | The review comment in Markdown with suggestions. MUST be written in English. | |
| line | Yes | The line number in the file where the comment should be placed | |
| path | Yes | File path (e.g. src/app.js) | |
| repo | Yes | ||
| owner | Yes | ||
| status | Yes | Defines whether the comment should be published immediately ('PUBLIC') or created as a draft review pending user approval ('PENDING'). | |
| pull_number | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, so description must disclose behavioral traits. Only states posting action and language requirement. Lacks details on effects, authentication, rate limits, error handling, or whether comment is immediately visible beyond status parameter.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences, concise, front-loaded with action then constraint. No unnecessary words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a mutation tool with 7 required params and no annotations or output schema, description should cover more context like input expectations, response behavior, and usage restrictions. Currently only covers basic action and language constraint.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 57%. Description adds no parameter-level detail beyond reinforcing body language. Owner, repo, pull_number are standard but undocumented. Description does not compensate for missing param descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states verb 'posts' and resource 'code review comment on a specific line of a file changed in the PR'. Distinct from sibling tool get_pull_request_diff which retrieves diffs.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Implies use when wanting to post a comment, but no explicit guidance on when to use vs alternative (get_pull_request_diff) or prerequisites. Mentions language constraint but not tool selection context.
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.
2 tool updates
v1.0.0- First observed
get_pull_request_diff - First observed
post_pr_review_comment
TDQS
The two tools have clearly distinct purposes: one fetches the diff of a PR, the other posts a review comment. There is no overlap or ambiguity.
Both tools follow a consistent verb_noun pattern in snake_case: 'get_pull_request_diff' and 'post_pr_review_comment'. No inconsistencies.
With only 2 tools, the server feels thin for a code reviewer. While the tools are focused, a typical code review workflow would benefit from additional tools like listing PRs or getting PR details.
The tool surface is incomplete for a code reviewer: it lacks CRUD operations for PRs, file listing, approval/request changes, and other common actions. Agents would face dead ends without these.
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 Connectors
Connect AI assistants to GitHub - manage repos, issues, PRs, and workflows through natural language.
Live PR/MR code reviews via review_url_code. OAuth or portal Bearer auth.
Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.
Human-authenticated setup for routing GitHub pull requests into the right Slack channel.
Related MCP Servers
- AlicenseBqualityCmaintenanceEnables management of GitHub pull request review threads through natural language, allowing users to list, reply to, and resolve PR review comments using GitHub's GraphQL API.4MIT
- AlicenseAqualityBmaintenanceEnables retrieval of pull request metadata and diffs from Bitbucket Cloud and Server/Data Center, with optional comment creation.31MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI assistants to fetch GitHub pull request diffs and metadata, and post review comments directly through the MCP protocol.1MIT
- FlicenseAqualityDmaintenanceEnables analysis of GitHub Pull Requests, including details, diff, file lists, and review tracking.3-
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/thicapistrano/mcp-github-reviewer'
If you have feedback or need assistance with the MCP directory API, please join our Discord server