Server data from the Official MCP Registry
Save up to 80% tokens when AI reads code via AST-aware structural reading
Save up to 80% tokens when AI reads code via AST-aware structural reading
Valid MCP server (2 strong, 2 medium validity signals). 4 known CVEs in dependencies (1 critical, 3 high severity) Package registry verified. Imported from the Official MCP Registry.
5 files analyzed · 5 issues found
Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.
This plugin requests these system permissions. Most are normal for its category.
Add this to your MCP configuration file:
{
"mcpServers": {
"io-github-digital-threads-token-pilot": {
"args": [
"-y",
"token-pilot"
],
"command": "npx"
}
}
}From the project's GitHub README.
Token-efficient AI coding, enforced. Cuts context consumption in AI coding assistants by up to 90% without changing the way you work.
Three layers, each useful on its own, stronger together:
smart_read, read_symbol, read_for_edit, …). Ask for an outline or load one function by name instead of the whole file.Read on large files, recursive Grep, unbounded git diff) and redirect to token-efficient alternatives.tp-* subagents — Claude Code delegates with MCP-first behaviour and tight response budgets.Traditional: Read("user-service.ts") → 500 lines → ~3000 tokens
Token Pilot: smart_read("user-service.ts") → 15-line outline → ~200 tokens
read_symbol("UserService.updateUser") → 45 lines → ~350 tokens
After edit: read_diff("user-service.ts") → ~20 tokens
Files under 200 lines are returned in full — zero overhead for small files.
Measured on public open-source repos. Files ≥50 lines only:
| Repo | Files | Raw Tokens | Outline Tokens | Savings |
|---|---|---|---|---|
| token-pilot (TS) | 55 | 102,086 | 8,992 | 91% |
| express (JS) | 6 | 14,421 | 193 | 99% |
| fastify (JS) | 23 | 50,000 | 3,161 | 94% |
| flask (Python) | 20 | 78,236 | 7,418 | 91% |
| Total | 104 | 244,743 | 19,764 | 92% |
smart_readoutline savings only. Real sessions additionally benefit from session cache,read_symbol, andread_for_edit. Reproduce:npx tsx scripts/benchmark.ts.
npx -y token-pilot init
Creates (or merges into) .mcp.json with token-pilot + context-mode, then prompts to install tp-* subagents. Restart your AI assistant to activate.
Grep/Bash/Read calls; redirect to efficient alternatives → hooks & modestp-* subagents (Claude Code only) — MCP-first delegates with haiku/sonnet model tiers and budget enforcement → agents referencetools/list to save ~2 k tokens per session → profiles & config| Client | MCP tools | PreToolUse hooks | tp-* subagents |
|---|---|---|---|
| Claude Code | ✅ | ✅ | ✅ |
| Cursor | ✅ | ✅ | ❌ |
| Codex CLI | ✅ | ✅ | ❌ |
| Gemini CLI | ✅ | ✅ | ❌ |
| Cline (VS Code) | ✅ | ✅ | ❌ |
| Antigravity | ✅ | ✅ | ❌ |
Manual config snippets for each client → installation guide
TOKEN_PILOT_MODE controls how aggressively Token Pilot redirects heavy native tool calls:
| Value | Behaviour |
|---|---|
advisory | Allow all — hooks pass through, advisory notes only |
deny (default) | Block heavy Grep/Bash patterns; intercept large Read calls |
strict | Deny + auto-cap MCP output (smart_read ≤ 2 000 tokens, find_usages → list mode, smart_log → 20 commits) |
TOKEN_PILOT_MODE=strict npx token-pilot
| Tool | Role |
|---|---|
| Token Pilot | Enforcement layer — hooks, MCP structural reads, subagents |
| ast-index | Structural indexer. Auto-installed by Token Pilot; also a standalone CLI for bash-only agents |
| context-mode | Sandbox executor — runs shell/python/js, only stdout enters the context window |
Rules of thumb: read code → smart_read/read_symbol; execute code with big output → context-mode execute; bash-only agent → ast-index CLI. Never copy all three into CLAUDE.md — Token Pilot's doctor warns when CLAUDE.md exceeds 60 lines.
TypeScript, JavaScript, Python, Go, Rust, Java, Kotlin, C#, C/C++, PHP, Ruby. Non-code (JSON/YAML/Markdown/TOML) gets structural summaries. Regex fallback handles most other languages.
Claude Code (plugin — recommended):
# Install on a new machine:
claude plugin marketplace add https://github.com/Digital-Threads/token-pilot
claude plugin install token-pilot@token-pilot
# Update to latest:
claude plugin update token-pilot
Other clients (Cursor, Codex, Cline, …):
# Install on a new machine:
npx -y token-pilot init
# Update to latest — npx always pulls fresh, just restart your client.
# Or if installed globally:
npm i -g token-pilot@latest
npx token-pilot install-hook
npx token-pilot install-agents --scope=user --force
npx token-pilot doctor # diagnose: ast-index, config, upstream drift
# "ast-index not found" → npx token-pilot install-ast-index
# "hooks not firing" → restart your AI assistant
Built on ast-index · @ast-grep/cli · MCP SDK · chokidar
MIT
Be the first to review this server!
by Modelcontextprotocol · Developer Tools
Read, search, and manipulate Git repositories programmatically
by Toleno · Developer Tools
Toleno Network MCP Server — Manage your Toleno mining account with Claude AI using natural language.
by mcp-marketplace · Developer Tools
Create, build, and publish Python MCP servers to PyPI — conversationally.
by Microsoft · Content & Media
Convert files (PDF, Word, Excel, images, audio) to Markdown for LLM consumption
by mcp-marketplace · Developer Tools
Scaffold, build, and publish TypeScript MCP servers to npm — conversationally
by mcp-marketplace · Finance
Free stock data and market news for any MCP-compatible AI assistant.