Code Firewall MCP is a structural similarity-based code security filter that blocks dangerous code patterns before execution by comparing code structure against a blacklist of known-bad patterns.
From the registry: Structural similarity-based code filter. Stops malicious code pattern reaching execution tools.
$ ollama pull nomic-embed-texthttps://ollama.aiPlease install the `code-firewall-mcp` MCP server into my current AI client (that's you).
Required prerequisites (do these first if not already done):
- **Python 3.10+** — Required Python version (< 3.14 due to onnxruntime).
- **uv (for uvx)** — Install uv to run via uvx. (https://docs.astral.sh/uv/)
- **Ollama** — Install and run Ollama with the embedding model: `ollama pull nomic-embed-text`. The MCP server has setup tools to install Ollama on macOS. Run: `ollama pull nomic-embed-text` (https://ollama.ai)
Canonical MCP server config (stdio transport):
- command: `uvx`
- args: ["code-firewall-mcp"]
- optional environment variables:
- `FIREWALL_DATA_DIR`: Data storage directory (default /tmp/code-firewall). (example: `~/.code-firewall`)
- `OLLAMA_URL`: Ollama server URL (default http://localhost:11434). (example: `http://localhost:11434`)
- `EMBEDDING_MODEL`: Ollama embedding model (default nomic-embed-text). (example: `nomic-embed-text`)
- `SIMILARITY_THRESHOLD`: Block threshold 0-1 (default 0.85). (example: `0.85`)
- `NEAR_MISS_THRESHOLD`: Near-miss recording threshold (default 0.70). (example: `0.70`)
Note: Uses ChromaDB locally for vector storage. Built around macOS Apple Silicon.
Add this MCP server to my current client's config in the correct format for you. If you need secrets or credentials I haven't provided, ASK me — do not invent values or leave raw placeholders. After adding it, tell me how to verify the server is connected.FIREWALL_DATA_DIRrequiredData storage directoryOLLAMA_URLrequiredOllama server URLEMBEDDING_MODELOllama embedding modelSIMILARITY_THRESHOLDBlock threshold (0-1)NEAR_MISS_THRESHOLDNear-miss recording thresholdDead code, security, secrets detection and code quality for Python, TypeScript, Go.