Deterministic MCP guardrail that reviews changed lines for security and structural risks without using LLM tokens.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
One-click editor setup isnβt available for this listing yet β we donβt have a confirmed install command, and weβd rather show nothing than point your editor at the wrong package or host. Follow the projectβs own setup instructions, linked above.
Inspect callable tools, capabilities, and parameters exposed to AI agents by Diffgate.
diffgate_analyzeAnalyze a file for code review findings. Only flags risk on lines changed vs the git baseline (diff-aware). Pass `content` to analyze unsaved or generated code before it is written to disk. When a code graph is available, public-surface findings carry an `impact` field (caller count, suggested reviewers, test gaps) and may be tier-adjusted β fix high-blast-radius findings before surfacing the code.
diffgate_check_stagedCheck all staged (or working-tree) changes in a git repo for DiffGate findings. Returns overall tier, counts, and per-file findings across the whole diff, plus a `verdict` block (the agent autonomy ladder: pass/review/blocked overall, with a rung β block/escalate/autofix/advisory β per finding) so you can decide whether to surface the diff without reimplementing the rules.
diffgate_deep_reviewRun an agentic deep review on a single high-impact (orange) finding. The model uses real repo tools (grep, read_file, find_references, git_blame) to investigate blast radius before rendering a verdict.
diffgate_explainGet a concise AI explanation for a DiffGate finding. Faster than diffgate_deep_review β a single LLM call with no tool loops.
diffgate_capabilitiesReport which DiffGate layers are active (core / code graph / LLM), which tools you can call right now without an error, and the agent autonomy budget (fix limit, escalation, trust source). Call this once up front so you know what's available instead of discovering it via thrown errors.
diffgate_guidelinesReview the diff against the repo's own coding guideline files (AGENTS.md, CLAUDE.md, .cursorrules, etc.), scoped per directory (nearest file wins). IMPORTANT: if the result has mode='host', NO external model was used β this is a SELF-REVIEW, not an independent gate: YOU (the calling agent) evaluate each group's `hunks` against its `guidelines` text using your own model. Treat host-mode results as ADVISORY only β never block the change on them. If mode='model', findings were produced by the configured provider and are returned directly.
A deterministic guardrail your coding agent runs on itself β before the code reaches your disk.
Every other check fires too late. A review bot needs a PR. A pre-commit hook runs after the agent has finished and moved on. DiffGate is an agent hook: your agent calls it over MCP, gets back structured findings in milliseconds for zero LLM tokens, and fixes the problem while it still has the context β then the same engine, same verdict runs in your editor, your pre-commit hook, and CI. Not a model grading its own homework: the same input always produces the same answer.
It stays quiet by construction. It grades only the lines that changed (π’ merge Β· π‘ glance Β· π verify), runs your tests only when a change earns it, and blocks only when it's earned β 0 false blocks on a public, versioned corpus you can rerun yourself with diffgate bench (BENCHMARK.md). Everyone claims low noise; this one ships the corpus.
Across local and frontier models: 0% classic OWASP bugs (SQL injection, XSS, hardcoded secrets) in code written from scratch. But the same frontier model that wrote flawless greenfield code reintroduced security footguns in 13% of edits β an unguarded recursive merge (prototype pollution), a bare cors() (any origin), a path built from request data with no containment check. Editing existing code is most of what an agent does, and the residue lives in the diff, not in the textbook. Rerun it yourself with diffgate marginal. The measurement β
The same shift shows up in third-party maintainability data: GitClear's 2026 analysis finds block duplication up 81% since 2023 (40.3 β 73.0 per million changed lines) and cross-file function connectivity down 35% β agents reinvent code rather than reuse it. That's what the reinvented-helper rule is for (docs/STRUCTURAL-RULES.md).

| Tier | Meaning | What you do | Examples |
|---|---|---|---|
| π’ Green | Safe / self-contained | merge freely | comments, local logging |
| π‘ Yellow | Review (soft dependency) | take a look | deprecated APIs, raw SQL, network calls, dependency edits |
| π Orange | High-impact, gate it | verify before merge | schema/migrations, hardcoded secrets, auth/crypto, public-API changes, injection sinks |
Every check in the pipeline fires after the code exists, and each one is later than the last:
| Fires when | Problem | |
|---|---|---|
| Review bot (CodeRabbit, Greptile) | a PR exists | the code is finished, defended, and someone is waiting on it |
| Pre-commit hook | you're done and committing | the agent has moved on; you're re-loading context to fix it |
| DiffGate over MCP | the agent is still writing | it fixes its own output before the code lands |
Being early is not the only thing that matters, though β it has to be quiet, or the agent learns to ignore it. Review bots comment after the PR exists; linters and scanners flag everything they see. Neither guarantees the risky line gets discussed: we scanned 350 merged AI-assisted PRs β of the 109 with flagged AI-attributed changes, only 3 drew public discussion from any human besides the author. DiffGate decides what deserves your attention, your tests, or a block, and stays quiet otherwise. That's the whole product:
testCommand and shows the real exit code and output. Green and yellow pass instantly. The pre-commit hook is fast because tests fire only when a change is genuinely high-impact.diffgate bench runs a versioned corpus offline: 100% precision / 0 false blocks on clean changes. Reproduce it yourself β that's the point of shipping the corpus. See BENCHMARK.md.The 0% / 13% numbers aren't a marketing line β they come from a scripted experiment (four models from local to frontier, greenfield vs. edit mode, Wilson confidence intervals) that you can rerun with diffgate marginal. Methodology, per-model tables, and caveats: docs/MEASUREMENT.md. DiffGate's security rules are tuned to that measured residue, not to maximizing rule count.
No git history or uncommitted changes yet? See the output on bundled examples first:
The highest-leverage spot: the agent self-checks generated code before it's written to disk, gets back structured findings (zero LLM tokens), and surfaces what it corrected (original + fix + why) instead of silently rewriting. A trustworthy, deterministic self-check is what makes it safe to grant the agent more autonomy.
Or one-click in Claude Desktop: download diffgate.mcpb and open it. The server also exposes prompts and resources; see MCP.md.
Inline squiggles on changed lines, hover cards (why Β· who owns it Β· quick-fix), a Risk Review tree, a status-bar summary, and Deep Review (agentic blast-radius analysis for orange findings). The same verdict you'd get from the CLI, on the diff you're reviewing.
Install from the VS Code Marketplace or Open VSX (Cursor / Windsurf / Gitpod).
diffgate check reviews your diff and exits non-zero on high-impact findings: a pre-commit hook locally, the same gate in your pipeline.
The local loop is the wedge β fix while the context is fresh β and the same engine runs as a PR gate so the verdict carries to where it's enforced for the whole team. See docs/TEAM.md for the GitHub Action, shared learnings, and org policy packs. CI runs can optionally layer an external scanner (Semgrep) through the same gate for broader language coverage β advisory-only, off by default (docs/CONFIG.md).
Common commands:
Factual signals from GitHub, npm, and our automated checks β not a rating.
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/srbsa-diffgate)<a href="https://allmcps.com/mcp/srbsa-diffgate"><img src="https://allmcps.com/api/badge/srbsa-diffgate?style=directory" alt="Diffgate on AllMCPs" /></a>