# Show HN: MCP-Sentry v2.0 – Zero-dependency firewall and audit proxy for MCP

> Source: <https://github.com/yepinggu66/mcp-sentry>
> Published: 2026-11-19 18:36:05+00:00

**Key takeaway:** MCP-Sentry v2.0 wraps any stdio or Streamable HTTP MCP server with one command and pins SHA-256 fingerprints of each tool's name, description and inputSchema to block post-approval rug-pull mutations at 0.031 ms average latency.

**Zero external dependencies. Sub-millisecond latency (0.031 ms avg). Bidirectional JSON-RPC 2.0 interception for Claude Desktop, Cursor, Windsurf, and Enterprise MCP Servers.**

AI Agents using MCP (`stdio` or `Streamable HTTP`) have direct access to your local shell, databases, filesystem, and external APIs — with **zero native security boundary**. A single poisoned third-party MCP server or stuck agent loop can:

- **Steal `~/.ssh/id_rsa`, `.env`, and AWS/OpenAI keys** via hidden Tool Poisoning instructions in`tools/list` .
- **Silently mutate tool definitions after you approve them** (Rug-Pull attacks).
- **Exfiltrate sensitive files** across servers (read secret via Server A → send out via`fetch` /email on Server B).
- **Burn $500+ in API credits overnight** in an infinite tool-retry loop.
- **Execute destructive `rm -rf /` or `DROP TABLE`** with no human confirmation or audit trail.

**MCP-Sentry v2.0** sits transparently between your AI client and any MCP server — blocking attacks in **< 0.1 ms** with **zero code changes**.

```
┌─────────────────────────────┐
│  Claude / Cursor / Windsurf │
│   or Enterprise AI Agent    │
└──────────────┬──────────────┘
               │ JSON-RPC 2.0 (stdio OR Streamable HTTP)
               ▼
┌─────────────────────────────────────────────────────────────┐
│                    MCP-SENTRY v2.0 GATEWAY                  │
│  ┌─────────────────────┐  ┌──────────────────────────────┐  │
│  │ Inbound (C -> S)    │  │ Outbound (S -> C)            │  │
│  │ • Policy-as-Code    │  │ • Tool Poisoning Scanner     │  │
│  │ • Destructive/SQLi  │  │ • Rug-Pull SHA-256 Lock      │  │
│  │ • Cross-Server DLP  │  │ • Secret Auto-Redaction      │  │
│  │ • Taint Enforcement │  │ • Session Taint Marking      │  │
│  │ • Loop & Cost Cap   │  └──────────────────────────────┘  │
│  │ • HITL Approval UI  │  ┌──────────────────────────────┐  │
│  └─────────────────────┘  │ Cryptographic Audit Ledger   │  │
│                           │ SHA-256 Chain + HMAC + SQLite│  │
│                           └──────────────────────────────┘  │
└──────────────┬──────────────────────────────────────────────┘
               │ Safe, Inspected JSON-RPC 2.0
               ▼
┌─────────────────────────────┐
│   Any Local or Remote MCP   │
│  (Postgres, GitHub, Bash…)  │
└─────────────────────────────┘
```

1. **Dual-Transport Bidirectional Proxy (`stdio` + `HTTP`)**  - Wrap any local `stdio` MCP server in 1 line:`mcp-sentry wrap -- npx @modelcontextprotocol/server-postgres`
  - Reverse-proxy remote HTTP MCP servers with a built-in **Live Wireshark-style Firewall Dashboard** (`/sentry/ui` ).
2. Wrap any local 
3. **Real OWASP MCP Threat Engine**  - **Tool Poisoning Defense** : Detects hidden`<IMPORTANT>` /`<SYSTEM>` tags, stealth exfil directives, and invisible Zero-Width / BiDi Unicode smuggling in`tools/list` .
  - **Rug-Pull / Schema Drift Hash-Lock** : Pins SHA-256 fingerprints of every tool's`name + description + inputSchema` on first sight and blocks post-approval mutation.
  - **Cross-Server Taint Tracking & DLP** : Scans responses for OpenAI/Anthropic/AWS/GitHub/Stripe/PEM/JWT/DB-URI secrets,**redacts them in-flight** , taints the session, and blocks subsequent outbound network tools (`fetch` ,`curl` ,`send_email` ).
  - **Destructive Command & Path Traversal Blocker** : Blocks`rm -rf` ,`DROP TABLE` ,`TRUNCATE` ,`curl | bash` , reverse shells, and`../` traversal.
4. **Human-in-the-Loop (HITL) Approval Gate**  - In HTTP proxy mode, high-risk tools (`execute_sql` ,`run_command` ,`transfer_funds` ) are suspended in real time until an operator clicks**APPROVE** or**DENY** in the live dashboard.
5. In HTTP proxy mode, high-risk tools (
6. **Deterministic Infinite-Loop & Budget Circuit Breaker**  - Halts runaway identical tool-call retry loops and enforces per-minute / per-session hard caps.
7. **Tamper-Evident Cryptographic Audit Ledger (SOC2 / EU AI Act Ready)**  - Every allow/block/redact decision is hash-chained (`SHA-256` ) and signed (`HMAC-SHA256` ) into both JSONL and SQLite. Verify zero tampering anytime with`mcp-sentry audit --verify` .
8. Every allow/block/redact decision is hash-chained (
9. **Hot-Reloaded Policy-as-Code (`sentry.yaml`)**  - Edit tool whitelists, denied paths, allowed domains, and HITL gates without restarting the gateway.

```
git clone https://github.com/yepinggu66/mcp-sentry.git
cd mcp-sentry
pip install -e .
mcp-sentry bench
{
  "mcpServers": {
    "postgres-guarded": {
      "command": "mcp-sentry",
      "args": ["wrap", "--policy", "sentry.yaml", "--", "npx", "-y", "@modelcontextprotocol/server-postgres", "postgresql://..."]
    }
  }
}
mcp-sentry init
mcp-sentry proxy --upstream http://127.0.0.1:9000/mcp --port 8787 --policy sentry.yaml
# Open http://127.0.0.1:8787/sentry/ui
mcp-sentry audit --verify
```

Verified directly via `mcp-sentry bench` and `python -m unittest discover -s tests -v`:

| Category | Attack Vectors Tested | Block Rate | Avg Latency | 
|---|---|---|---|
| Tool Poisoning & Unicode Smuggling | Hidden `<IMPORTANT>` exfil, Zero-Width BiDi, stealth directives | **3 / 3 (100%)** | 0.042 ms | 
| Rug-Pull Schema Drift | Post-approval SHA-256 tool mutation | **1 / 1 (100%)** | 0.015 ms | 
| Destructive & Shell/SQL Injection | `rm -rf /` ,`DROP TABLE` ,`TRUNCATE` ,`curl\|bash` , reverse shell,`base64\|sh` | **6 / 6 (100%)** | 0.017 ms | 
| Secret Theft, DLP & Path Traversal | `.env` ,`~/.ssh/id_rsa` ,`../` , OpenAI/AWS/GitHub/PEM/Postgres URI | **8 / 8 (100%)** | 0.016 ms | 
| Response Redaction & Taint Exfil | In-flight AWS/OpenAI masking + cross-server outbound block | **2 / 2 (100%)** | 0.038 ms | 
| Domain Firewall, HITL, Loop & Ledger | Domain deny, HITL suspension, 4th-call loop trip, 1-byte tamper detection | **4 / 4 (100%)** | 0.074 ms | 
| **TOTAL** | **24 Real MCP Attack Vectors** | **24 / 24 (100.0%)** | **0.031 ms** | 

- **Online Security Sandbox** :[https://pingguye.cn/stackverdict/agentwall](https://pingguye.cn/stackverdict/agentwall)
- **Commercial / Enterprise License & Source Code Buyout** :
  - Need custom SSO/RBAC, multi-tenant Slack/Teams HITL approval bots, SIEM/OTLP pipelines, or full commercial IP licensing?
  - Contact: **[yepinggu66@gmail.com](mailto:yepinggu66@gmail.com)**
