A Claude Code user built mcp-guard after an MCP server leaked their .env

TastePrestigious4419 · reddit · 2026-07-24

A Reddit user found that their MCP filesystem server could leak a live .env file to Claude, including AWS keys and a Postgres connection string, simply because the agent asked to inspect a broken config.

They built mcp-guard, a local Go shim that sits between Claude Code and any MCP server to provide defense-in-depth:

The author is explicit that it is heuristic-based, cannot stop every novel secret format or injection, and cannot monitor a server’s own outbound network calls. Compression is disabled by default to avoid corrupting code edits. Repo: mcp-guard on GitHub.

Original post →

More from coding & agent

coding & agent channel →