Commit-to-PR

Provides PR details from commit hashes via the GitHub CLI, returning full PR data including title, body, author, state, labels, and reviews.
  • typescript

0

GitHub Stars

typescript

Language

5 months ago

First Indexed

2 months ago

Catalog Refreshed

Documentation & install

Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.

Installation

Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "vltansky-commit-to-pr-mcp": {
      "command": "npx",
      "args": [
        "commit-to-pr-mcp@latest"
      ],
      "env": {
        "LOG_LEVEL": "debug"
      }
    }
  }
}

You can auto-resolve PR details from git commits using this MCP server. It extracts PR numbers from commits, retrieves full PR data, and works with your existing GitHub CLI setup to empower AI assistants with precise PR context.

How to use

You use this MCP server by connecting it to your MCP client (such as Cursor, Claude Desktop, or VS Code). The server exposes a single tool named get_pr that you call with a commit reference or a PR number. Practical patterns include asking for PR details from a commit hash, from a branch name, or by directly providing a PR number. If you are in a GitHub repository, the server can auto-detect the repository so you don’t have to specify it each time.

How to install

Prerequisites you need before installing:

  • Node.js >= 18.0.0

  • GitHub CLI installed and authenticated (gh auth login)

  • An MCP-compatible client (Cursor, Claude Desktop, VS Code, etc.)

Install the MCP server using the standard configuration shown below. This works in most MCP clients.

{
  "mcpServers": {
    "commit-to-pr": {
      "command": "npx",
      "args": [
        "commit-to-pr-mcp@latest"
      ]
    }
  }
}

Local development and testing

If you prefer running a local build for development and testing, you can run the server directly from your filesystem. This is useful for testing changes before publishing to the MCP ecosystem.

{
  "mcpServers": {
    "commit-to-pr": {
      "command": "node",
      "args": ["/absolute/path/to/commit-to-pr-mcp/dist/index.js"],
      "env": {
        "LOG_LEVEL": "debug"
      }
    }
  }
}

Configuration notes

The server provides a single tool named get_pr. It can determine the PR number from a given commit hash, including merge commits and squash commits, and then fetches comprehensive PR details via the GitHub CLI. You can either supply a commit reference, a branch name, or a direct PR number. If you omit the repository, the server auto-detects it from the git working directory.

Usage patterns with your MCP client

Basic usage patterns include querying PR details for a specific commit, requesting PRs from a branch, or directly retrieving a PR by number. These patterns help you provide AI agents with exact PR context for code understanding, reviews, and merge status.

Security and best practices

Keep your MCP client and GitHub credentials secure. Do not share tokens or local paths in public configurations. When using local development configurations, limit exposure of absolute paths and enable logging only in trusted environments.

Development notes

If you want to develop and test locally, install dependencies, build the project, and run the server with the local command shown above. Ensure you configure your MCP client to point at the local build path when testing.

Available tools

get_pr

Get PR details by commit hash or PR number. It extracts the PR number from git commits (including merge and squash commits) and returns full PR details, including title, body, state, URL, author, timestamps, labels, and reviews.

Built by
VeilStrat
AI signals for GTM teams
© 2026 VeilStrat. All rights reserved.All systems operational