GuardGit MCP

v1.0.3
io.github.Hessam-Mamagani/guardgit-mcp Checked 4 hours ago Published 1 day ago

Pre-commit secret guard, structural JSON diff, merge-tree conflict & atomic commit SEP-1865 MCP App

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

open_guardgit_cockpit GuardGit Cockpit

Launch the interactive SEP-1865 visual GuardGit Cockpit UI for a human user needing an all-in-one repository health dashboard. Use ONLY when the user asks to open the visual cockpit or wants a combined full-repo pre-commit report; do NOT call this for automated or single-purpose checks — use scan_precommit_guard, diff_structural_json, analyze_blast_radius, or plan_atomic_commits instead. Strictly read-only (atomic commit planning never runs git commit). Invocation renders the UI resource and returns a combined text summary plus structured guard, blastRadius, atomicPlan, and jsonDiff snapshot…

ParameterTypeDescription
jsonFilePathstringOptional JSON file relative path to diff against HEAD.
repoPathstringAbsolute or relative path to the Git repository. Defaults to current working directory.
targetBranchstringTarget branch for read-only git merge-tree conflict dry-run (e.g. main, origin/main).

scan_precommit_guard Pre-Commit Secret & Artifact Guard

Run first in a pre-commit workflow (before plan_atomic_commits) and prefer over open_guardgit_cockpit whenever only secret, credential, or artifact detection is needed. Mode selection: scans in-memory files if provided, else raw unified diff if provided, else live repoPath (default cwd). Detects .env files, cloud/LLM API keys, JWTs, private keys, high-entropy secrets, large/binary blobs, DBs, and build artifacts. Verdict thresholds: PASS (riskScore < 15, zero critical/high/medium), WARN (high/medium or score >= 15; review first), BLOCK (any critical finding or score >= 60; halt commit/push and…

ParameterTypeDescription
allowedPathsarrayOptional allowlisted relative paths to skip.
diffstringOptional raw unified diff text to scan in memory.
filesarrayOptional array of files and contents to scan in memory.
includeUntrackedbooleanInclude untracked files in repository scans (default: true).
largeFileThresholdBytesintegerLarge blob warning threshold in bytes (default: 1048576 = 1 MiB).
repoPathstringRepository path to scan (read-only). Defaults to current working directory if diff and files are omitted.

diff_structural_json Structural JSON Diff Engine

Prefer this focused tool over open_guardgit_cockpit whenever you only need to compare JSON files or payloads (do not use for non-JSON source diffs). Mode selection: pass both oldJson and newJson for inline payload diffing; OR pass filePath (with optional repoPath and baseRef, default HEAD) to diff a tracked repository JSON file; OR pass {} to auto-diff the first modified .json file in repoPath (falls back to a demo sample if none). Strictly read-only; returns byte stats, semantic diff nodes (truncated to maxNodes / max 150 in structured output), breakingChanges flagged with breaking and breaki…

ParameterTypeDescription
baseRefstringGit ref for the baseline blob (default: HEAD).
filePathstringLabel or repository-relative JSON path (e.g. package.json, tsconfig.json, locales/tr.json).
maxNodesintegerMaximum semantic diff nodes to return (default: 200).
newJsonstringUpdated JSON text.
oldJsonstringBaseline JSON text.
repoPathstringRepository path when diffing a tracked JSON file against baseRef.

analyze_blast_radius Blast-Radius & Merge-Tree Conflict Advisor

Prefer this focused tool over open_guardgit_cockpit whenever you only need change-impact risk scoring or merge-conflict prediction (not secret scanning or commit splitting). On a Git repo, blast-radius scoring across sensitive paths (auth, migrations, CI/CD, API contracts, config) and the strictly read-only in-memory git merge-tree --write-tree dry-run against targetBranch always run together with zero working-tree mutations; passing synthetic files scores those in memory instead of reading working-tree status. Returns 0-100 score, band (LOW/MODERATE/HIGH/CRITICAL), directory heatmap, sensitiv…

ParameterTypeDescription
filesarrayOptional synthetic file metrics for in-memory blast-radius scoring.
repoPathstringGit repository path. Defaults to current working directory.
sourceRefstringSource Git ref for dry-run merge (default: HEAD).
targetBranchstringTarget branch for merge-tree conflict check (auto-detects origin/main or main if omitted).

plan_atomic_commits Atomic Commit Splitter

Prefer this focused tool over open_guardgit_cockpit whenever you only need to organize working-tree changes into clean commits (typically run after scan_precommit_guard). Strictly read-only: generates a proposed Conventional Commit plan without running git add or git commit. Groups staged/unstaged repoPath changes (or synthetic in-memory files) into ordered groups while automatically withholding blocked secrets and artifacts when excludeRisky is true (default). Returns ordered groups (suggestedMessage, rationale, files, copyable stageCommands), excludedRiskyFiles, and summaryNote.

ParameterTypeDescription
excludeRiskybooleanAutomatically withhold blocked secret/artifact files (default: true).
filesarrayOptional in-memory list of changed files to split.
repoPathstringGit repository path. Defaults to current working directory.