Skip to content
MCP server

Token Optimizer MCP

Hooks, a proxy and MCP server that trim wasted tokens in AI coding agents

Runs locally

Token Optimizer MCP is an MCP server for ai models and llm tooling. It runs locally on your machine and is started by your AI client.

Platforms
CLI, Self-hosted, macOS
Runs
Locally
Version
7.11.0
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add token-optimizer-mcp -- npx -y @ooples/token-optimizer-mcp

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

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

Claude Code setup guide

Add to claude_desktop_config.json

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

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

Claude Desktop setup guide

Install in CursorOpens Cursor, which asks you to confirm. Or add it by hand:

Add to ~/.cursor/mcp.json

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

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Install in VS CodeOpens VS Code, which asks you to confirm. Or add it by hand:

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "token-optimizer-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@ooples/token-optimizer-mcp"
      ]
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

Add with the CLI

Run in a terminal

codex mcp add token-optimizer-mcp -- npx -y @ooples/token-optimizer-mcp

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.token-optimizer-mcp]
command = "npx"
args = ["-y", "@ooples/token-optimizer-mcp"]

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "token-optimizer-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ooples/token-optimizer-mcp"
      ]
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

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

    Or run: gemini mcp add -s user token-optimizer-mcp npx -- -y @ooples/token-optimizer-mcp

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

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

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

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

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

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

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "token-optimizer-mcp": {
          "command": "npx",
          "args": [
            "-y",
            "@ooples/token-optimizer-mcp"
          ]
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

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

    Junie

    Add to ~/.junie/mcp/mcp.json

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

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

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

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

Configuration

  • TOKEN_OPTIMIZER_CACHE_DIRDirectory path for cache storage (optional, defaults to ~/.token-optimizer-cache)

About Token Optimizer MCP

The author's own benchmark claim is the headline: on SWE-bench Verified with Claude Sonnet, Claude Code with the plugin resolved 7 of 7 tasks in both arms at about 0.71 times the cost of the control. The README itself calls the samples small and the variance large, and publishes runs where it lost, so treat the numbers as directions rather than guarantees.

The savings come mostly from hooks, not from the bare MCP server. For Claude Code the README says to install the plugin, because hooks stop an agent re-reading unchanged files, dumping whole files to see a few lines, and running unbounded searches, and they reuse what earlier sessions worked out. With only the server, it reports a cost ratio of about 1.0. A proxy mode and a local dashboard track what was saved and what the optimizer itself cost.

The same server runs in sixteen clients including Codex, Copilot CLI, Gemini CLI and Cursor, via npx -y @ooples/token-optimizer-mcp@latest. It needs Node.js 22.18 or 24.11 and, for Claude Code, version 2.1.139 or later. Everything runs locally with no account, and telemetry is off unless you opt in twice.

What it does

Claude Code plugin
Hooks intercept large reads and repeated work before they cost tokens.
Caching and compression
Registry text describes caching, compression and smart file tools.
Local dashboard
One ledger of savings per agent, including the optimizer's own cost.
Sixteen client configs
Ready-made configuration for Codex, Copilot CLI, Gemini CLI, Cursor and others.
Doctor command
`npx token-optimizer-doctor` tests the real hook and names the fix for each failure.
Published benchmarks
Method and losing runs are documented, not just the wins.

Good for

  • Cut the token bill of long Claude Code sessions
  • Stop agents re-reading files that have not changed
  • Compare token savings across several coding agents in one dashboard
  • Keep context-window use down in large repositories

Token Optimizer MCP FAQ

Should I install the plugin or the plain MCP server?

The README says to install the plugin in Claude Code, since the hooks do the saving and the server alone only offers tools the model can ignore.

What does Token Optimizer MCP require?

Node.js 22.18+ (or 24.11+) on the client's PATH, and Claude Code 2.1.139 or later for the hooks.

Does Token Optimizer MCP send data anywhere?

The README says everything runs locally, there is no account or hosted service, and telemetry is off unless you opt in twice.

What happens if Node cannot start?

Hooks let the tool call through, so you lose the savings but not the session; the MCP server shows as disconnected.

How do I add Token Optimizer MCP to Claude Code?

Run this command in your terminal: claude mcp add token-optimizer-mcp -- npx -y @ooples/token-optimizer-mcp

What are the best alternatives to Token Optimizer MCP?

The closest alternatives to Token Optimizer MCP are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers