AI Firewall MCP logo

AI Firewall MCP

Screens prompts for injection, jailbreaks, exfiltration, leakage, and policy violations through five MCP tools.

Install AI Firewall MCP

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "ai-firewall-mcp": {
      "command": "uvx",
      "args": [
        "ai-firewall-mcp"
      ],
      "env": {
        "FIREWALL_MODE": "YOUR_VALUE_HERE",
        "SIMILARITY_THRESHOLD": "YOUR_VALUE_HERE",
        "LOG_LEVEL": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx ai-firewall-mcp

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked .

Overview

AI Firewall MCP MCP server evaluates prompts for injection, jailbreaks, exfiltration, leakage, and policy violations. Its stdio MCP server exposes analysis, threat scoring, sanitization, status, and benchmarking tools to compatible clients. A retrieval agent searches known attack patterns with FAISS and sentence-transformers, while guard and policy agents score signals and choose ALLOW, BLOCK, or SANITIZE. Reach for it when an MCP client or LLM workflow needs prompt screening before processing input.

Use cases

  • Screen prompts before sending them to an LLM
  • Inspect threat signals from the latest analysis
  • Sanitize suspicious user input
  • Check firewall health and model status
  • Run adversarial detection benchmarks

Key features

  • Prompt injection and jailbreak analysis
  • Exfiltration and leakage detection
  • Threat signal breakdowns
  • Suspicious prompt sanitization
  • Firewall health checks
  • Adversarial test benchmarking

Tools5

What AI Firewall MCP lets your agent do. Expand a tool for its parameters.

Self-reported~97 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

20/21 checks healthy over the last 94d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · ai-firewall-mcp (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

Last commit5mo agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Tools exposed5Callable tools this server registers over MCP.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

How AI Firewall MCP works

What AI Firewall MCP MCP server does

AI Firewall MCP MCP server adds a prompt-screening layer to MCP-compatible clients. It evaluates input for prompt injection, jailbreak attempts, exfiltration, leakage, and policy violations, then supports three possible policy outcomes: ALLOW, BLOCK, or SANITIZE. The server is distributed as a Python package and Docker image and communicates over stdio.

The project is suited to workflows that need to inspect suspicious prompts before passing them to an LLM. It also provides operational checks and an adversarial benchmark, so developers can inspect the running firewall and review detection statistics.

How it works

Each prompt passes through three agents. The retrieval agent performs semantic matching against known attack patterns using FAISS and sentence-transformers. The guard agent combines vector similarity, keyword matching, and heuristic scoring into threat signals. The policy agent applies configured thresholds to make the final decision.

The documented signal weights are 40% vector similarity, 25% keyword matching, 20% heuristic scoring, and 15% policy weight. SIMILARITY_THRESHOLD controls the vector-match cutoff; a lower value makes matching stricter. The available firewall modes are strict, moderate, and permissive.

Setup and configuration

Install the package with pip install ai-firewall-mcp, then start it with ai-firewall-mcp. Docker users can pull akhilucky/ai-firewall-mcp:latest and run it with an interactive standard-input connection:

Terminal
docker pull akhilucky/ai-firewall-mcp:latest
docker run -i akhilucky/ai-firewall-mcp:latest

Configure the resulting stdio server in an MCP client. The README provides examples for Claude Desktop and setup guidance for Cursor, Windsurf, Cline, and Roo Code. The package can also be tested with MCP Inspector using npx @modelcontextprotocol/inspector ai-firewall-mcp.

Configuration uses three environment variables. FIREWALL_MODE defaults to strict and accepts strict, moderate, or permissive. SIMILARITY_THRESHOLD defaults to 0.50, and LOG_LEVEL defaults to INFO.

Tools and capabilities

The AI Firewall MCP MCP server exposes five tools:

  • analyze_prompt checks a prompt for injection, jailbreaks, exfiltration, and leakage.
  • get_threat_breakdown returns per-signal scoring details from the latest analysis.
  • sanitize_prompt cleans suspicious input while retaining legitimate content.
  • get_firewall_status reports vector database size, model status, and uptime.
  • benchmark_firewall runs the adversarial test suite and returns detection statistics.

The repository also documents optional command-line and REST API entry points. Running the API requires the api package extra and serves at http://localhost:8000, with OpenAPI documentation at /docs.

Limitations and notes

The MCP package uses stdio transport, so client configuration must launch the process or Docker container accordingly. The documented Docker image is CPU-only and approximately 2.04 GB. Benchmark results therefore need to be evaluated for the intended deployment.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about AI Firewall MCP

AI Firewall MCP is an MCP server that connects MCP-compatible clients to a multi-agent LLM security layer. Its main tools analyze prompts, expose threat breakdowns, sanitize suspicious input, report firewall status, and run adversarial benchmarks for detecting prompt injection, jailbreaks, exfiltration, leakage, and policy violations.

Install it with `pip install ai-firewall-mcp` and start `ai-firewall-mcp`, or run the published Docker image with `docker run -i akhilucky/ai-firewall-mcp:latest`. The README also provides stdio configuration examples for MCP clients.

Yes, AI Firewall MCP works with Cursor through an stdio MCP configuration. Set the command to `docker run -i akhilucky/ai-firewall-mcp:latest`, or use `ai-firewall-mcp` when the package is installed with pip.

It combines semantic retrieval, keyword matching, and heuristic scoring. A retrieval agent searches FAISS-based attack patterns, a guard agent produces threat signals, and a policy agent selects ALLOW, BLOCK, or SANITIZE using configured thresholds.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewAI Firewall MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ai-firewall-mcp?style=directory)](https://allmcps.com/mcp/ai-firewall-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/ai-firewall-mcp"><img src="https://allmcps.com/api/badge/ai-firewall-mcp?style=directory" alt="AI Firewall MCP on AllMCPs" /></a>