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

get-github-pr-comments

v1.0.0

Published

MCP server for fetching GitHub PR review comments

Readme

Get GitHub PR Comments

A Model Context Protocol (MCP) server that fetches GitHub pull request review comments using the GitHub CLI. Seamlessly integrate PR review comments into your development workflow through VS Code, Claude Desktop, or Cline.

Features

  • 📝 Fetch All PR Comments - Get all review comments from any pull request
  • 📄 File-Specific Comments - Filter comments by specific file paths
  • 📊 Multiple Formats - View comments in summary or detailed format
  • 🔄 Auto-Detection - Automatically detects current PR or accepts PR number
  • 🚀 Easy Integration - Works with VS Code, Claude Desktop, and Cline

Prerequisites

  • GitHub CLI installed and authenticated (gh auth login)
  • Node.js >= 16.0.0
  • A git repository with pull requests

Installation

Option 1: Install from npm (Recommended)

Install globally to use anywhere:

npm install -g get-github-pr-comments

Or use without installing via npx:

npx get-github-pr-comments

Option 2: Local Development/Testing

Clone this repository and install dependencies:

git clone https://github.com/power-tester/get-github-pr-comments.git
cd get-github-pr-comments
npm install
npm run build

Configuration

VS Code (with GitHub Copilot)

Add to your VS Code MCP settings (.vscode/mcp.json in your workspace):

Using npm Package (Recommended):

{
  "mcpServers": {
    "get-github-pr-comments": {
      "command": "npx",
      "args": ["get-github-pr-comments"]
    }
  }
}

Or if installed globally (packages typically installed in /usr/local/bin on macOS or %APPDATA%\npm on Windows):

{
  "mcpServers": {
    "get-github-pr-comments": {
      "command": "get-github-pr-comments"
    }
  }
}

Using Local Installation:

{
  "mcpServers": {
    "get-github-pr-comments": {
      "command": "node",
      "args": ["/absolute/path/to/get-github-pr-comments/build/index.js"]
    }
  }
}

Important: Replace /absolute/path/to/get-github-pr-comments/build/index.js with the actual absolute path to your built index.js file.

Claude Desktop

On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "get-github-pr-comments": {
      "command": "npx",
      "args": ["get-github-pr-comments"]
    }
  }
}

Cline

In your Cline MCP settings file:

{
  "mcpServers": {
    "get-github-pr-comments": {
      "command": "npx",
      "args": ["get-github-pr-comments"]
    }
  }
}

Reload Your Client

After adding the configuration, reload VS Code or restart your MCP client to activate the server.

Available Tools

The server provides two MCP tools:

1. get_pr_comments

Fetch all review comments from a pull request.

Parameters:

  • pr_number (optional): PR number to fetch comments from. If not provided, uses the current PR.
  • format (optional): Output format - "summary" or "detailed". Default is "detailed".

Output:

  • Summary format: One line per comment showing file path, line number, and first line of comment
  • Detailed format: Full comment text with author, date, file path, and line number

Example Usage:

Get PR comments
Show PR comments in summary format
Get comments for PR #123

2. get_pr_comments_by_file

Fetch review comments for a specific file in a pull request.

Parameters:

  • file_path (required): Path to the file to get comments for
  • pr_number (optional): PR number to fetch comments from. If not provided, uses the current PR.

Output:

  • Detailed format showing all comments for the specified file
  • Includes author, date, line numbers, and full comment text

Example Usage:

Get PR comments for src/index.ts
Show comments for package.json in PR #123

Usage

In VS Code with GitHub Copilot

Once configured, you can ask Copilot:

  • "Get PR comments and tell me what you think about them?"
  • "Get PR comments and fix the ones that you think are important. Give me a summary of which ones you fixed and which ones you didnt and why"
  • "Show me the review comments for this PR"
  • "What are the comments for src/index.ts?"
  • "Get PR comments in summary format"
  • "Show comments for PR #456"

In Claude Desktop or Cline

Ask the assistant:

  • "Fetch the PR review comments"
  • "Show me all comments on this pull request"
  • "What feedback was given on the authentication code?"
  • "Get comments for the main.py file"

How It Works

  1. Auto-Detection: Uses GitHub CLI to detect the current repository and PR
  2. API Calls: Fetches comment data via gh api commands
  3. Formatting: Processes and formats comments for readability
  4. Context Aware: Provides relevant context (author, date, line numbers)

Security

This server:

  • Only reads PR comment data (no write operations)
  • Uses authenticated GitHub CLI for API access
  • Respects your GitHub permissions and repository access
  • Does not store or transmit data to external services

Troubleshooting

Common Issues:

"Failed to get PR info" error

  • Ensure you're in a git repository with a checked-out PR
  • Run gh pr view to verify PR detection works
  • Check that GitHub CLI is authenticated: gh auth status

"GitHub CLI command failed" error

  • Verify GitHub CLI is installed: gh --version
  • Ensure you're authenticated: gh auth login
  • Check repository permissions

MCP server not connecting

  • Verify the configuration path in your MCP settings file
  • Restart VS Code or your MCP client after configuration changes
  • Check the client's developer console for error messages

No comments returned

  • Verify the PR has review comments (not just PR comments)
  • Check that you have permission to view the PR
  • Try specifying the PR number explicitly

Development

Setup

# Clone the repository
git clone https://github.com/power-tester/get-github-pr-comments.git
cd get-github-pr-comments

# Install dependencies
npm install

# Build
npm run build

# Watch mode for development
npm run watch

Testing Locally

# Build the project
npm run build

# Test with MCP inspector (if available)
npx @modelcontextprotocol/inspector node build/index.js

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Areas for Contribution:

  • Support for different comment types (PR comments vs review comments)
  • Filtering by author, date range, or resolved status
  • Export to different formats (CSV, JSON)
  • Comment threading and conversation tracking
  • Integration with code review workflows

Author

Pramod Kumar Yadav

License

MIT

Support

For issues, questions, or contributions, please visit the GitHub repository.