npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

mcp-pr-reviewer

v1.1.6

Published

Intelligent PR reviews powered by the Model Context Protocol and LLMs

Downloads

64

Readme

MCP PR Reviewer

npm version License: MIT

Intelligent PR reviews powered by the Model Context Protocol and LLMs.

MCP PR Reviewer analyzes GitHub Pull Requests using AI, leveraging the Model Context Protocol for secure GitHub integration and providing detailed feedback.

🚀 Features

  • MCP GitHub Integration: Securely fetches PR data using @modelcontextprotocol/server-github.
  • AI-Powered Analysis: Uses configurable LLMs via OpenRouter for insightful code review.
  • Structured Feedback: Provides a clear decision (Approve/Reject), summary, and key points.
  • CLI & Server Modes: Usable both directly for analysis and as a server for integrations.
  • Customizable: Choose your preferred LLM model.

🔧 Installation

# Install globally
npm install -g mcp-pr-reviewer

# Or use with npx without installing
npx mcp-pr-reviewer --help

💻 Usage

Prerequisites

Set the following environment variables:

  • GITHUB_TOKEN: Your GitHub Personal Access Token with repo scope.
  • OPENROUTER_API_KEY: Your API key from OpenRouter.ai.

Analyze a Pull Request

# Format
mcp-pr-reviewer analyze <owner> <repo> <pr-number> [options]

# Example
mcp-pr-reviewer analyze octocat hello-world 123

# Example with specific ports and model
mcp-pr-reviewer analyze myorg my-repo 456 --mcp-port 8081 --llm-port 8091 --model openrouter/anthropic/claude-3-haiku

Options:

  • --mcp-port <port>: Port for the internal MCP GitHub server (default: 8080).
  • --llm-port <port>: Port for the internal LLM provider server (default: 8090).
  • -m, --model <model>: Specify the OpenRouter model ID (default: openrouter/optimus-alpha).

Run as a Server (for Integrations)

The server command starts only the LLM provider component, making it available as an MCP server for other tools or integrations (like GitHub Actions).

# Start the LLM Provider server
mcp-pr-reviewer server --port 8012 --model openrouter/google/gemini-pro

This allows external systems to call its analyze_pr capability.

🧩 MCP Configuration (Example for Cursor)

You can integrate mcp-pr-reviewer with tools like Cursor using an mcp.json file. Here's an example configuration:

{
  "mcpServers": {
    "GitHub MCP": {
      "command": "npx",
      "type": "stdio",
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT_HERE"
      },
      "args": [
        "@modelcontextprotocol/server-github"
      ]
    },
    "PR Reviewer": {
      "command": "npx",
      "type": "http",
      "baseUrl": "http://localhost:8012",
      "env": {
        "OPENROUTER_API_KEY": "YOUR_OPENROUTER_KEY_HERE"
      },
      "args": [
        "mcp-pr-reviewer",
        "server",
        "--port",
        "8012"
      ]
    }
  }
}

Note: Replace placeholders like YOUR_GITHUB_PAT_HERE and YOUR_OPENROUTER_KEY_HERE with your actual credentials.

🏗️ Architecture

The analyze command orchestrates two main components:

  1. MCP GitHub Server: An instance of @modelcontextprotocol/server-github started internally to handle secure communication with the GitHub API.
  2. LLM Provider Server: A simple Express server (lib/mcp-llm-provider.js) started internally that:
    • Accepts analysis requests.
    • Communicates with the OpenRouter API to get the LLM analysis.

The lib/analyze-pr.js script coordinates the process:

  1. Connects to the running MCP GitHub Server (via HTTP) to fetch the PR diff.
  2. Sends the diff to the running LLM Provider Server (via HTTP) for analysis.
  3. Outputs the formatted review.

The server command only starts the LLM Provider Server, exposing it for external MCP calls.

🤝 Contributing

Contributions are welcome! Please fork the repository and submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📜 License

MIT License - see the LICENSE file for details.

📚 FAQ

Q: What is Model Context Protocol (MCP)? A: An open standard allowing AI models to securely interact with tools and data sources. See modelcontext.dev.

Q: Does it work with private repositories? A: Yes, ensure your GITHUB_TOKEN has the necessary permissions (e.g., repo scope).

Q: Can I use models other than OpenRouter? A: Currently, it's hardcoded for OpenRouter. Modifying lib/mcp-llm-provider.js would be required to support other providers.

Q: How is this different from GitHub Copilot's PR Summary? A: This tool provides a more opinionated review, including an Approve/Reject decision and specific feedback points based on a configurable prompt, rather than just a summary.