A Model Context Protocol (MCP) server that provides GitHub context to AI assistants and editors.
- 📥 Fetch pull request diffs
- 📋 List and inspect pull requests, comments, and reviews
- 📁 List files in PRs and inspect commits
- 🔀 Compare branches
- 🔍 Extract Git remote info from local repositories
npm install -g mcp-github-contextgit clone https://github.com/junielton/mcp-github-context.git
cd mcp-github-context
npm install
npm run build| Variable | Required | Description |
|---|---|---|
GITHUB_TOKEN |
Recommended | GitHub Personal Access Token for private repos and higher rate limits (5000/hour vs 60/hour) |
Generate a token at: https://github.com/settings/tokens
Required scopes: repo for private repos, or public_repo for public only.
# Development
GITHUB_TOKEN=your_token npm run dev
# Production
GITHUB_TOKEN=your_token npm start
# If installed globally
GITHUB_TOKEN=your_token mcp-github-contextAdd this to your MCP client configuration (e.g., Claude, Cursor, etc.):
{
"mcpServers": {
"github-context": {
"command": "npx",
"args": ["-y", "mcp-github-context"],
"env": {
"GITHUB_TOKEN": "your_github_token_here"
}
}
}
}{
"mcpServers": {
"github-context": {
"command": "mcp-github-context",
"env": {
"GITHUB_TOKEN": "your_github_token_here"
}
}
}
}{
"mcpServers": {
"github-context": {
"command": "node",
"args": ["/path/to/mcp-github-context/dist/server.js"],
"env": {
"GITHUB_TOKEN": "your_github_token_here"
}
}
}
}| Tool | Description |
|---|---|
fetch_github_pr_diff |
Fetch raw diff content from a PR |
list_pull_requests |
List PRs with optional filters (state, limit) |
get_pr_details |
Get complete PR details (title, body, labels, stats) |
get_pr_comments |
Fetch all PR comments (general + review) |
get_pr_reviews |
Get all PR reviews with status |
get_pr_files |
List files changed in a PR with stats |
compare_branches |
Compare two branches (commits, files) |
get_commit_details |
Get commit info (author, message, files) |
get_git_remote_info |
Extract owner/repo from local Git repository |
Once configured, you can use prompts like:
- "List the open PRs in facebook/react"
- "Get details of PR #123 from org/repo"
- "Show me the diff for PR #456"
- "Compare main and develop branches in org/repo"
- "What files were changed in commit abc123?"
Apache-2.0 — see LICENSE
junielton - GitHub
- Built on the Model Context Protocol
- Powered by GitHub REST API