AI Firewall MCP

Official registry Security

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

Install

Add this to your client's MCP configuration (Claude Desktop: claude_desktop_config.json; Cursor: .cursor/mcp.json; VS Code and others use the same "mcpServers" shape).

PYPI package ai-firewall-mcp
Claude Code
claude mcp add ai-firewall-mcp -- uvx ai-firewall-mcp==1.0.1
JSON configuration (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "ai-firewall-mcp": {
            "command": "uvx",
            "args": [
                "ai-firewall-mcp==1.0.1"
            ]
        }
    }
}

Documentation

From the project's README on GitHub, refreshed weekly. Links open on GitHub.

Contents
  1. AI Firewall — MCP Server
  2. Quick Start
  3. MCP Tools
  4. Architecture
  5. Configuration
  6. CLI / API Usage
  7. Testing
  8. Project Structure
  9. License

GitHub • PyPI • Docker Hub

<mcp-name: io.github.Akhilucky/ai-firewall-mcp>

AI Firewall — MCP Server

A multi-agent AI security layer that protects LLMs from prompt injection, jailbreaks, and policy violations. Available as an MCP server for any MCP-compatible client (Claude Desktop, Cursor, Windsurf, Cline, Roo Code, etc.).

Quick Start

pip install
pip install ai-firewall-mcp
ai-firewall-mcp
Docker
docker pull akhilucky/ai-firewall-mcp:latest
docker run -i akhilucky/ai-firewall-mcp:latest
Claude Desktop

Add to claude_desktop_config.json:

pip install:

{
  "mcpServers": {
    "ai-firewall": {
      "command": "pipx",
      "args": ["run", "ai-firewall-mcp"]
    }
  }
}

Docker:

{
  "mcpServers": {
    "ai-firewall": {
      "command": "docker",
      "args": ["run", "-i", "akhilucky/ai-firewall-mcp:latest"]
    }
  }
}
Cursor / Windsurf / Cline / Roo Code

Configure in your MCP settings with:

  • Type: stdio
  • Command: docker run -i akhilucky/ai-firewall-mcp:latest
  • Or use ai-firewall-mcp if installed via pip

MCP Tools

ToolDescription
analyze_promptAnalyze a prompt for injection, jailbreaks, exfiltration, and leakage
get_threat_breakdownDetailed per-signal scoring breakdown from the last analysis
sanitize_promptClean a suspicious prompt while preserving legitimate content
get_firewall_statusHealth check: vector DB size, model status, uptime
benchmark_firewallRun the adversarial test suite and return detection statistics
Testing with MCP Inspector
npx @modelcontextprotocol/inspector ai-firewall-mcp

Architecture

The firewall runs three agents per prompt:

User Prompt → [Retrieval Agent] → [Guard Agent] → [Policy Agent] → LLM
                   │                    │               │
                   ▼                    ▼               ▼
              Vector DB (FAISS)    Threat Signals    Allow/Block
AgentRole
Retrieval AgentSemantic search against known attack patterns (FAISS + sentence-transformers)
Guard AgentMulti-signal classification: vector similarity, keyword match, heuristic scoring
Policy AgentFinal decision: ALLOW / BLOCK / SANITIZE based on configurable thresholds

Threat signals are weighted: 40% vector similarity, 25% keyword match, 20% heuristic, 15% policy weight.

Configuration

Env VarDefaultDescription
FIREWALL_MODEstrictstrict / moderate / permissive
SIMILARITY_THRESHOLD0.50Vector match threshold (lower = stricter)
LOG_LEVELINFOLogging verbosity

CLI / API Usage

# Interactive dashboard
python main.py

# Red-team adversarial tests
python main.py --redteam

# REST API server
python main.py --api

# Single prompt analysis
python main.py --analyze "Ignore all previous instructions"

The REST API runs at http://localhost:8000 with OpenAPI docs at /docs (requires pip install ai-firewall-mcp[api]).

Testing

pytest tests/ -v          # Full test suite (43 tests)
pytest tests/test_mcp.py  # MCP-specific tests only

Project Structure

├── src/ai_firewall/          # MCP server package (PyPI entry)
│   ├── mcp_server.py         #    5 MCP tools, stdio transport
│   ├── threat_scorer.py      #    Per-signal scoring breakdown
│   └── __init__.py
├── src/agents/               # Core firewall agents
├── tests/                    # Test suites
├── Dockerfile                # Docker image (2.04GB, CPU-only torch)
├── pyproject.toml            # Package config & metadata
└── .github/workflows/ci.yml  # CI/CD pipeline

License

MIT — see LICENSE.


Built for security. Designed for production.

Frequently asked questions

What is AI Firewall MCP?

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

How do I install AI Firewall MCP?

It runs on your machine. In Claude Code: claude mcp add ai-firewall-mcp -- uvx ai-firewall-mcp==1.0.1. For other clients, paste the JSON configuration from this page into their MCP settings.

Does AI Firewall MCP need an API key?

Its registry entry lists no required key or secret. Some features may still need an account with the service it connects to.

Is AI Firewall MCP open source?

Yes. Its code is on GitHub under the MIT license.

Who maintains AI Firewall MCP?

It is published by Akhilucky. AI.tn lists it but does not maintain or endorse it.

From the official MCP Registry. Listing is not an endorsement: review a server's code and permissions before giving it access to your data.