The GitHub PR Helper is an MCP (Model Context Protocol) service that automates GitHub Pull Request creation and code review using the GitHub CLI. It eliminates the need to manually handle authentication and permissions issues when working with GitHub repositories.
Before using this service, you need to install GitHub CLI:
macOS:
brew install gh
Windows:
winget install --id GitHub.cli
Linux: Refer to the official GitHub CLI documentation
Log in to GitHub CLI:
gh auth login
Follow the prompts to complete the login process. This will automatically handle authentication without manual token management.
Install dependencies:
npm install
Optionally configure environment variables in a .env
file:
PORT
: Server port (defaults to 3000)For development mode:
npm run dev
For production mode:
npm start
To run as an MCP service:
npm run mcp
Create a GitHub Pull Request:
POST /api/github/pr
Request body:
{
"repoPath": "Local Git repository path",
"title": "PR title",
"description": "PR description",
"ticketNumber": "Ticket number",
"baseBranch": "Target branch"
}
Add a comment to a PR:
POST /api/github/pr/comment
Request body:
{
"repoPath": "Local Git repository path",
"baseBranch": "Base branch for comparison",
"filePath": "File path",
"lineNumber": 10,
"comment": "Comment content"
}
create_pull_request: Creates a GitHub Pull Request
Parameters:
repoPath
: Local Git repository pathtitle
: PR titledescription
: PR descriptionticketNumber
: Ticket numberbaseBranch
: Target branchadd_pr_comment: Adds a comment to a PR
Parameters:
repoPath
: Local Git repository pathbaseBranch
: Base branch for comparisonfilePath
: File pathlineNumber
: Line numbercomment
: Comment contentLocate the Roo Code MCP settings file:
/Users/aaron/Library/Application Support/Code/User/globalStorage/rooveterinaryinc.roo-cline/settings/cline_mcp_settings.json
Add the following configuration to the mcpServers
object:
"github-pr-helper": {
"command": "node",
"args": ["/path/to/app-github-pr-helper/src/mcp-server.js"],
"disabled": false,
"alwaysAllow": []
}
Restart VSCode
Locate the Claude settings file:
/Users/aaron/Library/Application Support/Claude/claude_desktop_config.json
Add the same configuration to the mcpServers
object as described above
Restart Claude
Similar configuration applies to other AI assistants that support MCP. Locate their configuration files and add the server configuration with the appropriate path to the MCP server script.
To create a GitHub PR using an AI assistant:
Please use the create_pull_request tool to create a GitHub Pull Request.
Parameters:
{
"repoPath": "/path/to/your/repo",
"title": "Implement new feature",
"description": "This PR implements the new feature, including...",
"ticketNumber": "JIRA-123",
"baseBranch": "main"
}
To add a comment to a PR:
Please use the add_pr_comment tool to add a comment to the PR.
Parameters:
{
"repoPath": "/path/to/your/repo",
"baseBranch": "main",
"filePath": "src/index.js",
"lineNumber": 42,
"comment": "This could be written more concisely"
}
Before using this tool, ensure that:
gh auth login
If you encounter permission issues, check your login status with:
gh auth status
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "github-pr-helper" '{"command":"node","args":["/Users/aaron/CascadeProjects/app-github-pr-helper/src/mcp-server.js"],"disabled":false,"alwaysAllow":[]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"github-pr-helper": {
"command": "node",
"args": [
"/Users/aaron/CascadeProjects/app-github-pr-helper/src/mcp-server.js"
],
"disabled": false,
"alwaysAllow": []
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"github-pr-helper": {
"command": "node",
"args": [
"/Users/aaron/CascadeProjects/app-github-pr-helper/src/mcp-server.js"
],
"disabled": false,
"alwaysAllow": []
}
}
}
3. Restart Claude Desktop for the changes to take effect