Skip to main content
MCP server CX Codex

token-optimizer-mcp — Claude Code MCP server: features and setup

This MCP server compresses request content and can move blocks it cannot compress into a file. It can help when logs, search results, or repeated reads fill an agent’s context.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env TOKEN_OPTIMIZER_CACHE_DIR=<TOKEN_OPTIMIZER_CACHE_DIR> --transport stdio token-optimizer-mcp -- npx -y @ooples/token-optimizer-mcp
Open on GitHub

What token-optimizer-mcp does

The server compresses blocks in a request without moving their contents. In proxy mode, it can also move a block that resists compression into a file and leave a marker with its path. The README compares these as separate modes against HeadRoom using test corpora.

In Claude Code, add the server with claude mcp add and run it through npx. To configure a cache directory, the command accepts TOKEN_OPTIMIZER_CACHE_DIR. Node.js 22 or newer is required. Without the proxy mode, blocks stay in the request and are handled through compression.

What it helps with

  • compress long build logs before asking an agent to inspect them
  • reduce repeated-read content in an agent request
  • move an incompressible block to a file and keep its path
  • shrink context containing search results

Example prompts for the agent

  • Compress the build output before analyzing the errors.
  • Process these code search results and trim unnecessary context.
  • Move the large block that cannot be compressed into a file and keep its path.

How to install token-optimizer-mcp

Platform CLI

claude mcp add --env TOKEN_OPTIMIZER_CACHE_DIR=<TOKEN_OPTIMIZER_CACHE_DIR> --transport stdio token-optimizer-mcp -- npx -y @ooples/token-optimizer-mcp

Replace <…> with your own values

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about token-optimizer-mcp

How do I install token-optimizer-mcp in Claude Code?

Run claude mcp add token-optimizer-mcp -- npx -y @ooples/token-optimizer-mcp. To set a cache directory, use claude mcp add --env TOKEN_OPTIMIZER_CACHE_DIR=<TOKEN_OPTIMIZER_CACHE_DIR> --transport stdio token-optimizer-mcp -- npx -y @ooples/token-optimizer-mcp. Node.js 22 or newer is required.

What does token-optimizer-mcp do?

It compresses blocks in agent requests. In proxy mode, it can move a block it cannot compress into a file and leave a marker pointing to it.

Which Node.js version does token-optimizer-mcp require?

It requires Node.js 22 or newer.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor