pr_comments
A tool to fetch GitHub PR comments via CLI and MCP interfaces. Automatically detects PRs from your current git branch or accepts manual PR specification.
Installation
# From source
# After release (coming soon)
# Via homebrew or shell installer from GitHub releases
GitHub Token Setup
Set your GitHub personal access token as an environment variable:
Required Permissions
- Classic Personal Access Token:
reposcope - Fine-grained Personal Access Token:
pull-requests: readpermission
Usage
CLI Mode
# Auto-detect PR from current branch and get all comments
# Get all comments for specific PR
# Get only review comments (code comments)
# Get only issue comments (discussion)
# List all PRs in the repository
MCP Mode
Start as an MCP server for AI assistants:
# Via flag
# Via subcommand
Using with MCP Inspector
Test the MCP server with the official MCP Inspector:
# Install MCP Inspector (if not already installed)
# Connect to the pr_comments MCP server
The MCP server follows the official protocol specification including the required 3-step handshake. Compatible with all official MCP clients.
Specifying Repository
If not in a git repository, specify the repository explicitly:
Features
- Auto-detection: Automatically detects current PR from git branch
- Dual Interface: Works as both CLI tool and MCP server
- Complete Coverage: Fetches both review comments (code) and issue comments (discussion)
- Pagination: Handles large numbers of comments via API pagination
- Type Safety: Full TypeScript-style type definitions for MCP interface
Development
# Check code
# Run tests
# Build
# All checks
Architecture
The tool is built using:
octocrabfor GitHub API interactionsgit2for repository detectionuniversal_toolframework for CLI/MCP interface generation- Async Rust with Tokio runtime
License
MIT