ImportSpy
bundle cost at your cursor — before the import lands
npx -y github:Isco0819/import-spyEver run into this?
The Import Cost VS Code extension has 10M+ downloads proving devs care deeply about bundle bloat. But AI coding agents (Cursor, Claude Code, Copilot) have zero bundle awareness — they suggest heavy imports with no cost signal, and the damage only surfaces at build time.
The fix
MCP server + npx CLI powered by local esbuild that measures the real gzip bundle cost of any npm import in milliseconds — so AI agents know the cost before they write the import.
What it does
- MCP tool: check_import_cost(package, namedExport?) returns gzip + minified bytes, fully offline via local esbuild
- npx scan mode: parse every import in a JS/TS file and print a ranked cost table sorted by size
- --budget flag: exit 1 when total import weight exceeds threshold, CI-friendly