
Code Firewall Mcp
A structural pattern matcher that sits between Claude and code execution tools like rlm_exec. It parses code into syntax trees via tree-sitter, normalizes away identifiers and literals to expose the underlying structure, embeds the result through Ollama, then checks similarity against a ChromaDB blacklist of known-bad patterns. The idea is that os.system("rm -rf /") and os.system("ls") have identical structure, so you can catch dangerous patterns regardless of specific arguments. You'd use this when giving Claude access to shell or exec tools and want a secondary filter beyond the model's own judgment. Ships with setup tools for Ollama, blacklist management via firewall_blacklist, and both file and string checking methods. Threshold defaults to 0.85 similarity but you can tune it.
- tools
- 11
- transport
- STDIO
- env vars
- 4
- last updated
- Jan 19, 2026
Tools
11 toolsPublic tool metadata for what this MCP can expose to an agent.
firewall_system_checkCheck system requirements — verify macOS, Apple Silicon, RAM
Check system requirements — verify macOS, Apple Silicon, RAM
No parameter schema in public metadata yet.
firewall_setup_ollamaInstall via Homebrew — managed service, auto-updates
Install via Homebrew — managed service, auto-updates
No parameter schema in public metadata yet.
firewall_setup_ollama_directInstall via direct download — no sudo, fully headless
Install via direct download — no sudo, fully headless
No parameter schema in public metadata yet.
firewall_ollama_statusCheck Ollama availability — verify embeddings are ready
Check Ollama availability — verify embeddings are ready
No parameter schema in public metadata yet.
firewall_checkCheck if a code file is safe to pass to execution tools.
Check if a code file is safe to pass to execution tools.
No parameter schema in public metadata yet.
firewall_check_codeCheck code string directly (no file required).
Check code string directly (no file required).
No parameter schema in public metadata yet.
firewall_blacklistAdd a dangerous pattern to the blacklist.
Add a dangerous pattern to the blacklist.
No parameter schema in public metadata yet.
firewall_record_deltaRecord near-miss variants to sharpen the classifier.
Record near-miss variants to sharpen the classifier.
No parameter schema in public metadata yet.
firewall_list_patternsList patterns in the blacklist or delta collection.
List patterns in the blacklist or delta collection.
No parameter schema in public metadata yet.
firewall_remove_patternRemove a pattern from blacklist or deltas.
Remove a pattern from blacklist or deltas.
No parameter schema in public metadata yet.
firewall_statusGet firewall status and statistics.
Get firewall status and statistics.
No parameter schema in public metadata yet.
Sponsors
Configuration
FIREWALL_DATA_DIRDirectory for storing ChromaDB data
OLLAMA_URLURL for Ollama server (default: http://localhost:11434)
EMBEDDING_MODELOllama embedding model (default: nomic-embed-text)
SIMILARITY_THRESHOLDBlock threshold 0-1 (default: 0.85)
Readme
Details
- Repository
- github.com/egoughnour/code-firewall-mcp
- Category
- Security & Pentesting
- Package
code-firewall-mcp- Transport
- STDIO
- Registry
- MCP registry, active