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 intools/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 /orDROP TABLEwith 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…) │
└─────────────────────────────┘
- Dual-Transport Bidirectional Proxy (
stdio+HTTP) - Wrap any localstdioMCP 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).
- Wrap any local
- Real OWASP MCP Threat Engine - Tool Poisoning Defense : Detects hidden
<IMPORTANT>/<SYSTEM>tags, stealth exfil directives, and invisible Zero-Width / BiDi Unicode smuggling intools/list.
- Rug-Pull / Schema Drift Hash-Lock : Pins SHA-256 fingerprints of every tool's
name + description + inputSchemaon 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.
- 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 clicksAPPROVE orDENY in the live dashboard. - In HTTP proxy mode, high-risk tools (
- Deterministic Infinite-Loop & Budget Circuit Breaker - Halts runaway identical tool-call retry loops and enforces per-minute / per-session hard caps.
- 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 withmcp-sentry audit --verify. - Every allow/block/redact decision is hash-chained (
- 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
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
- 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