mcp-merge-guard
This server provides MCP tools to manage pull request merging with guardrails:
check-merge-ready: Validates merge readiness for a PR without performing any action. Checks CI status (all checks must pass, none pending/failed), required approvals (approved or no review required), no merge conflicts, and optionally that the branch is up-to-date with the base branch.
guard-merge: Atomically validates the same conditions and, if all pass, merges the PR using the specified method:
merge,squash, orrebase. Rebase is refused unlessallowSignatureStrippingis explicitly set, to protect signed commits. Optionally enforces branch freshness (requireUpToDate) and, iflocalRepoPathis provided, updates the local base branch via GitHub HTTPS fast-forward after a successful merge.
Both tools require the repository owner, name, and PR number.
Provides tools to validate and perform pull request merges on GitHub, checking CI status, approvals, merge conflicts, and branch freshness, with support for merge methods such as merge, squash, and rebase.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-merge-guard Check if PR #42 in owner/repo is ready to merge"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-merge-guard
MCP server that guards PR merge decisions by validating CI, approvals, conflicts, and branch freshness.
Features
check-merge-ready - Query-only status check that validates all guards
guard-merge - Atomic validate-then-merge that refuses if guards fail
Default merge method is
merge(preserves signed branch commits)Rebase is refused unless
allowSignatureStripping: trueis passedOptional
localRepoPathsupport updates the local base branch after merge without relying on the clone's remote protocol
Related MCP server: mcp-pr-reviewer
Guards
Guard | Description |
ci-status | All CI checks passed, none pending or failed |
approval | PR is approved (or no review required) |
conflicts | No merge conflicts |
up-to-date | Branch is current with base (optional, off by default) |
merge-method-policy | Rebase refused unless allowSignatureStripping is set |
Installation
Requires gh CLI installed and authenticated.
With Nix (recommended)
Add to your Claude Code settings (~/.claude/settings.json):
{
"mcpServers": {
"merge-guard": {
"command": "nix",
"args": ["run", "github:paolino/mcp-merge-guard"]
}
}
}Or use /settings in Claude Code to add the MCP server through the UI.
From source
git clone https://github.com/paolino/mcp-merge-guard
cd mcp-merge-guard
npm install && npm run buildAdd to ~/.claude/settings.json (use absolute path):
{
"mcpServers": {
"merge-guard": {
"command": "node",
"args": ["/absolute/path/to/mcp-merge-guard/dist/index.js"]
}
}
}Restart Claude Code after adding the configuration.
Usage
Once configured, use the tools in Claude Code:
Check if PR #42 in owner/repo is ready to mergeMerge PR #42 in owner/repo if all guards passDocumentation
Full documentation at paolino.github.io/mcp-merge-guard
Development
just install # Install dependencies
just build # Build TypeScript
just test # Run tests
just CI # Full CI pipelineLicense
MIT
Available Tools
1 toolguard-mergeA
Validate guards and merge PR only if all pass (atomic operation)
Inputs: repo (required), owner (required), prNumber (required), mergeMethod, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion between tools. The single tool has a clearly distinct purpose.
The single tool name 'guard-merge' follows a consistent verb_noun pattern, making it clear and predictable.
The server has only one tool, which is on the low end of appropriate scope. While focused, it feels thin for typical server expectations.
The server only offers an atomic guard-and-merge operation, lacking separate validation or configuration tools. This creates significant gaps for an agent that might need to validate guards without merging.
Maintenance
Related MCP Connectors
Check GitHub pull requests and schedule, move, cancel or revert merges from an AI assistant.
Freeze and unfreeze merges across a GitHub organization, with an audit trail.
Git-native policy layer for AI agents: check_action verdicts against rules approved via PR.
Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnforces team knowledge and workflow policies for AI coding agents by providing context, decisions, and gates before code changes are made.164Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAnalyzes GitHub Pull Requests using AI via MCP, providing detailed feedback and approve/reject decisions.1MIT
- AlicenseAqualityDmaintenanceEnables safe GitHub automation by queuing write operations for admin approval before execution.6MIT
- AlicenseNot gradedqualityFmaintenancePre-commit norm gate for AI-generated PRs — enforces coding and contribution norms, blocking violations before they land.MIT