# token-pilot MCP server

> Reduces AI coding token consumption by up to 90% using AST-aware structural reads and tool interception hooks.

- Repository: https://github.com/Digital-Threads/token-pilot
- Page: https://hostedmcp.org/servers/digital-threads/token-pilot
- Transport: stdio
- Stars: 5
- Latest version: 2.0.0

## Install

### Claude Code

```sh
claude mcp add token-pilot -- npx -y token-pilot
```

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

```json
{
  "mcpServers": {
    "token-pilot": {
      "command": "npx",
      "args": [
        "-y",
        "token-pilot"
      ]
    }
  }
}
```

### VS Code (`.vscode/mcp.json`)

```json
{
  "servers": {
    "token-pilot": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "token-pilot"
      ]
    }
  }
}
```

### VS Code CLI

```sh
code --add-mcp '{"name":"token-pilot","type":"stdio","command":"npx","args":["-y","token-pilot"]}'
```

### Claude Desktop (`claude_desktop_config.json`)

```json
{
  "mcpServers": {
    "token-pilot": {
      "command": "npx",
      "args": [
        "-y",
        "token-pilot"
      ]
    }
  }
}
```

### Codex

```sh
codex mcp add token-pilot -- npx -y token-pilot
```

### Codex config.toml (`~/.codex/config.toml`)

```toml
[mcp_servers.token-pilot]
command = "npx"
args = ["-y", "token-pilot"]
```

### Gemini CLI

```sh
gemini mcp add -s user token-pilot npx -- -y token-pilot
```

### Gemini settings.json (`~/.gemini/settings.json`)

```json
{
  "mcpServers": {
    "token-pilot": {
      "command": "npx",
      "args": [
        "-y",
        "token-pilot"
      ]
    }
  }
}
```

## Environment variables

| Name | Required | Secret | Description |
|---|---|---|---|
| `TOKEN_PILOT_MODE` | no | no |  |

## FAQ

### How much can I save on tokens?

You can save up to 90% of context consumption in AI coding assistants.

### What happens to small files?

Files that are under 200 lines are returned in their entirety with no added overhead.

### Which AI clients are supported?

It supports Claude Code and Codex CLI with full MCP tools and hooks, while clients like Cursor, Gemini CLI, and Cline support the MCP tools.

### What are the enforcement modes?

There are three modes: advisory (allows all), deny (blocks heavy calls, default), and strict (blocks heavy calls and auto-caps MCP output).
