MCP server for analyzing and optimizing context window token usage — audit tool definitions, compres
Most planning and project tracking work still happens through a UI a human drives. Token MCP server moves it into the conversation instead. MCP server for analyzing and optimizing context window token usage — audit tool definitions, compres.
MCP server for analyzing and optimizing context window token usage. MCP tool definitions consume 40-72% of context windows before any user work begins — this server helps you measure, compress, and eliminate that waste.
Installation goes through your MCP client rather than a global install: point it at token-lens-mcp on npm and it is fetched when the client starts. The copy-paste blocks for Claude Desktop, Claude Code and Cursor are further down this page.
The server publishes 10 tools. What each one is for:
session_id — Unique session identifieraction — "register_tool" | "log_call" | "report"tool_name — Tool name (required for register_tool/log_call)tool_tokens — Token cost (for register_tool, default 50)audit_context_budget — Analyze the token cost of your MCP tool definitions. Estimates tokens per tool using chars/4 approximation on the full JSON definitionoptimize_tool_loading — Given a task description, recommend the minimal set of tools needed. Uses keyword matching and category relevance scoringcompress_schema — The compress_schema tool exposed by this serveranalyze_session_usage — Track which tools are actually called vs loaded during a sessionsuggest_removals — Identify tools that can be safely removed based on usage patternsget_optimization_report — Full context window health check combining audit, removal suggestions, and compression recommendationsAmong the planning and project tracking options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Token's toolset — session_id, action, tool_name and 7 more — is a fair guide to whether it matches your workflow. It is maintained by mdfifty50-boop; worth a glance at recent repository activity before you build anything load-bearing on it.
This entry was verified against Token's own documentation before publication; SyncDev keeps the directory reviewed rather than auto-generated.
| Tool | What it does |
|---|---|
| session_id | Unique session identifier |
| action | "register_tool" | "log_call" | "report" |
| tool_name | Tool name (required for register_tool/log_call) |
| tool_tokens | Token cost (for register_tool, default 50) |
| audit_context_budget | Analyze the token cost of your MCP tool definitions. Estimates tokens per tool using chars/4 approximation on the full JSON definition. |
| optimize_tool_loading | Given a task description, recommend the minimal set of tools needed. Uses keyword matching and category relevance scoring. |
| compress_schema | The compress_schema tool exposed by this server. |
| analyze_session_usage | Track which tools are actually called vs loaded during a session. |
| suggest_removals | Identify tools that can be safely removed based on usage patterns. |
| get_optimization_report | Full context window health check combining audit, removal suggestions, and compression recommendations. |
{
"mcpServers": {
"token-lens": {
"command": "npx",
"args": ["-y", "token-lens-mcp"]
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
Your workspace, on speaking terms with AI — search, read and write Notion pages and databases.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Search and read your Drive — Docs, Sheets and files become context your assistant can actually use.
Your assistant inside the workspace — read channels, search history, post messages and tame the noise.
Metabase ships its own MCP endpoint — search your BI content, build and run queries, and save questions and dashboards without leaving the chat.
Stop letting your assistant hallucinate n8n node parameters — this server hands it the real schemas, templates and validation.