change-firewall
Analyzes Git diffs and working tree changes to produce behavior-aware change reports, blast-radius mappings, and deterministic risk scores.
Runs Change Firewall preflight checks in GitHub Actions workflows to enforce merge gates based on risk thresholds.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@change-firewallanalyze my current git diff and report behavioral changes and risk score"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
A local-first developer tool, CLI, and TypeScript engine that translates raw Git diffs into behavior-aware change reports, downstream blast-radius mapping, and deterministic risk scores (0โ100). Native Model Context Protocol (MCP) server for Claude, Antigravity, Cursor, and Windsurf.
๐ Table of Contents
Related MCP server: git-context-mcp
โ Why Use Change Firewall?
The Core Problem (Intent vs Consequences)
AI coding assistants (Cursor, Claude Code, GitHub Copilot, Devin, Antigravity) are rewriting software development. They can modify 20 files in under 5 seconds and report:
โ Authentication added
โ Tests passing
โ Build successfulThe summary tells you what the AI intended to do. It does not tell you:
What existing behavior secretly mutated?
What API response contracts silently broke for downstream consumers?
Which database models, routes, or callers depend on the changed code?
What permissions or security assumptions shifted?
Tests only verify what they were originally written to test. Standard Git diffs only show line additions and deletions (+1, -1), concealing architectural ripple effects.
Git Diff vs Change Firewall
Consider this innocent-looking change:
- return user;
+ return { user };Tool | What It Sees | Result |
Git Diff |
| Looks tiny and harmless. Developer approves PR. |
Change Firewall | ๐ด HIGH RISK: API Response Contract Mutatedโข Endpoint: | Catches the breaking change before staging or production crashes! |
๐ Quick Start (Zero Install)
You do not need an account, an API key, or a cloud server. Run Change Firewall directly in any JavaScript or TypeScript Git repository:
npx change-firewallOr analyze changes and open the interactive visual browser dashboard in one step:
npx change-firewall --open๐ฆ Installation Options
Option A: Zero-Install (npx โ Recommended)
Always runs the latest version on demand without polluting node_modules:
npx change-firewallOption B: Local Project Dependency
Install in your project to pin versioning for your team:
npm install --save-dev change-firewall
# or
pnpm add -D change-firewall
# or
yarn add -D change-firewallAdd convenience scripts to your package.json:
{
"scripts": {
"firewall": "change-firewall",
"firewall:watch": "change-firewall watch",
"preflight": "change-firewall preflight",
"dashboard": "change-firewall open"
}
}Option C: Global Installation
npm install -g change-firewall
change-firewall๐ ๏ธ CLI Command Reference & Flags
1. change-firewall (Default Analysis)
Analyzes uncommitted changes in your Git working tree.
# Standard terminal report
npx change-firewall
# Analyze and automatically open browser dashboard (http://localhost:4783)
npx change-firewall --open
# Analyze only staged changes (git add)
npx change-firewall --staged
# Compare against a specific base branch or commit (e.g., origin/main)
npx change-firewall --base origin/main
# Output machine-readable JSON (great for AI agents or scripts)
npx change-firewall --json
# Run dashboard on a custom port
npx change-firewall --open -p 5000Flags:
Flag | Description | Default |
| Opens local browser dashboard automatically |
|
| Outputs report as raw JSON |
|
| Only inspect staged changes |
|
| Base commit or branch to compare against |
|
| Dashboard port |
|
2. change-firewall preflight (Merge Gate)
Evaluates whether current code changes are safe to merge. Enforces strict exit codes for CI/CD gates.
Exit Code
0: Approved / Safe to merge.Exit Code
1: Blocked / Merge review required.
# Standard preflight gate (fails if risk > 60 or high-risk findings exist)
npx change-firewall preflight
# Set a custom risk score threshold (0-100)
npx change-firewall preflight --max-risk 75
# Ignore high severity findings if overall score is below threshold
npx change-firewall preflight --no-fail-on-high
# Compare PR against base branch in CI
npx change-firewall preflight --base origin/main
# Emit JSON result for CI parsing
npx change-firewall preflight --jsonFlags:
Flag | Description | Default |
| Max acceptable risk score before blocking |
|
| Do not block solely on HIGH severity findings |
|
| Base branch/commit to diff against |
|
| Evaluate staged changes only |
|
| Output preflight result as JSON |
|
3. change-firewall watch (Live Monitoring)
Runs in the background while you or an AI agent (Cursor, Claude Code, Copilot, Antigravity) edit code:
Automatically debounces rapid file modifications (350ms).
Re-analyzes deltas on the fly (
Risk changed: 42 โ 68).Live-streams updates to your browser dashboard via Server-Sent Events (SSE) without page reloads.
# Start watch mode with auto-opened dashboard
npx change-firewall watch
# Watch mode on custom port without auto-opening browser
npx change-firewall watch -p 8080 --no-open4. change-firewall impact <file> (Blast Radius)
Performs deep blast-radius tracing for a specific file across the codebase.
npx change-firewall impact src/middleware/auth.tsWhat It Displays:
Direct dependents list (1 hop away).
Transitive / indirect downstream consumers (2โ3 hops away).
Protected API routes impacted.
Blast severity rating (
HIGH,MEDIUM,LOW).
5. change-firewall why <file> (Architectural Role)
Explains why a file matters to the system architecture and its historical stability.
npx change-firewall why src/services/userService.tsWhat It Displays:
Architectural role (Authentication Middleware, Public Route, Service, Model, Test Suite).
Caller count & downstream consumers.
Git Churn analysis: total historical commits, high-churn warnings, unique contributors, and recent commits.
6. change-firewall open (Dashboard Server)
Spins up the embedded local dashboard at http://localhost:4783 loaded with the current working tree analysis.
npx change-firewall open7. change-firewall demo (Simulation Mode)
Launches an interactive simulation of the Golden Moment scenario without requiring any uncommitted Git changes. Great for exploring the tool and dashboard features immediately:
npx change-firewall demo8. change-firewall mcp (Model Context Protocol)
Starts the native Model Context Protocol (MCP) server over standard I/O (stdio). This exposes Change Firewall as native tools and prompts to AI assistants like Claude Desktop, Google Antigravity, Cursor, and Windsurf.
npx change-firewall mcpExposed MCP Tools:
analyze_changes: Performs AST behavioral diffing, caller blast radius mapping, and deterministic risk scoring (0โ100).evaluate_preflight: Determines whether current changes are safe to merge, blocking on high-risk mutations.compute_blast_radius: Inspects direct consumers, indirect dependents, and affected routes for a specific file.explain_file_impact: Explains architectural role (middleware, route, service, model), historical git churn, and callers.
Exposed MCP Prompts:
change_firewall_audit: Guided prompt for agents to audit diffs and propose self-corrections before committing.
๐ป Programmatic Node.js / TypeScript API
Change Firewall exports a fully-typed JavaScript / TypeScript API for use in your custom tools, scripts, testing suites, or backend servers.
import {
analyzeChanges,
evaluatePreflight,
computeBlastRadius,
buildDependencyGraph,
startWatchMode,
} from 'change-firewall';1. analyzeChanges()
Runs full behavioral analysis, AST diffing, and risk scoring on the repository.
import { analyzeChanges } from 'change-firewall';
async function run() {
const report = await analyzeChanges({
cwd: process.cwd(), // Project root path (defaults to process.cwd())
// base: 'origin/main', // Base ref to compare against (defaults to HEAD)
// staged: false, // True to analyze only staged files
});
console.log(`Repository: ${report.repoName} (${report.branch})`);
console.log(`Risk Score: ${report.risk.score}/100 [${report.risk.level}]`);
console.log(`Files Changed: ${report.summary.totalFilesChanged}`);
console.log(`Behavioral Shifts: ${report.summary.behavioralChangeCount}`);
// Inspect specific behavioral findings
for (const finding of report.findings) {
console.log(`\n[${finding.severity}] ${finding.title}`);
console.log(`File: ${finding.filePath}`);
console.log(`Confidence: ${finding.confidence}%`);
console.log(`Evidence:`, finding.evidence);
console.log(`Recommendation: ${finding.recommendation}`);
}
}
run();2. evaluatePreflight()
Evaluates an analysis report against merge safety rules.
import { analyzeChanges, evaluatePreflight } from 'change-firewall';
async function checkMerge() {
const report = await analyzeChanges({ cwd: process.cwd() });
const preflight = evaluatePreflight(report, {
maxRisk: 60, // Maximum allowed risk score (0-100, default: 60)
blockOnHighRisk: true, // Block if any HIGH severity finding exists (default: true)
allowWarnings: true, // Allow medium/low warnings if risk <= maxRisk
});
if (preflight.readyToMerge) {
console.log('โ
Changes are safe to merge! Risk score:', preflight.riskScore);
process.exit(0);
} else {
console.error('โ MERGE BLOCKED:');
preflight.blockers.forEach((b) => console.error(` - ๐ ${b}`));
if (preflight.recommendations.length > 0) {
console.log('\nRecommendations:');
preflight.recommendations.forEach((r) => console.log(` - ๐ก ${r}`));
}
process.exit(1);
}
}
checkMerge();3. computeBlastRadius()
Calculates the downstream blast radius and caller hierarchy for any specific file.
import { buildDependencyGraph, computeBlastRadius } from 'change-firewall';
async function checkImpact(targetFilePath: string) {
// 1. Build project reverse import graph
const { reverse } = await buildDependencyGraph(process.cwd());
// 2. Traverse BFS up to 3 hops deep
const blast = computeBlastRadius(targetFilePath, reverse, 3);
console.log(`File: ${targetFilePath}`);
console.log(`Total Consumers Affected: ${blast.totalDependents}`);
console.log(`Direct Dependents:`, blast.directDependents);
console.log(`Indirect Dependents (2-3 hops):`, blast.indirectDependents);
if (blast.totalDependents > 5) {
console.warn(`โ ๏ธ High blast radius: ${blast.totalDependents} files depend on this!`);
}
}
checkImpact('src/services/auth.ts');4. startWatchMode()
Starts a debounced file watcher that serves live-streaming updates over SSE to the local dashboard.
import { startWatchMode } from 'change-firewall';
async function runLiveWatcher() {
const handle = await startWatchMode({
cwd: process.cwd(),
port: 4783, // Dashboard port
open: true, // Automatically open browser
debounceMs: 350, // Debounce delay for rapid edits
onUpdate: (report) => {
// Triggered whenever code is modified
console.log(`[${new Date().toLocaleTimeString()}] Tree updated!`);
console.log(`Risk Score: ${report.risk.score}/100`);
console.log(`Modified: ${report.diffs.map((d) => d.filePath).join(', ')}`);
},
});
console.log(`Watcher active on port ${handle.port}`);
// Clean shutdown
process.on('SIGINT', async () => {
await handle.stop();
process.exit(0);
});
}
runLiveWatcher();5. createMcpServer() / startMcpServer()
Embed or start the Model Context Protocol (MCP) server directly in your custom Node.js application or test harness:
import { createMcpServer, startMcpServer } from 'change-firewall';
// Option A: Start standard stdio MCP server for AI clients
await startMcpServer();
// Option B: Create McpServer instance for custom transports (e.g. SSE / testing)
const server = createMcpServer({ name: 'custom-firewall', version: '0.1.3' });๐ค AI Coding Agent Self-Correction Loop & MCP
Change Firewall provides two integration models for AI coding assistants:
Native Model Context Protocol (MCP): AI assistants directly discover and execute Change Firewall tools without needing raw terminal/shell access.
Direct Agent Instructions (CLI / JSON Mode): Terminal-enabled agents run Change Firewall CLI commands to verify and self-correct their own code.
๐ Model Context Protocol (MCP) Server Setup
Change Firewall exposes 4 native MCP tools (analyze_changes, evaluate_preflight, compute_blast_radius, explain_file_impact) and the change_firewall_audit prompt.
1. Claude Desktop
Add Change Firewall to your claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
{
"mcpServers": {
"change-firewall": {
"command": "npx",
"args": ["-y", "change-firewall", "mcp"]
}
}
}2. Google Antigravity
Add to your global configuration at ~/.gemini/config/mcp_config.json (or within your project's .agents/ plugin):
{
"mcpServers": {
"change-firewall": {
"command": "npx",
"args": ["-y", "change-firewall", "mcp"]
}
}
}3. Cursor & Windsurf
Navigate to Cursor Settings > Features > MCP (or Windsurf Settings).
Click + Add New MCP Server.
Fill in:
Name:
change-firewallType:
command(stdio)Command:
npx -y change-firewall mcp
๐ค Direct Agent Instructions (Claude Code, OpenAI Codex, Copilot)
For agents with terminal access (like Claude Code, Antigravity IDE, Cursor Agent, Aider, or OpenAI Codex / Copilot), you can instruct the agent to run Change Firewall as an automated self-correction loop.
Add the following rules to your repository's CLAUDE.md, AGENTS.md, GEMINI.md, or .cursorrules:
### Change Verification & Safety Protocol:
Before committing or completing any code change:
1. Run `npx change-firewall preflight --json` to evaluate merge safety.
2. If `readyToMerge` is false, inspect the `blockers` and `highRiskCount` in the output.
3. Automatically self-correct any breaking API contract mutations or missing test coverage.
4. For targeted inspection of affected callers, run `npx change-firewall impact <modified-file>`.Sample JSON Output (npx change-firewall analyze --json):
{
"risk": {
"score": 74,
"level": "HIGH"
},
"summary": {
"totalFilesChanged": 3,
"behavioralChangesCount": 1
},
"findings": [
{
"category": "API_CONTRACT",
"title": "API Response Contract Mutated",
"filePath": "src/controllers/user.ts",
"severity": "HIGH",
"confidence": 92,
"evidence": [
"Return statement modified: return user -> return { user }",
"7 client consumers depend on root-level User object structure."
],
"affectedFiles": [
"src/client/userClient.ts",
"src/views/profile.tsx"
],
"recommendation": "Update client response deserializers or revert wrapper."
}
]
}๐ CI/CD & GitHub Actions Integration
Add Change Firewall to your PR verification pipeline to prevent high-risk behavioral changes from merging.
Create .github/workflows/change-firewall.yml:
name: Change Firewall
on:
pull_request:
branches: [ main, master, develop ]
permissions:
contents: read
pull-requests: write
jobs:
verify-changes:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Full history needed to compare against base branch
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Run Preflight Check
run: npx change-firewall preflight --base origin/${{ github.base_ref }}๐ช Git Pre-Commit Hook (Husky)
Catch accidental API contract breaks or relaxed permissions before they are even committed to Git:
npx husky add .husky/pre-commit "npx change-firewall preflight --staged"If an AI tool breaks an API response contract or alters security middleware without adding tests, the commit is safely intercepted!
๐งช Real-World Behavioral Scenarios
Scenario | Code Change | What Change Firewall Detects |
API Contract Wrapper |
| Flags API_CONTRACT shift, lists all client callers, warns of runtime response shape mismatch. |
Auth Guard Relaxation |
| Flags AUTH shift, maps all affected downstream routes, checks for missing regression tests. |
Nullability Widening |
| Flags FUNCTION_CONTRACT widening, warns that downstream callers lack null checks. |
Validation Drift |
| Flags VALIDATION schema check, warns that previously accepted client payloads might now fail. |
Deleted Export |
| Flags CRITICAL deleted export, lists all files importing that symbol. |
๐ก๏ธ Architecture & Deterministic Guarantees
Unlike tools that rely on remote LLMs to "guess" what changed, Change Firewall is 100% deterministic and grounded in compiler truth:
+-----------------------+ +--------------------------+ +-------------------------+
| Working Tree Diff | --> | TypeScript AST Analysis | --> | Reverse Dependency Graph|
+-----------------------+ +--------------------------+ +-------------------------+
โ
โผ
+-------------------------+
| Deterministic Risk Score|
| (0 - 100) |
+-------------------------+In-Memory Git Dual-Tree Inspection: Directly compares your working tree files against
HEADin memory.Native TypeScript AST Diffing: Uses the official TypeScript Compiler API (
ts.createSourceFile) to inspect syntax trees, type signatures, return statements, and guard conditions.Static Reverse Dependency Graph: Scans project imports and builds a reverse caller graph using BFS traversal to pinpoint the exact blast radius.
Deterministic Risk Formula: Combines behavioral severity, downstream caller counts, and historical Git churn into a transparent 0โ100 score.
$$\text{Finding} + \text{Evidence} + \text{Blast Radius} + \text{Confidence} + \text{Actionable Recommendation}$$
๐ Privacy & Local-First Philosophy
๐ซ No API Keys Required โ Works completely offline.
๐ซ Zero Code Uploads โ Your source code never leaves your computer.
๐ซ Zero External AI Hallucinations โ Analysis is backed by real compiler syntax trees and Git history.
๐ป Self-Contained โ Dashboard is served locally at
http://localhost:4783with zero external dependencies.
๐ Links & Resources
Official Web App & Visual Simulator: change-firewall.vercel.app
Interactive Documentation & IDE: change-firewall.vercel.app/docs
NPM Package: npmjs.com/package/change-firewall
GitHub Repository: github.com/himanshYou2003/change-firewall
๐ License
MIT ยฉ Himanshu
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Deterministic context layer for your codebase: change impact, blast radius, answers with receipts.
Security reviews for coding agents: diffs checked against your org policy and live infrastructure.
A Model Context Protocol (MCP) application for automated GitHub PR analysis and issue management.โฆ
Code intelligence platform for AI agents. 20 tools for architecture, security & impact analysis.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides LLMs with code intelligence tools like relationship explanation, PR impact analysis, and health reports via the Model Context Protocol.3MIT
- FlicenseBqualityDmaintenanceProvides AI coding agents with structured Git repository context including project state, code structure, activity, and risk analysis without modifying or uploading code.53-
- FlicenseAqualityDmaintenanceProvides AI coding agents with dependency analysis, impact detection, and build verification tools.14-
- AlicenseAqualityCmaintenanceEnables AI agents to map cross-repository dependencies, detect breaking changes in API contracts, and assess impact across services.10MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/himanshYou2003/change-firewall'
If you have feedback or need assistance with the MCP directory API, please join our Discord server