# Token Pilot

> Token Pilot is an MCP server for developer tools. Cut the tokens AI coding assistants spend reading code with structural reads. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Platforms:** CLI
- **Repository:** https://github.com/digital-threads/token-pilot
- **MCP Registry name:** io.github.Digital-Threads/token-pilot
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools), [AI models and LLM tooling](https://ai-powered.com/categories/ai-and-llm)
- **Listing updated:** 2026-11-23

## About

Instead of loading whole files, Token Pilot hands an assistant an outline or a single function. The README's example: a 500-line file costs about 3,000 tokens to read, a 15-line outline about 200, one method about 350, and a post-edit diff about 20. Files under 200 lines come back whole. On its own benchmark of four public repos it reports 92 percent savings on outlines alone.

It has two layers. The MCP server exposes 25 tools for structural reads, symbol search, git analysis and session analytics, and PreToolUse hooks intercept heavy native Read, recursive Grep and unbounded git diff calls on Claude Code and Codex CLI. An enforcement mode setting (advisory, deny or strict) controls how hard it redirects; strict also caps output and refuses edits of code files not prepared with read_for_edit.

Setup is npx -y token-pilot init, which writes .mcp.json. Cursor, Gemini CLI, Cline and Antigravity get the MCP tools without hooks. It parses TypeScript, JavaScript, Python, Go, Rust, Java, Kotlin, C#, C/C++, PHP and Ruby.

## Features

- **Outline reads:** smart_read returns a short outline instead of a full file.
- **Symbol reads:** read_symbol loads one function or method by name.
- **Edit preparation:** read_for_edit prepares a section for editing.
- **Diff after edits:** read_diff shows only what changed after an edit.
- **Hooks:** PreToolUse hooks redirect heavy Read, Grep and git diff calls on Claude Code and Codex CLI.
- **Enforcement modes:** advisory, deny (default) or strict via TOKEN_PILOT_MODE.
- **Tool profiles:** Trim the advertised tool list to save about 2k tokens per session.

## Good for

- Reduce context spend in long coding sessions
- Navigate a large repo by symbol
- Keep a premium model's main thread lean
- Find usages of a function without grepping the tree

## Install

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

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

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-pilot": {
      "command": "npx",
      "args": [
        "-y",
        "token-pilot"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

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

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

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

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

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

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

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

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-pilot -- npx -y token-pilot
```

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

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

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

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

Or run: gemini mcp add -s user token-pilot npx -- -y token-pilot

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

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

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

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

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

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-pilot": {
      "command": "npx",
      "args": [
        "-y",
        "token-pilot"
      ]
    }
  }
}
```

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

### Zed (Zed settings.json)

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

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-pilot": {
      "command": "npx",
      "args": [
        "-y",
        "token-pilot"
      ]
    }
  }
}
```

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

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

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

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

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

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-pilot": {
      "command": "npx",
      "args": [
        "-y",
        "token-pilot"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, 5 of 6 tools read data; 1 name doesn't say. From the server's own tool labels and tool names; not verified by us.

- `smart_read` (name suggests: reads): Returns a structural outline of a file instead of its full text.
- `read_symbol` (name suggests: reads): Loads a single function or method by name.
- `read_for_edit` (name suggests: reads): Prepares code for editing; strict mode requires it before edits.
- `read_diff` (name suggests: reads): Shows what changed in a file after an edit.
- `find_usages` (name suggests: reads): Finds where a symbol is used.
- `smart_log`: Summarizes git history, capped to recent commits in strict mode.

## FAQ

### Which clients does Token Pilot support?

MCP tools work in Claude Code, Codex CLI, Cursor, Gemini CLI, Cline and Antigravity; hooks only on Claude Code and Codex CLI.

### How do I install Token Pilot?

Run npx -y token-pilot init, then restart your assistant.

### Does Token Pilot change small files?

No. Files under 200 lines are returned in full.

### Which languages does Token Pilot understand?

TypeScript, JavaScript, Python, Go, Rust, Java, Kotlin, C#, C/C++, PHP and Ruby, with regex fallback for others.

### How do I add Token Pilot to Claude Code?

Run this command in your terminal: claude mcp add token-pilot -- npx -y token-pilot

### What are the best alternatives to Token Pilot?

The closest alternatives to Token Pilot 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.
- [XERJ](https://ai-powered.com/mcp/xerj): XERJ is an open-source MCP server for knowledge and memory.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.

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