Code MCP Server

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

Local serverstdioPython

What is the Code MCP Server?

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

What the server does

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.

Credentials and setup notes

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

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
firewall_system_check**Check system requirements** — verify macOS, Apple Silicon, RAM
firewall_setup_ollama**Install via Homebrew** — managed service, auto-updates
firewall_setup_ollama_direct**Install via direct download** — no sudo, fully headless
firewall_ollama_status**Check Ollama availability** — verify embeddings are ready
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

How to install the Code MCP Server

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

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

  • Python 3.10+ (< 3.14 due to onnxruntime compatibility) - Ollama (for embeddings) - ChromaDB (for vector storage) - tree-sitter (optional, for better parsing)
VariableDescriptionRequired
FIREWALL_DATA_DIRFilesystem location the server is allowed to use.Optional
OLLAMA_URLEndpoint or connection string the server talks to.Yes

Example prompts to try

  • “Use Code to firewall system check.”
  • “Use Code to firewall setup ollama.”
  • “Use Code to firewall setup ollama direct.”

Frequently asked questions

Structural similarity-based code filter. Stops malicious code pattern reaching execution tools. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.