Token MCP Server

MCP server for analyzing and optimizing context window token usage — audit tool definitions, compres

Local serverstdio

What is the Token MCP server?

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.

The short version

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.

Getting it running

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 tools it exposes

The server publishes 10 tools. What each one is for:

  • 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

Things to watch

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 10 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Token.
  • Keep per-call confirmation enabled while you learn its behaviour; it is the cheapest safeguard you have.

How it compares

Among 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.

Available tools

ToolWhat it does
session_idUnique session identifier
action"register_tool" | "log_call" | "report"
tool_nameTool name (required for register_tool/log_call)
tool_tokensToken cost (for register_tool, default 50)
audit_context_budgetAnalyze the token cost of your MCP tool definitions. Estimates tokens per tool using chars/4 approximation on the full JSON definition.
optimize_tool_loadingGiven a task description, recommend the minimal set of tools needed. Uses keyword matching and category relevance scoring.
compress_schemaThe compress_schema tool exposed by this server.
analyze_session_usageTrack which tools are actually called vs loaded during a session.
suggest_removalsIdentify tools that can be safely removed based on usage patterns.
get_optimization_reportFull context window health check combining audit, removal suggestions, and compression recommendations.

How to install the Token MCP server

{
  "mcpServers": {
    "token-lens": {
      "command": "npx",
      "args": ["-y", "token-lens-mcp"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Example prompts to try

  • Use Token to session id.
  • Use Token to action.
  • Use Token to tool name.

Frequently asked questions

It connects Token to MCP-compatible AI assistants such as Claude and Cursor, exposing 10 tools (session_id, action, tool_name, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Token directly.