GitHub 拉取请求差异
STDIO提取Pull Request差异的MCP服务器
提取Pull Request差异的MCP服务器
The GitHub MCP server provides functionality to extract diffs from Pull Requests.
Retrieves the diff content from a GitHub Pull Request.
Parameters:
owner
: Repository owner/organization namerepo
: Repository namepr_number
: Pull Request numberReturns: Object containing:
content
: String containing the PR diffRequired: Set the GitHub Personal Access Token as an environment variable:
export GITHUB_TOKEN=<your-github-token>
The token needs at least repo
scope permissions to access private repositories. For public repositories, a token with public_repo
scope is sufficient.
The server implements standard error handling:
ErrorCode.AuthenticationError
ErrorCode.InvalidParams
ErrorCode.NotFound