commit-to-pr-mcp
v0.0.1
Published
MCP server that extracts PR details from git commit hash using gh CLI
Maintainers
Readme
commit-to-pr-mcp
An MCP server that extracts PR details from git commit hashes using the GitHub CLI (gh).
Prerequisites
- GitHub CLI installed and authenticated (
gh auth login) - Node.js 18+
Installation
npm install
npm run buildUsage
Claude Desktop Configuration
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"commit-to-pr": {
"command": "node",
"args": ["/path/to/commit-to-pr-mcp/dist/index.js"]
}
}
}Tools
get_pr_from_commit
Extract PR number from a git commit and retrieve full PR details.
Parameters:
commit(required): Git commit hash (full or short), branch name, or any git referencerepo(optional): GitHub repository inowner/repoformat
Example:
Get PR details for commit abc123get_pr_details
Get detailed information about a specific PR by its number.
Parameters:
pr_number(required): The PR number to look uprepo(optional): GitHub repository inowner/repoformat
Response
Returns PR details including:
number: PR numbertitle: PR titlebody: PR descriptionstate: PR state (OPEN, CLOSED, MERGED)url: GitHub URLauthor: PR author usernamecreatedAt: Creation timestampmergedAt: Merge timestamp (if merged)baseRef: Target branchheadRef: Source branchlabels: Array of label names
