AI generated
TL;DR: cargo install chachawall, wrap your MCP server, and instantly block prompt injection and credential leaks without touching your code. It's a fast, zero-VRAM Rust proxy with YAML rules.
When running local models (Ollama/Qwen/Llama) and coding agents with third-party MCP servers, indirect prompt injections or tool poisoning can trick smaller models into reading ~/.ssh/id_rsa, .env, or running destructive commands.
I built ChachaWall (chacha) in Rust—a transparent JSON-RPC 2.0 stdio wrapper that sits between your MCP client (Claude Desktop, Cursor, Cline, OpenCode) and any MCP server with near-zero latency and zero extra VRAM usage:
- Real-time
stdioproxy (chacha wrap -- <cmd>): Inspectstools/listschemas andtools/callarguments on the fly. When a rule triggers, it blocks the request and returns a valid JSON-RPC-32001error matching the request ID so your client never hangs. - Unicode normalization & hidden character detection: Applies NFKC normalization and flags hidden Unicode Tag characters (U+E0000..U+E007F) and zero-width spaces commonly used to hide prompt injections in tool descriptions.
- Composable YAML rules (
rules/*.yaml): Separate rules for prompt injection, path traversal, and exfiltration, with user overrides (~/.config/chachawall/chacha.yaml) and allowlists.
It's Apache-2.0. Because the rules are just simple YAML files with inline test cases, if you find a new bypass or attack vector, PRs are super welcome. I want this to be a community-driven defense layer for the MCP ecosystem.
You can check out the code, the evil MCP server demo, and install it here: [LINK A TU GITHUB AQUÍ]
(Self-promotion note: I'm building this in public to make the MCP ecosystem safer for everyone. Would love to hear what bypasses you manage to find!)- **Audit & CI mode:** Supports `--on-detect warn|block` and `--json-log` (NDJSON on `stderr`, keeping `stdout` strictly clean for JSON-RPC).
*Honest scope: This is a deterministic rule-based defense-in-depth layer—not an OS kernel sandbox or an ML classifier—meant to catch obvious exfiltration, path traversal, and hidden schema payloads fast.*
**GitHub (Apache-2.0):** https://github.com/alejandro-polars/ChachaWall
Would love feedback on the rule engine, false positives, or edge cases you've seen with MCP servers!