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?

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.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

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_schema
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

MCP server for analyzing and optimizing context window token usage — audit tool definitions, compres Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.