Get the FREE Ultimate OpenClaw Setup Guide →

token-optimizer

Intelligent token optimization for Claude Code - achieving 95%+ token reduction through caching, compression, and smart tool intelligence

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio ooples-token-optimizer-mcp npx -y @ooples/token-optimizer-mcp \
  --env TOKEN_OPTIMIZER_LOG_LEVEL="optional: set log level (e.g., info, warn, error)"

How to use

Token Optimizer MCP is a server that reduces token usage by intelligently caching, compressing, and optimizing tool outputs for Claude Code and Claude Desktop workflows. It stores content externally in a SQLite cache and provides optimized replacements for common tooling, enabling you to fit more work into a fixed context window. The server exposes 61 specialized tools across core caching, smart file operations, API/database interactions, build/test workflows, advanced caching, and monitoring to accelerate development while minimizing token consumption. Typical usage involves caching large responses, diff-based file updates, and cached API calls so that repeated operations incur significantly fewer tokens.

How to install

Prerequisites:

  • Node.js and npm installed on your system
  • Access to a terminal or shell

Quick install (recommended):

  • Windows
    1. Open PowerShell as Administrator
    2. Run: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
  1. Run: npm install -g @ooples/token-optimizer-mcp
  • macOS / Linux
    1. Run: npm install -g @ooples/token-optimizer-mcp

What the installer does:

  • Installs token-optimizer-mcp globally via npm
  • Auto-detects and configures installed AI tools (Claude Desktop, Cursor, Cline, etc.)
  • Sets up automatic token optimization on tool calls
  • Configures workspace trust and execution permissions

If automatic installation is skipped (e.g., CI):

  • Windows: powershell -ExecutionPolicy Bypass -File install-hooks.ps1
  • macOS/Linux: bash install-hooks.sh

Manual configuration (if you need to customize):

  • See docs/HOOKS-INSTALLATION.md for detailed platform-specific steps.

Additional notes

Tips and notes:

  • The MCP uses Brotli compression and a SQLite cache to persist optimizations across sessions. Expect substantial token reductions, particularly on repetitive content and large payloads.
  • Environment variables can customize logging, cache behavior, and tool selection. Start with the default config and enable verbose logs if troubleshooting.
  • If you upgrade the MCP, review release notes for breaking changes in tool names or API surfaces.
  • The npm package name for reference: @ooples/token-optimizer-mcp

Related MCP Servers

Sponsor this space

Reach thousands of developers