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 "Install 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-guardCheck 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)
| Name | Required | Description | Default |
|---|---|---|---|
| repo | Yes | Repository name | |
| owner | Yes | Repository owner (user or organization) | |
| prNumber | Yes | Pull request number | |
| mergeMethod | No | Merge method to use (default: rebase) | rebase |
| localRepoPath | No | Local repo path whose base branch should be updated after merge. Fetches the merged base branch over GitHub HTTPS and fast-forwards the local base branch. | |
| requireUpToDate | No | Require branch to be up to date with base (default: false) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The description discloses the atomic validation-then-merge behavior and the guard constraint. However, with no annotations, it does not cover potential side effects, auth requirements, or failure handling beyond the implied no-merge if guards fail.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
A single sentence that is front-loaded with the key actions and condition. No superfluous words; every part is necessary.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description is too brief for a tool with 6 parameters and no output schema. It does not explain what 'guards' are, how validation works, or what the output looks like (e.g., success/failure). More context is needed for an agent to use it correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so baseline is 3. The description adds no additional parameter meaning beyond what the schema provides; it does not clarify how guards are specified or what 'validate' entails.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description explicitly states the tool validates guards and merges a PR only if all pass, with 'atomic operation' highlighting indivisibility. The verb 'validate' and 'merge' combined with the condition clearly define the tool's purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for validating and merging PRs but does not specify when to use this tool vs alternatives. No exclusions or when-not-to-use guidance is provided.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
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.
Turn described changes into reviewed pull requests: propose, triage, review, dependency audits.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnforces team knowledge and workflow policies for AI coding agents by providing context, decisions, and gates before code changes are made.2151Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAnalyzes GitHub Pull Requests using AI via MCP, providing detailed feedback and approve/reject decisions.231MIT
- FlicenseAqualityDmaintenanceEnables safe GitHub automation by queuing write operations for admin approval before execution.6
- FlicenseAqualityCmaintenanceStreamlines GitHub PR workflows, monitors CI/CD, and sends Slack notifications. Provides tools for PR analysis, CI monitoring, and follow-up tasks.7
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/paolino/mcp-merge-guard'
If you have feedback or need assistance with the MCP directory API, please join our Discord server