TokenCap exposes repository intelligence through the Model Context Protocol (MCP). Your AI host queries focused questions about the repository live, during reasoning, on demand — saving up to 92% of context token budget.
Install TokenCap globally and run the single configuration command. TokenCap auto-detects your host IDE and wires configuration automatically.
1. Install TokenCap globally:
npm install -g tokencap2. Wire your IDE / MCP Host:
tokencap mcp --initWhen a workspace has multiple supported AI hosts, specify your host explicitly:
| Host IDE / Tool | Configuration Written | Init Command |
|---|---|---|
| Claude Code | .claude/mcp.json | tokencap mcp --init --client claude |
| Cursor | .cursor/mcp.json | tokencap mcp --init --client cursor |
| Windsurf | .windsurf/mcp.json | tokencap mcp --init --client windsurf |
| Cline / Roo Code | .cline/mcp.json | tokencap mcp --init --client cline |
| VS Code | .vscode/mcp.json | tokencap mcp --init --client vscode |
| Antigravity | .agents/mcp_config.json | tokencap mcp --init --client antigravity |
| Codex | .codex/config.toml | tokencap mcp --init --client codex |
In v2.4.0, TokenCap introduces plan-only safe refactoring (tokencap_refactor_plan) and static test-to-symbol intelligence (tokencap_test_map), alongside local Change Review packets and host-scoped agent pointers.
tokencap_refactor_plan over MCP to preview AST symbol renames and dead-code removal without risking un-reviewed disk modifications.tokencap_test_map over MCP to determine test coverage associations, untested symbol gaps, and ingested report coverage.tokencap_review over MCP to get bounded base-ref symbol evidence, caller candidates, and test hints.tokencap_ownership to access local Git churn and collaborator context without pushing to remote APIs.AGENTS.md, CLAUDE.md) without overwriting existing files.| Tool Name | Description | Example Input |
|---|---|---|
| tokencap_overview | Tech stack, cluster list, risk summary, last build time. | None |
| tokencap_files | Most relevant files for a task, ranked by graph + recency + risk. | { "query": "login bug" } |
| tokencap_search | Cross-layer search across brain, graph, constitution, and files. | { "query": "JWT token" } |
| tokencap_cluster | Full intelligence for one cluster: files, deps, risk, changes. | { "cluster": "Auth" } |
| tokencap_dependencies | Upstream providers + downstream consumers up to N hops. | { "target": "src/jwt.js" } |
| tokencap_constitution | Constitution rules scoped to a cluster, file, or rule ID. | { "file": "src/jwt.js" } |
| tokencap_impact | Blast radius of proposed changes: affected clusters & broken rules. | { "files": ["src/jwt.js"] } |
| tokencap_refactor_plan | Dry-run preview of safe symbol renames or dead-code removal plans across the AST graph. | { "action": "rename", "target": "src/token.js:validate", "newName": "check" } |
| tokencap_test_map | Static test associations, called-but-untested symbol gaps, and coverage report lines. | { "target": "src/token.js:validate", "gaps": true } |
| tokencap_review | Local change review packet with base-ref symbol evidence and caller candidates. | { "base": "main" } |
| tokencap_ownership | Opt-in Git churn, contributor distributions, and bounded co-change signals. | { "history": true } |
| tokencap_simplify | Surface high-confidence unreachable statements, duplicate artifacts, and abstractions. | None |
| tokencap_execution | Execution-contract guidance for the current engineering phase. | None |
| tokencap_verify | Test commands, test files, lint rules, and review checklist. | { "cluster": "Auth" } |
| tokencap_delta | What changed since last build — clusters, files, rules. | None |
| tokencap_diagram | Architecture, impact, and diff SVG visualizer diagrams. | { "type": "architecture" } |
| tokencap_screen | Frontend visual and layout intelligence for UI components. | { "component": "Navbar" } |
| tokencap_manage_adr | Read/write Architecture Decision Records that persist across sessions. | { "action": "add", "title": "Use web-tree-sitter", "decision": "AST parsing" } |
| tokencap_mcp_status | Server uptime, cache hit rate, and per-endpoint call counts. | None |
Comparing traditional cold file loading vs MCP service queries:
Sub-millisecond local handler processing times: