Installation
Prerequisites
- gh CLI installed and authenticated
- Claude Code CLI installed
- Node.js 20+ (if running from source)
Adding to Claude Code
Claude Code supports MCP servers through its settings. You can configure them at two levels:
- User-level (
~/.claude/settings.json) - Available in all projects - Project-level (
.claude/settings.json) - Available only in that project
Using the CLI (Recommended)
The easiest way to add the MCP server is through the Claude Code settings interface:
- Start Claude Code in any directory
- Type
/settingsto open the settings menu - Navigate to MCP Servers
- Add a new server with the configuration below
Manual Configuration
Alternatively, edit the settings file directly.
With Nix (Recommended)
Add to ~/.claude/settings.json (create if it doesn't exist):
{
"mcpServers": {
"merge-guard": {
"command": "nix",
"args": ["run", "github:paolino/mcp-merge-guard"]
}
}
}
From Source
Clone and build first:
Then add to ~/.claude/settings.json:
{
"mcpServers": {
"merge-guard": {
"command": "node",
"args": ["/absolute/path/to/mcp-merge-guard/dist/index.js"]
}
}
}
Use absolute paths
The args path must be absolute. Relative paths won't work since Claude Code may run from any directory.
Verifying Installation
After adding the MCP server:
- Restart Claude Code - MCP servers are loaded at startup
- Check available tools - Ask Claude:
You should see check-merge-ready and guard-merge listed.
- Test with a real PR - Try checking a PR status: