io.github.mdfifty50-boop/token-lens
MCP server for analyzing and optimizing context window token usage — audit tool definitions, compres
Versions
0.1.0latestTools 7
health_check Returns server health, uptime, version, and storage stats
audit_context_budget Analyze the token cost of MCP tool definitions. Estimates tokens per tool using chars/4 on the full JSON definition. Returns per-tool costs and percentage of common context windows.
optimize_tool_loading Given a task description, recommend the minimal set of tools needed. Uses keyword matching and category relevance scoring to rank tools.
compress_schema Compress a verbose tool schema to reduce token usage. Light: remove short descriptions. Medium: shorten descriptions, remove examples. Aggressive: strip all descriptions.
analyze_session_usage Track which tools are actually called vs loaded in a session. Register tools, log calls, and generate waste reports showing unused tools ranked by token cost.
suggest_removals Identify tools that can be removed based on usage history. Scores: never_used > not_used_30_days > rarely_used. Returns removal candidates with estimated token savings.
get_optimization_report Full context window health check combining audit, removal suggestions, and compression recommendations. Returns an executive summary with health grade and projected savings.
Permissions 1
env_vars low