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.
- π 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
- GitHub CLI installed and authenticated (
gh auth login) - Node.js >= 16.0.0
- A git repository with pull requests
Install globally to use anywhere:
npm install -g get-github-pr-commentsOr use without installing via npx:
npx get-github-pr-commentsClone 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 buildAdd to your VS Code MCP settings (.vscode/mcp.json in your workspace):
{
"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"
}
}
}{
"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.
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"]
}
}
}In your Cline MCP settings file:
{
"mcpServers": {
"get-github-pr-comments": {
"command": "npx",
"args": ["get-github-pr-comments"]
}
}
}After adding the configuration, reload VS Code or restart your MCP client to activate the server.
The server provides two MCP tools:
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
Fetch review comments for a specific file in a pull request.
Parameters:
file_path(required): Path to the file to get comments forpr_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
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"
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"
- Auto-Detection: Uses GitHub CLI to detect the current repository and PR
- API Calls: Fetches comment data via
gh apicommands - Formatting: Processes and formats comments for readability
- Context Aware: Provides relevant context (author, date, line numbers)
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
"Failed to get PR info" error
- Ensure you're in a git repository with a checked-out PR
- Run
gh pr viewto 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
# 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# Build the project
npm run build
# Test with MCP inspector (if available)
npx @modelcontextprotocol/inspector node build/index.jsContributions are welcome! Please feel free to submit a Pull Request.
- 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
Pramod Kumar Yadav
MIT
For issues, questions, or contributions, please visit the GitHub repository.