When working with Claude Code, Cursor, Windsurf, or custom MCP agents on medium-to-large repositories, two silent failure modes show up constantly:
- Context window bloat: A handful of generated lockfiles, fixtures, or bundled assets quietly eat 60–80% of your prompt budget.
-
Accidental secret exposure:
.envfragments or API tokens slip into packed context blocks before anyone notices.
To solve both locally with zero external runtime dependencies and zero telemetry, I built TokenGuard (tokenguard-mcp + VS Code / Cursor extension):
-
1-command repo audit:
npx tokenguard-mcp scan .ranks token hogs and estimates prompt cost across 10 frontier models. -
Stdio MCP server (
2025-12-11schema): Gives coding agents native tools (scan_repo,estimate_cost,pack_context,check_secrets) directly over stdio. - VS Code / Cursor / Windsurf extension: Live status-bar token/USD counter, inline secret-leak diagnostics (redacted locally), and 1-click XML/Markdown context packing.
Links & Open-Source Repos (MIT)
- GitHub (CLI & MCP Server): https://github.com/augustfu-droid/tokenguard-mcp
-
VS Code / Cursor Extension (
.vsixRelease): https://github.com/augustfu-droid/vscode-tokenguard - Glama Verified MCP Listing: https://glama.ai/mcp/servers/augustfu-droid/tokenguard-mcp
- All Kestrel DevTools & Technical Monographs: https://kestreldevtools.site/
(Side project note for CS/algorithms folks: we also just released a free 62-page sample PDF from our 2,315-page bilingual monograph Structure and Proof in Algorithms covering combinatorial search, matroids, parsing, and SSA compilers: https://augustfu-droid.github.io/structure-and-proof-in-algorithms-sample/)
Would love feedback from anyone running local MCP servers or context-budgeting workflows!
Top comments (0)