Token Optimizer

v2.1.0โ€ขDeveloper Toolsโ€ขstable

๐Ÿ“‡ ๐Ÿ  โ˜๏ธ ๐ŸŽ ๐ŸชŸ ๐Ÿง - Intelligent token optimization achieving 95%+ reduction through caching, compression, and 80+ smart tools for API optimization, code analysis, and real-time monitoring.

aicachingclaudecompressionllm
Share:
391
Stars
0
Downloads
0
Weekly
0/5

What is Token Optimizer?

Token Optimizer is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ๐Ÿ“‡ ๐Ÿ  โ˜๏ธ ๐ŸŽ ๐ŸชŸ ๐Ÿง - intelligent token optimization achieving 95%+ reduction through caching, compression, and 80+ smart tools for api optimization, code analysis, and real-time monitoring.

๐Ÿ“‡ ๐Ÿ  โ˜๏ธ ๐ŸŽ ๐ŸชŸ ๐Ÿง - Intelligent token optimization achieving 95%+ reduction through caching, compression, and 80+ smart tools for API optimization, code analysis, and real-time monitoring.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • ๐Ÿ“‡ ๐Ÿ  โ˜๏ธ ๐ŸŽ ๐ŸชŸ ๐Ÿง - Intelligent token optimization achieving 95%+

Use Cases

95%+ token reduction
Caching and compression
API optimization and monitoring
ooples

Maintainer

LicenseMIT
Languagetypescript
Versionv2.1.0
UpdatedMay 21, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y token-optimizer-mcp

Manual Installation

npx -y token-optimizer-mcp

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Token Optimizer

Token Optimizer MCP is a TypeScript MCP server that reduces context window usage by 60โ€“90% through Brotli compression, SQLite-backed persistent caching, and 65 smart tool replacements for common operations like file reads, grep, git diffs, API fetches, and database queries. It compresses and stores large content externally so that subsequent requests only transfer diffs or cached references, and it includes real-time token analytics showing exactly which tools and hook phases consume the most tokens. It works entirely offline with zero external dependencies and auto-configures itself into Claude Desktop, Cursor, Cline, and other AI tools on install.

Prerequisites

  • Node.js 18+ installed
  • npm package manager
  • Claude Desktop, Claude Code, Cursor, or another MCP-compatible client
  • No external API keys required โ€” the server operates fully offline
1

Install the package globally

Install token-optimizer-mcp globally via npm. The postinstall script automatically detects all installed AI tools on your system and configures them to use the MCP server. No manual configuration is needed on most systems.

npm install -g @ooples/token-optimizer-mcp
2

Verify auto-configuration

After install, open Claude Desktop or your preferred client โ€” the token-optimizer MCP server should appear in the connected servers list. If auto-configuration was skipped (e.g., in a CI environment), run the installer manually.

# macOS/Linux:
bash install-hooks.sh
# Windows (PowerShell as Administrator):
powershell -ExecutionPolicy Bypass -File install-hooks.ps1
3

Add to MCP client config manually if needed

If auto-configuration did not add the server, add it manually to claude_desktop_config.json. The server runs via npx so no separate start command is needed.

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

Start using smart tools in your AI client

Use the smart_* tool variants instead of standard file/git/API tools. For example, use smart_read instead of a plain file read โ€” it caches the content and on subsequent reads returns only the diff.

5

Check your token savings

Use the get_session_stats and get_action_analytics tools to see a breakdown of token usage by tool and hook phase. This helps identify which operations benefit most from optimization.

Token Optimizer Examples

Client configuration

Manual configuration for Claude Desktop. The npx command fetches and runs the latest published package.

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

Prompts to try

These prompts exercise the smart tools and analytics capabilities of Token Optimizer MCP.

- "Use smart_read to read src/index.ts and show me only what changed since last time"
- "Run smart_grep to find all usages of fetchUser across the codebase"
- "Fetch https://api.example.com/users with smart_api_fetch and cache the result for 5 minutes"
- "Show me my session token stats โ€” which tools used the most tokens today?"
- "Analyze the token footprint of this project with analyze_project_tokens"
- "Use smart_diff to show me what changed in the last git commit"

Troubleshooting Token Optimizer

Auto-install did not configure my AI tool

Run the appropriate installer script manually: `bash install-hooks.sh` on macOS/Linux or the PowerShell script on Windows. Then restart your AI client. If your tool is not yet auto-detected, add the server manually to its MCP config using npx -y token-optimizer-mcp.

Cached data is stale or returns outdated file contents

Call the clear_cache tool to reset all cached content, or use get_cache_stats to inspect what is stored. The smart tools track file modification times and should auto-invalidate, but manual clearing is available for edge cases.

Brotli compression errors on Windows

Ensure you are running PowerShell as Administrator when installing. The package uses native Node.js Brotli (available since Node 10.16) โ€” verify your Node version is 18+ with `node --version`. If issues persist, run `npm rebuild` in the global npm directory.

Frequently Asked Questions about Token Optimizer

What is Token Optimizer?

Token Optimizer is a Model Context Protocol (MCP) server that ๐Ÿ“‡ ๐Ÿ  โ˜๏ธ ๐ŸŽ ๐ŸชŸ ๐Ÿง - intelligent token optimization achieving 95%+ reduction through caching, compression, and 80+ smart tools for api optimization, code analysis, and real-time monitoring. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Token Optimizer?

Install via npm with the command: npx -y token-optimizer-mcp. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Token Optimizer?

Token Optimizer works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Token Optimizer free to use?

Yes, Token Optimizer is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

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

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide โ†’

Ready to use Token Optimizer?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides