# Token Optimizer MCP

> Token Optimizer MCP is an MCP server for ai models and llm tooling. Hooks, a proxy and MCP server that trim wasted tokens in AI coding agents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI, Self-hosted, macOS, Windows, Linux
- **Repository:** https://github.com/ooples/token-optimizer-mcp
- **MCP Registry name:** io.github.ooples/token-optimizer-mcp
- **Categories:** [AI models and LLM tooling](https://ai-powered.com/categories/ai-and-llm), [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-23

## About

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.

## Features

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

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
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.

### Claude Code: Or share it with your project (.mcp.json)

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

### Claude Desktop (claude_desktop_config.json)

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

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

### Cursor (~/.cursor/mcp.json)

```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.

### VS Code (~/.copilot/mcp-config.json)

```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.

### Codex: Add with the CLI (Terminal)

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

### Codex: Or add to config.toml (~/.codex/config.toml)

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

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

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

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```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.

### Devin Desktop (~/.config/devin/mcp_config.json)

```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.

### Cline (cline_mcp_settings.json)

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

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

### Zed (Zed settings.json)

```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.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

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

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

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

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

### Kiro (~/.kiro/settings/mcp.json)

```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.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "token-optimizer-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@ooples/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.

## Alternatives

- [REA](https://ai-powered.com/mcp/rea): REA is an open-source MCP server for developer tools.
- [Context7](https://ai-powered.com/mcp/context7): Context7 is a freemium MCP server for developer tools.
- [Chrome DevTools MCP](https://ai-powered.com/mcp/chrome-devtools-mcp-2): Chrome DevTools MCP is an open-source MCP server for browser automation.
- [Codebase Memory](https://ai-powered.com/mcp/codebase-memory): Codebase Memory is an open-source MCP server for knowledge and memory.
- [GitHub](https://ai-powered.com/mcp/github): GitHub is an open-source MCP server for developer tools.
- [Serena MCP: the IDE for your agent](https://ai-powered.com/mcp/serena-mcp-the-ide-for-your-agent): Serena MCP: the IDE for your agent is an open-source MCP server for developer tools.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.

---
Source: https://ai-powered.com/mcp/token-optimizer-mcp
