Provides functionality to extract diffs from GitHub Pull Requests, allowing retrieval of PR diff content by specifying repository owner, repo name, and PR number.
Serves as the runtime environment for the MCP server, requiring version 18.0.0 or higher for operation.
Used for input validation within the MCP server to ensure proper parameter formatting before API requests are processed.
GitHub Integration
The GitHub MCP server provides functionality to extract diffs from Pull Requests.
Available Tools
get_diff_pr
Retrieves the diff content from a GitHub Pull Request.
Parameters:
owner
: Repository owner/organization namerepo
: Repository namepr_number
: Pull Request number
Returns: Object containing:
content
: String containing the PR diff
Authentication
Required: Set the GitHub Personal Access Token as an environment variable:
The token needs at least repo
scope permissions to access private repositories. For public repositories, a token with public_repo
scope is sufficient.
Error Handling
The server implements standard error handling:
- Missing/invalid token returns
ErrorCode.AuthenticationError
- Invalid repository details return
ErrorCode.InvalidParams
- Non-existent PR returns
ErrorCode.NotFound
- Failed diff fetches return formatted error messages
- Graceful shutdown on SIGINT
Technical Details
- Built using the Highlight AI MCP SDK
- Uses GitHub REST API v3
- Input validation via Zod
- Runs as a stdio-based MCP server
- Supports Node.js >=18.0.0
Limitations
- Rate limits apply based on GitHub API restrictions
- Large diffs may be truncated according to GitHub API limits
- Token requires appropriate repository access permissions
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Extracts diffs from GitHub Pull Requests, allowing users to retrieve and analyze changes between branches in a repository.
Related Resources
Related MCP Servers
- AsecurityFlicenseAqualityGenerates comprehensive and formatted release notes from GitHub repositories, efficiently organizing commits by type and including detailed statistics using smart API usage.Last updated -2
- AsecurityAlicenseAqualityProvides GitHub data analysis for repositories, developers, and organizations, enabling insights into open source ecosystems through API calls and natural language queries.Last updated -513MIT License
- -securityFlicense-qualityA tool that integrates with GitHub and Notion to analyze and review pull requests, enabling automated code reviews and documentation in Notion.Last updated -
- -securityFlicense-qualityA lightweight tool that uses Mistral AI running locally to generate structured GitHub pull request descriptions from git diffs.Last updated -