# AI Firewall MCP [Health: Active]

**Category:** 🔒 Security  
**Repository:** https://github.com/Akhilucky/AI-firewall  
**GitHub Stars:** 1  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/ai-firewall-mcp

## Description
Multi-agent LLM security layer detecting prompt injection and jailbreaks.

## Tools
Capabilities this server exposes over MCP:

- **analyze_prompt** — Analyze a prompt for injection, jailbreaks, exfiltration, and leakage
- **get_threat_breakdown** — Detailed per-signal scoring breakdown from the last analysis
- **sanitize_prompt** — Clean a suspicious prompt while preserving legitimate content
- **get_firewall_status** — Health check: vector DB size, model status, uptime
- **benchmark_firewall** — Run the adversarial test suite and return detection statistics

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "ai-firewall-mcp": {
    "command": "uvx",
    "args": ["ai-firewall-mcp"],
    "env": {
      "FIREWALL_MODE": "",
      "SIMILARITY_THRESHOLD": "",
      "LOG_LEVEL": ""
    }
  }
}
```

**Requires environment variables:** `FIREWALL_MODE`, `SIMILARITY_THRESHOLD`, `LOG_LEVEL` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## 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:

```bash
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.

_Full upstream README: https://allmcps.com/mcp/ai-firewall-mcp/readme_

