npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

guardgit-mcp

v1.0.1

Published

Pre-commit DevSecOps safety net, structural JSON diff engine, read-only git merge-tree blast-radius advisor, and atomic commit splitter delivered as a SEP-1865 MCP App and CLI.

Readme

GuardGit MCP

Pre-Commit DevSecOps Safety Net & Structural Diff Cockpit for Autonomous AI Coding Agents

GuardGit MCP is an open-source (GNU AGPL-3.0, with Commercial Dual-Licensing available), zero-mutation SEP-1865 MCP App and CLI (npx guardgit-mcp) that protects repositories from the four most common failure modes of autonomous AI coding agents:

  1. Secret & Artifact Leakage (scan_precommit_guard): Catches .env files, AWS/OpenAI/Anthropic/GitHub/Stripe/Cloudflare/Google/Slack/npm tokens, JWTs, PEM private keys, database credentials, high-entropy assignments, large/binary blobs (>1 MB configurable), SQLite files, and build artifacts (node_modules/, dist/, .next/, *.vsix, *.db) — returning a 0-100 risk score, PASS / WARN / BLOCK verdict, redacted previews, .gitignore blocks, and copyable git rm --cached remediation commands.
  2. Unreadable Minified/Large JSON Diffs (diff_structural_json): Replaces 10,000-character single-line diffs in package.json, tsconfig.json, lockfiles, i18n locale dictionaries (en.json, tr.json), and Terraform/Kubernetes JSON with semantic key-level trees, keyed array matching, bulk-shift noise suppression, and automatic breaking-change flags.
  3. Blind Force-Pushes & Merge Surprises (analyze_blast_radius): Computes directory-level blast-radius heatmaps across sensitive surfaces (auth/RBAC, migrations, CI/CD, API contracts, runtime config) and executes strictly read-only, in-memory git merge-tree --write-tree conflict dry-runs against your target branch with zero working-tree mutations.
  4. 40-File AI Mega-Commits (plan_atomic_commits): Withholds blocked secrets/artifacts and groups safe changes into logically ordered Conventional Commits (build, ci, chore, feat, fix, refactor, test, docs) with ready-to-run staging commands.

Architecture

flowchart LR
    Host["MCP Host (Antigravity / Claude / Cursor / VS Code)"] <-->|"JSON-RPC stdio"| Server["GuardGit MCP Server (src/server.ts)"]
    Server -->|"ui://guardgit/cockpit.html (singlefile)"| UI["SEP-1865 Cockpit UI (iframe)"]
    UI <-->|"postMessage + @modelcontextprotocol/ext-apps"| Host
    Server --> Core["Pure TypeScript Core (src/core)"]
    Core --> G1["guardScan (Secrets + Entropy + Artifacts)"]
    Core --> G2["structuralJsonDiff (Key/Array Tree + Breaking Flags)"]
    Core --> G3["blastRadius + git merge-tree (Read-Only Dry Run)"]
    Core --> G4["planAtomicCommits (Conventional Commit Splitter)"]
    CLI["CLI (npx guardgit-mcp)"] --> Core

Quickstart

1. Run as an MCP Server (stdio)

npx guardgit-mcp

2. Run Directly in Terminal or CI Pre-Commit Hooks

# Scan working tree & staged diffs (exits code 2 on BLOCK with --strict)
npx guardgit-mcp scan . --strict

# Semantic JSON diff between two files (or git HEAD vs working tree)
npx guardgit-mcp diff old.json new.json
npx guardgit-mcp diff --repo . --file package.json --base HEAD

# Blast-radius score + read-only git merge-tree conflict dry-run
npx guardgit-mcp blast . --target main

# Generate an atomic Conventional Commit split plan
npx guardgit-mcp plan .

Host Configuration

Antigravity (Native SEP-1865 Plugin with Side Pane & Sidebar)

Build and copy the self-contained plugin bundle:

npm install
npm run build
cp -R ./plugin ~/.gemini/config/plugins/guardgit-mcp

PowerShell:

npm install; npm run build
Copy-Item -Recurse -Force ".\plugin" "$HOME\.gemini\config\plugins\guardgit-mcp"

Open GuardGit Cockpit directly from the side pane (+ menu) or the left sidebar.

Claude Desktop / Claude Code

Add to claude_desktop_config.json or .mcp.json:

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

Cursor

Add to .cursor/mcp.json:

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

Exposed MCP Tools & UI Resource

  • UI Resource: ui://guardgit/cockpit.html (text/html;profile=mcp-app, prefersBorder: false, bundled single-file HTML with zero external CDN calls).
  • open_guardgit_cockpit: Runs the full repo health overview (Guard + Blast Radius + Atomic Split + modified JSON detection) and opens the interactive cockpit (aux_pane and global entrypoints).
  • scan_precommit_guard: Scans a repository path, raw unified diff, or in-memory file array for secrets, high-entropy assignments, large blobs, binaries, and build artifacts.
  • diff_structural_json: Computes a semantic key/array diff with breaking-change flags on two JSON strings or a tracked Git file vs HEAD.
  • analyze_blast_radius: Scores commit blast radius (0-100), renders a folder-level heatmap, and runs a read-only git merge-tree --write-tree conflict dry-run.
  • plan_atomic_commits: Splits staged/unstaged changes into ordered Conventional Commits while automatically excluding blocked secrets and artifacts.

All tool arguments are optional; invoking any tool with {} returns a complete default view for the current working directory.

Development & Testing

npm install
npm run build
npm test

Security & Privacy

  • 100% local & read-only: GuardGit never pushes, checks out, resets, or mutates your working tree, and makes zero network requests.
  • Automatic redaction: Detected secret tokens are masked (sk-a***...***9f2a) before returning tool results so raw credentials are never echoed into LLM conversation logs.

License (Dual-Licensed: GNU AGPL-3.0 + Commercial)

  • Open-Source License (Free): Copyright (c) 2026 Hessam Mamagani. Licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) — see LICENSE. Free for personal, open-source, and local developer CLI/MCP usage. Any modified or network-hosted derivative must remain open-source under AGPL-3.0 with original copyright attribution.
  • Commercial / Enterprise License: Organizations or developers wishing to embed GuardGit MCP inside proprietary/closed-source software, distribute modified closed-source derivatives, or license enterprise Pro integrations can obtain a commercial license — see COMMERCIAL_LICENSE.md.