r/MCPservers • u/Ok-Impact-5316 • 5h ago
I built an MCP server that lets Claude spot "tarpit" code before it wastes tokens on it
Some code is now written on purpose to trap AI agents. I tested a hardening tool called BLA on a 418-byte JS file, and it came out as ~180 KB of decoy functions and misleading comments. It runs exactly the same, but an agent that tries to read it burns tens of thousands of tokens.
tarpit-guard is a small MCP server that scores a file 0-100 for this. Your agent checks the file first, and if it's a tarpit, it stops instead of digging in. It only detects and never tries to decode anything.
- That BLA file scores 78 (TARPIT). Minified jQuery and Lodash score near 0, so normal minified code isn't flagged.
- Runs locally over stdio. No server, no account, no cost.
- Works with Claude Desktop (one-click extension), Claude Code and Cursor.
- pip install "tarpit-guard[mcp]" (the core has zero dependencies)
GitHub: https://github.com/ManiraM-1/tarpit-guard
I'd love feedback, especially false positives. If it flags a normal file of yours, I want to know.