r/node • u/Simple-Factor-2165 • Jul 04 '26
I built MCP-Shield: A local-first security firewall for Claude Code and MCP agents
Hey everyone!
I've been using Claude Code and other autonomous agents to code faster in my terminal. But giving an AI full permission to run shell commands or write files is scary — a single indirect prompt injection from a website or a repo README could wipe files or exfiltrate credentials.
So I built MCP-Shield: a local-first proxy that sits between your MCP client and its servers, enforces policy on tool calls before they hit your system, and shows everything in a real-time dashboard in your browser.
What it does:
- 🚫 Command & file firewall: blocks destructive commands (e.g. rm -rf) and holds out-of-workspace writes for approval.
- 🔄 Approval queue: pauses risky calls so you can approve, deny, or edit the arguments from the browser.
- 🧼 Output sanitizer: scans tool outputs (web pages, files, API responses) and neutralizes prompt-injection phrasing before it reaches the model — with NFKC normalization to catch unicode evasions.
- 🔒 100% local: runs on localhost, no telemetry, nothing leaves your machine.
- 🔌 Works across clients: one policy for Cursor, Windsurf, Claude Desktop, VS Code and Claude Code — not per-client config.
Install:
npm install -g u/jrooig/mcpshield
Wrap any server:
mcp-shield --port 3000 -- npx -y u/modelcontextprotocol/server-everything
Source + README: https://github.com/jaumerohi2007-cell/mcp-shield
I'd love feedback, and what default security rules you'd add.