Skip to content
MCP server

GuardGit MCP

Pre-commit secret scanner and structural JSON diff for AI coding agents via MCP

Runs locally

GuardGit MCP is an open-source MCP server for developer tools. It runs locally on your machine and is started by your AI client.

Pricing
Open source
Platforms
CLI, Linux, macOS
Runs
Locally
Version
1.0.1
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add guardgit-mcp -- npx -y guardgit-mcp

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

{
  "mcpServers": {
    "guardgit-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "guardgit-mcp"
      ]
    }
  }
}

Claude Code setup guide

Add to claude_desktop_config.json

{
  "mcpServers": {
    "guardgit-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "guardgit-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

Claude Desktop setup guide

Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "guardgit-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "guardgit-mcp"
      ]
    }
  }
}

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "guardgit-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "guardgit-mcp"
      ]
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

Add with the CLI

Run in a terminal

codex mcp add guardgit-mcp -- npx -y guardgit-mcp

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.guardgit-mcp]
command = "npx"
args = ["-y", "guardgit-mcp"]

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "guardgit-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "guardgit-mcp"
      ]
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

    {
      "mcpServers": {
        "guardgit-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "guardgit-mcp"
          ]
        }
      }
    }

    Or run: gemini mcp add -s user guardgit-mcp npx -- -y guardgit-mcp

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

    {
      "mcpServers": {
        "guardgit-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "guardgit-mcp"
          ]
        }
      }
    }

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

    {
      "mcpServers": {
        "guardgit-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "guardgit-mcp"
          ]
        }
      }
    }

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

    {
      "mcpServers": {
        "guardgit-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "guardgit-mcp"
          ]
        }
      }
    }

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "guardgit-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "guardgit-mcp"
          ]
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

    {
      "mcpServers": {
        "guardgit-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "guardgit-mcp"
          ]
        }
      }
    }

    Junie

    Add to ~/.junie/mcp/mcp.json

    {
      "mcpServers": {
        "guardgit-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "guardgit-mcp"
          ]
        }
      }
    }

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

    {
      "mcpServers": {
        "guardgit-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "guardgit-mcp"
          ]
        }
      }
    }

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

About GuardGit MCP

GuardGit MCP sits between an autonomous coding agent and your git history. Before changes are committed, it scans the working tree and staged diffs for leaked credentials, private keys, .env files, large binaries and build artifacts, then returns a risk score and a PASS, WARN or BLOCK verdict with redacted previews.

Beyond secret scanning, it turns minified or very large JSON changes in files like package.json, tsconfig.json, lockfiles and locale dictionaries into key-level trees with breaking-change flags. It also estimates a blast radius across sensitive areas such as auth, migrations and CI/CD, and dry-runs merges with git merge-tree without touching the working tree.

The same core runs as an MCP server over stdio, as a CLI for terminal and CI pre-commit hooks, and as an interactive cockpit UI for hosts that support the SEP-1865 MCP App format. It is aimed at developers who let AI agents write code and want a safety check before those changes land.

Tools this server provides (5)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, 1 of 5 tools reads data; 4 names don't say.

From the server's own tool labels and tool names; not verified by us.

open_guardgit_cockpit
Runs a full repo health overview and opens the interactive cockpit.
scan_precommit_guard
Scans a repository path, raw diff or file array for secrets, high-entropy assignments, large blobs and artifacts.
diff_structural_json
Computes a semantic key and array diff with breaking-change flags for JSON strings or Git files.
analyze_blast_radiusName suggests: reads
Scores commit blast radius and runs a read-only git merge-tree conflict dry-run.
plan_atomic_commits
Splits staged and unstaged changes into ordered Conventional Commits, excluding blocked files.

What it does

Pre-commit secret guard
Detects cloud, model and payment provider tokens, JWTs, PEM keys and database credentials, and redacts them in results.
Artifact and blob blocking
Flags oversized binaries, SQLite files, node_modules, dist folders and packaged extensions before they are staged.
Semantic JSON diff
Shows key-level changes in JSON files with keyed array matching and automatic breaking-change flags.
Blast radius heatmap
Scores a commit from 0 to 100 and groups changes by folder across sensitive surfaces.
Read-only merge dry-run
Runs an in-memory git merge-tree conflict check against a target branch without mutating the working tree.
Atomic commit planning
Splits safe changes into ordered Conventional Commits and provides staging commands.

Good for

  • Stopping API keys or .env files from being committed by an AI coding agent
  • Reviewing large lockfile or config JSON changes without reading minified diffs
  • Checking whether a branch will conflict with main before merging
  • Breaking a large AI-generated change set into reviewable commits
  • Adding a secret and artifact check to CI pre-commit hooks

Pricing

Open source

Free under AGPL-3.0; commercial license for proprietary use.

Prices change. Check hessam-mamagani.github.io before you buy.

GuardGit MCP FAQ

How do I run GuardGit MCP?

Run npx guardgit-mcp for MCP over stdio, or use the CLI subcommands scan, diff, blast and plan directly in a terminal or CI job.

Does GuardGit MCP change my repository?

No. The project describes itself as read-only: it never pushes, checks out, resets or modifies the working tree, and makes no network requests.

What license does GuardGit MCP use?

It is available under GNU AGPL-3.0, with a separate commercial license for proprietary embedding and closed-source distribution.

Which MCP hosts are supported?

Configuration examples are given for Claude Desktop, Claude Code, Cursor and Antigravity, and the cockpit UI targets SEP-1865 capable hosts.

Is GuardGit MCP free?

Yes. GuardGit MCP is open source, so you can use and self-host it for free.

How do I add GuardGit MCP to Claude Code?

Run this command in your terminal: claude mcp add guardgit-mcp -- npx -y guardgit-mcp

What are the best alternatives to GuardGit MCP?

The closest alternatives to GuardGit MCP are Ci Guard MCP, Git MCP, Code Guard MCP, Agent Guard MCP and Guard.

Where this comes from

  • Description: written from the project's README, the project's website and its MCP Registry entry.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers