Prototype · Preview: every server in the official registry, synced every 30 minutes. Reviews and accounts come in a later step.
PopNx MCPMCP servers for people who use AI · explained in plain words

Code Firewall MCP

by egoughnourversion 0.7.0i★ –iRuns on your computer
Registry nameio.github.egoughnour/code-firewall-mcp

Install

Overview

Description from the maker (original English)

Structural similarity-based code filter. Stops malicious code pattern reaching execution tools.

PopNx MCP’s three pillars

These three are never merged into one score: opinions, measurements and popularity are different things.

What you can do with it

We have not written a plain-language summary for this one yet. Below are the facts we read from the registry.

  • Connection: Runs on your computer
  • Transport: stdio
  • Category: Other

Install

Pick the AI app you use, then copy the settings.

Before you install

  • Basic checks: 1 of 1 passed
  • Runs on your computer with your user’s permissions (files, network, apps).
  • You fill in yourself: FIREWALL_DATA_DIR, OLLAMA_URL, EMBEDDING_MODEL, SIMILARITY_THRESHOLD

You need

  • PyPIPython’s uv installed (for the uvx command)

Which app do you use?

Pick your app above. We remember it, so next time the button says “Install in …”.

Download the maker’s .mcpb file

The link goes to the maker’s own file; we do not host or repackage it. Open the file and Claude Desktop installs it.

Run this in your terminal

claude mcp add code-firewall --env FIREWALL_DATA_DIR=your-value --env OLLAMA_URL=your-value --env EMBEDDING_MODEL=your-value --env SIMILARITY_THRESHOLD=your-value -- uvx code-firewall-mcp

Fill in the empty values before running it.

Open in Cursor

Or copy the settings yourself

Paste into .cursor/mcp.json in your project, or ~/.cursor/mcp.json

{
  "mcpServers": {
    "code-firewall": {
      "command": "uvx",
      "args": [
        "code-firewall-mcp"
      ],
      "env": {
        "FIREWALL_DATA_DIR": "your-value",
        "OLLAMA_URL": "your-value",
        "EMBEDDING_MODEL": "your-value",
        "SIMILARITY_THRESHOLD": "your-value"
      }
    }
  }
}

Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.

Open in VS Code

Or copy the settings yourself

Paste into .vscode/mcp.json in your project

{
  "servers": {
    "code-firewall": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "code-firewall-mcp"
      ],
      "env": {
        "FIREWALL_DATA_DIR": "your-value",
        "OLLAMA_URL": "your-value",
        "EMBEDDING_MODEL": "your-value",
        "SIMILARITY_THRESHOLD": "your-value"
      }
    }
  }
}

Your browser asks to open the app, then the app shows the settings and asks you to confirm. Key values are left empty for you to fill in.

This one runs on your computer, and ChatGPT can only connect to servers on the internet. Pick another app.

Your choice stays on this device in a cookie; no account needed.

Values you fill in

  • FIREWALL_DATA_DIR env
    Directory for storing ChromaDB data
  • OLLAMA_URL env
    URL for Ollama server (default: http://localhost:11434)
  • EMBEDDING_MODEL env
    Ollama embedding model (default: nomic-embed-text)
  • SIMILARITY_THRESHOLD env
    Block threshold 0-1 (default: 0.85)

These settings are generated from the maker’s registry entry. If the README says otherwise, follow the README.

What it can do

Runs on your computer; the tool list appears in your AI app after you install it.

Basic checksi

We check information anyone can see; we have not read the code. Checks that do not apply are left out of the count. · Checked Nov 7, 2026

  • ✓ Pass

    Maker matches the repo

    The registry name was verified with the GitHub account egoughnour, which owns the repo

  • … Not checked yet

    Still maintained

    We have not read this repo from GitHub yet

  • … Not checked yet

    Has a licence

    We have not read this repo from GitHub yet

  • – Not applicable

    Endpoint responds

    This one runs on your computer; there is no internet endpoint

  • – Not applicable

    Sign-in with OAuth

    Runs on your computer and uses local settings instead

  • … Not checked yet

    No hidden instructions in tool descriptions

    Runs on your computer; we can only read tool lists from internet endpoints

Compared with others in Otheri

  • More stars than 0% of the other 32568 servers in this category
  • Published to the registry more recently than 1% of the other 32568 servers in this category
  • Basic checks equal to or better than 100% of the other 32568 servers in this category

Compared with every active server in this category in the registry. Stars count only when the publisher owns the repo.

Common questions

Is Code Firewall MCP safe?

It passed 1 of 1 applicable basic checks. We have not read the code. Before adding a key or token, see what access the server asks for and use a key with only the permissions you need.

What keys or codes does it need?

The registry does not list a required key, though some servers ask you to sign in on first use.

Does it run on my computer or in the cloud?

It runs on your computer. Your AI app starts it when needed, and data does not pass through the maker’s servers (unless it calls an online service itself).

Is it still maintained?

The GitHub repo last changed –, and the latest version (0.7.0) reached the registry 10 months ago.

Which apps can use it?

Apps that support MCP, such as Claude Desktop, Claude Code, Cursor and VS Code. You also need Python (uv), MCPB on your computer.

What can I use instead?

In the same category: Spec Driven Development, Remote Desktop Commander, FlyDocs

Alternatives

Servers in the same category from other makers, sorted by stars.

Reading a card:★ GitHub starsiThree pillars: reviews · checks · usageiUpdated = latest version published to the registryi

Spec Driven Development

by formulahendry

MCP Server that facilitates spec-driven development workflows, not just Vibe Coding.

Runs on your computer★ 440MITUpdated 14 months ago
Install

Remote Desktop Commander

by desktop-commander

Remote Desktop Commander: use files, terminal and processes on your own computers from any AI app.

Runs in the cloud★ 211Updated yesterday
Install

FlyDocs

by flydocs.ai

Spec-driven development workflow: your agent works issues, sessions and the status lifecycle.

Runs on your computerUpdated today
Install

README from the maker

Open the README

Copied from the maker’s repo as written. PopNx MCP has not reviewed or endorsed it. HTML, images and scripts are removed. Links lead off this site.

Code Firewall MCP

A structural similarity-based code security filter for MCP (Model Context Protocol). Blocks dangerous code patterns before they reach execution tools by comparing code structure against a blacklist of known-bad patterns.

How It Works

flowchart LR

A[Code file/string] --> B[Parse & Normalize tree-sitter] B --> C[Embed Ollama] C --> D{Similarity Check vs Blacklist} D -->|≥ threshold| E[🚫 BLOCKED] D -->|< threshold| F[✅ ALLOWED] F --> G[Execution Tools rlm_exec, etc.]

style E fill:#ff6b6b,color:#fff style F fill:#51cf66,color:#fff style D fill:#339af0,color:#fff

  1. Parse code to Concrete Syntax Tree (CST) using tree-sitter
  2. Normalize by stripping identifiers and literals → structural skeleton
  3. Embed the normalized structure via Ollama
  4. Compare against blacklisted patterns in ChromaDB
  5. Block if similarity exceeds threshold, otherwise allow

Key Insight

Code patterns like os.system("rm -rf /") and os.system("ls") have identical structure. By normalizing away the specific commands/identifiers, we can detect dangerous patterns regardless of the specific arguments used.

Security-sensitive identifiers are preserved during normalization (e.g., eval, exec, os, system, subprocess, Popen, shell) to ensure embeddings remain discriminative for dangerous patterns.

Installation

Quick Start

Option 1: PyPI (Recommended)

uvx code-firewall-mcp

or

pip install code-firewall-mcp

Option 2: Claude Desktop One-Click

Download the .mcpb from Releases and double-click to install.

Option 3: From Source

git clone https://github.com/egoughnour/code-firewall-mcp.git

cd code-firewall-mcp uv sync

Wire to Claude Code / Claude Desktop

Add to ~/.claude/.mcp.json (Claude Code) or claude_desktop_config.json (Claude Desktop):

{

"mcpServers": { "code-firewall": { "command": "uvx", "args": ["code-firewall-mcp"], "env": { "FIREWALL_DATA_DIR": "~/.code-firewall", "OLLAMA_URL": "http://localhost:11434" } } } }

Requirements

  • Python 3.10+ (< 3.14 due to onnxruntime compatibility)
  • Ollama (for embeddings)
  • ChromaDB (for vector storage)
  • tree-sitter (optional, for better parsing)

Setting Up Ollama (Embeddings)

Code Firewall can automatically install and configure Ollama on macOS with Apple Silicon. There are two installation methods:

Method 1: Homebrew Installation
# 1. Check system requirements

firewall_system_check()

2. Install via Homebrew

firewall_setup_ollama(install=True, start_service=True, pull_model=True)

What this does:

  • Installs Ollama via Homebrew (brew install ollama)
  • Starts Ollama as a managed background service
  • Pulls nomic-embed-text model for embeddings
Method 2: Direct Download (No Sudo)
# 1. Check system

firewall_system_check()

2. Install via direct download - no sudo, no Homebrew

firewall_setup_ollama_direct(install=True, start_service=True, pull_model=True)

What this does:

  • Downloads Ollama from https://ollama.com
  • Extracts to ~/Applications/ (no admin needed)
  • Starts Ollama via ollama serve
  • Pulls nomic-embed-text model
Manual Setup
# Install Ollama

brew install ollama

or download from https://ollama.ai

Start service

brew services start ollama

or: ollama serve

Pull embedding model

ollama pull nomic-embed-text

Verify

firewall_ollama_status()

Tools

Setup & Status Tools
ToolPurpose
firewall_system_checkCheck system requirements — verify macOS, Apple Silicon, RAM
firewall_setup_ollamaInstall via Homebrew — managed service, auto-updates
firewall_setup_ollama_directInstall via direct download — no sudo, fully headless
firewall_ollama_statusCheck Ollama availability — verify embeddings are ready
Firewall Tools
ToolPurpose
firewall_checkCheck if a code file is safe to execute
firewall_check_codeCheck code string directly (no file required)
firewall_blacklistAdd a dangerous pattern to the blacklist
firewall_record_deltaRecord near-miss variants for classifier sharpening
firewall_list_patternsList patterns in blacklist or delta collection
firewall_remove_patternRemove a pattern from blacklist or deltas
firewall_statusGet firewall status and statistics
firewall_check

Check if a code file is safe to pass to execution tools.

result = await firewall_check(file_path="/path/to/script.py")

Returns: {allowed: bool, blocked: bool, similarity: float, ...}

firewall_check_code

Check code string directly (no file required).

result = await firewall_check_code(

code="import os; os.system('rm -rf /')", language="python" )

firewall_blacklist

Add a dangerous pattern to the blacklist.

result = await firewall_blacklist(

code="os.system(arbitrary_command)", reason="Arbitrary command execution", severity="critical" )

firewall_record_delta

Record near-miss variants to sharpen the classifier.

result = await firewall_record_delta(

code="subprocess.run(['ls', '-la'])", similar_to="abc123", notes="Legitimate use case for file listing" )

firewall_list_patterns

List patterns in the blacklist or delta collection.

firewall_remove_pattern

Remove a pattern from blacklist or deltas.

firewall_status

Get firewall status and statistics.

Configuration

Environment variables:

VariableDefaultDescription
FIREWALL_DATA_DIR/tmp/code-firewallData storage directory
OLLAMA_URLhttp://localhost:11434Ollama server URL
EMBEDDING_MODELnomic-embed-textOllama embedding model
SIMILARITY_THRESHOLD0.85Block threshold (0-1)
NEAR_MISS_THRESHOLD0.70Near-miss recording threshold

Usage Pattern

Pre-filter for massive-context-mcp

Use code-firewall-mcp as a gatekeeper before passing code to rlm_exec:

# 1. Check code safety

check = await firewall_check_code(user_code)

if check["blocked"]: print(f"BLOCKED: {check['reason']}") return

2. If allowed, proceed with execution

result = await rlm_exec(code=user_code, context_name="my-context")

Integrated with massive-context-mcp

Install massive-context-mcp with firewall integration:

pip install massive-context-mcp[firewall]

When enabled, rlm_exec automatically checks code against the firewall before execution.

Building the Blacklist

The blacklist grows through use:

  1. Initial seeding: Add known dangerous patterns
  2. Audit feedback: When rlm_auto_analyze finds security issues, add patterns
  3. Delta sharpening: Record near-misses to improve classification boundaries
# After security audit finds issues

await firewall_blacklist( code=dangerous_code, reason="Command injection via subprocess", severity="critical" )

Structural Normalization

flowchart TD

subgraph Input A1["os.system('rm -rf /')"] A2["os.system('ls -la')"] A3["os.system(user_cmd)"] end

subgraph Normalization B[Strip literals & identifiers Preserve security keywords] end

subgraph Output C["os.system('S')"] end

A1 --> B A2 --> B A3 --> B B --> C

style C fill:#ff922b,color:#fff

The normalizer strips:

  • Identifiers: my_var → _ (except security-sensitive ones)
  • String literals: "hello" → "S"
  • Numbers: 42 → N
  • Comments: Removed entirely

Preserved identifiers (for better pattern matching):

  • eval, exec, compile, __import__
  • os, system, popen, subprocess, Popen, shell
  • open, read, write, socket, connect
  • getattr, setattr, __globals__, __builtins__
  • And more security-sensitive names...

Example:

# Original

subprocess.run(["curl", url, "-o", output_file])

Normalized (preserves 'subprocess' and 'run')

subprocess.run(["S", _, "S", _])

Both subprocess.run(["curl", ...]) and subprocess.run(["wget", ...]) normalize to the same structure, so blacklisting one catches both.

License

MIT

Ask PopNx