返回资讯中心
外部精选
软件工程
#开发者实时流

MCP-shield – Runtime security proxy and reversible secret vault for MCP

Zero-overhead runtime security proxy, reversible secret vault, and audit firewall for Model Context Protocol (MCP) servers.

Hacker News 最新scotchbroker2026/10/14 · 2026/10/149 分钟阅读

以下正文同步自 Hacker News 最新,版权归原站所有,已转换为易读排版。

Zero-overhead runtime security proxy, reversible secret vault, and audit firewall for Model Context Protocol (MCP) servers.

┌─────────────────────────────────────────────────────────────────────────────┐ │ 🛡️ mcp-shield runtime active: Cursor / Claude Desktop / Windsurf │ ├─────────────────────────────────────────────────────────────────────────────┤ │ ➜ IN [BLOCKED] execute_sql "DROP TABLE users;" (Destructive command) │ │ ➜ IN [BLOCKED] read_file "~/.ssh/id_rsa" (Sensitive path protected) │ │ ✔ OUT [MASKED] get_user_api "sk-proj-..." -> [[MCP_SHIELD_REF_8f91]] │ │ ➜ IN [RESTORE] call_webhook [[MCP_SHIELD_REF_8f91]] -> Re-hydrated │ └─────────────────────────────────────────────────────────────────────────────┘

When AI assistants (Cursor, Claude Desktop, Windsurf, or agent frameworks) connect to local MCP servers, they often receive unrestricted access to system files, shell commands, and databases.

Unlike offline scanners that only check configuration files once, mcp-shield runs in real time between your AI client and any target MCP server. It intercepts destructive tool calls, prevents sensitive file exfiltration, and redacts credentials before they can leak into external LLM prompts.

Shield your MCP servers across all installed AI editors with a single command:

Auto-detects and protects Claude Desktop, Cursor, and Windsurf

npx mcp-shield wrap all

Or target a specific editor:

npx mcp-shield wrap cursor npx mcp-shield wrap claude npx mcp-shield wrap windsurf

To revert back at any time:

npx mcp-shield unwrap all

🚀 Why mcp-shield Outperforms Alternative Tools

Capability Static Config Scanners Standard Proxies mcp-shield 🛡️

Real-time Runtime Blocking ❌ ✅ ✅

Universal 1-Click Auto-Wrap ❌ ❌ ✅ (Cursor, Claude, Windsurf)

Reversible Secret Vault ❌ ❌ (hard redacts, breaks APIs) ✅ (masks outbound, re-hydrates inbound)

Destructive Command Guard ❌ Partial ✅ (rm -rf, DROP TABLE, mkfs)

Sensitive Path Shield ❌ Partial ✅ (.env, id_rsa, ~/.aws)

Zero-Corrupt Terminal HUD ❌ ❌ ✅ (Live latency & status to stderr)

🔒 The Reversible Secret Vault

Standard redactors replace secrets with [REDACTED], which breaks downstream APIs when the tool actually needs the token.

mcp-shield uses an in-memory cryptographic token vault:

You can also run mcp-shield directly as a transparent wrapper:

Run any MCP server protected through mcp-shield

npx mcp-shield -- npx -y @modelcontextprotocol/server-postgres "postgresql://localhost/mydb"

Enable persistent JSON audit logging

npx mcp-shield --log /tmp/audit.jsonl -- npx -y @modelcontextprotocol/server-filesystem /path/to/dir

Options

Usage: mcp-shield [options] [command] [args...]

Subcommands: wrap [target] Inject mcp-shield into AI clients: 'cursor', 'claude', 'windsurf', or 'all' (default: all) unwrap [target] Restore original configuration

Arguments: command Target MCP server command (e.g., 'npx', 'node', 'python') args Arguments to pass to target MCP server

Options: -l, --log <path> File path to write JSON audit logs -s, --silent Suppress live terminal HUD to stderr (default: false) --no-mask Disable automatic secret vault tokenization -b, --block-tool <tools...> Explicit list of tool names to block completely -h, --help Display help instructions

🧪 Testing

git clone https://github.com/alexfraser-scotch/mcp-shield.git cd mcp-shield npm install npm test

🤝 Contributing & License

Contributions, rules, and security suggestions are warmly welcomed! See our Contributing Guide to get started.

正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。

打开原文
去社区讨论 →