GitHub Code Reviewer
Enables fetching Pull Request diffs from GitHub and posting inline review comments directly on PRs, either as pending drafts or published immediately.
README
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 exposed:
• get_pull_request_diff
• post_pr_review_comment
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.
Tools available
get_pull_request_diff
Fetches the raw diff of a Pull Request from GitHub.
| Parameter | Type | Description |
|---|---|---|
owner |
string | GitHub username or organization |
repo |
string | Repository name |
pull_number |
number | PR number |
post_pr_review_comment
Posts an inline review comment on a specific line of a changed file.
| Parameter | Type | Description |
|---|---|---|
owner |
string | GitHub username or organization |
repo |
string | Repository name |
pull_number |
number | PR number |
path |
string | File path (e.g. src/app.js) |
line |
number | Line number where the comment will appear |
body |
string | Comment text in Markdown |
status |
string | PENDING saves as a draft (you publish on GitHub); PUBLIC submits immediately |
Prerequisites
- Node.js 18+
- A GitHub Personal Access Token with
reposcope - Claude Code (to use as an MCP server)
Installation
npm install
Configuration
Create a .env file in the project root:
GITHUB_TOKEN=ghp_YourGitHubTokenHere
Running 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:
npm start
Example prompts
Use these prompts in Claude Code after the MCP server is connected:
Review with pending draft (recommended for first use):
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.
Claude will fetch the diff, analyze the code, and save the comments as a pending draft review on GitHub. You then go to the PR on GitHub and click "Submit review" when you're happy with the comments.
Review and publish immediately:
For immediate launch: "Review the PR and use post_pr_review_comment with status: "PUBLIC" to submit the comments directly."
Claude will post every comment live on the PR as soon as it finishes the analysis.
Full review in Portuguese:
Por favor, liste as alterações e faça o code review do PR número 42 do repositório seu-usuario/seu-repositorio. Se encontrar problemas, use a ferramenta de comentário para postar direto no GitHub.
Claude will list the changed files, analyze the diff, and post inline comments directly to the PR.
Project structure
mcp-github-reviewer/
├── src/
│ └── index.ts # MCP server — exposes tools to Claude
├── package.json
├── tsconfig.json
└── .env # GITHUB_TOKEN goes here
Dependencies
| Package | Role |
|---|---|
@modelcontextprotocol/sdk |
MCP server framework |
@octokit/rest |
GitHub API client |
dotenv |
Loads .env variables |
tsx |
Runs TypeScript directly without a build step |
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.