Local-first 3-layer MCP security stack: zero-key PII masking, self-healing SQL, audit chain
SardinaNuclear · reddit · 2026-11-18
A developer showcased a local-first, three-server MCP pipeline (FastMCP + Pydantic v2 + embedded Qdrant) solving schema-hallucination retry loops, unredacted PII leaking into context, and missing tenant isolation when local coding agents access SQLite — all over stdio/SSE with zero external API keys.
- Aegis-MCP-Gateway: per-tenant session namespaces, AST/regex static checks against path traversal and command injection, and a SHA-256 hash-chained local audit log for every invocation
- Aegis-SQL-Bridge: intercepts malformed SQL before raw tracebacks reach the model, auto-repairs column/syntax mismatches using an embedded Qdrant index of prior verified query/schema pairs, cutting multi-turn retry token burn
- Enterprise-SQL-MCP-Guard: enforces PRAGMA queryonly=ON, blocks DDL/DML at the AST level, and masks regex/entropy-matched PII (emails, tokens, phones) before rows return
Includes example mcpServers wiring for Claude Code/Cursor. The author also sells the bundle commercially on Agensi and offers to explain the hash-chain and AST validation internals.
More from coding & agent
- Proactive Agents That Schedule Their Own Work Hinge on Memory and UX, Says LangChain's Runkle — hwchase17 · 2026-11-18
- Cognition Launches Devin Bots: One Bot Leads a Team of Agents — aidangch · 2026-11-18
- Top token user vouches for Carbon: strong at xhigh for complex coding — olcan · 2026-11-18
- 2026's 10 Best AI Agent Frameworks: Agent Adoption Doubled, 90% Now Write Data — rseroter · 2026-11-18
- Replit Livestream With BabyAGI Creator Yohei Nakajima on Building Frontier Agents — ColleenMBrady · 2026-11-18
- fx: a tiny open-source Zig coding agent with a 6.33 MiB binary that runs in the browser — evilrabbit_ · 2026-11-18