Token Savior

v0.9.1Developer Toolsstable

An MCP server that provides structural codebase indexing and surgical query tools to drastically reduce token usage through symbol-level searches and transitive impact analysis. It supports multiple languages and integrates with git to help AI agents

token-saviormcpai-integration
Share:
898
Stars
0
Downloads
0
Weekly
0/5

What is Token Savior?

Token Savior is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to mcp server that provides structural codebase indexing and surgical query tools to drastically reduce token usage through symbol-level searches and transitive impact analysis. it supports multiple lang...

An MCP server that provides structural codebase indexing and surgical query tools to drastically reduce token usage through symbol-level searches and transitive impact analysis. It supports multiple languages and integrates with git to help AI agents

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • An MCP server that provides structural codebase indexing and

Use Cases

An MCP server that provides structural codebase indexing and surgical query tool
Mibayy

Maintainer

LicenseMIT License
Languagepython
Versionv0.9.1
UpdatedMay 22, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

PIP

pip install token-savior

Manual Installation

pip install token-savior

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Token Savior

Token Savior is an MCP server that builds a structural index of your codebase and exposes surgical query tools so AI coding agents can find exactly what they need — a function definition, a symbol, or a dependency chain — without reading entire files. It supports multiple programming languages, integrates with git to track changes, uses SQLite-backed vector embeddings for persistent memory, and includes 34 Bash output compactors for tools like git, pytest, docker, and kubectl. The result is dramatically fewer tokens consumed per AI session — the authors report symbol-level queries returning 67 characters instead of 41 million.

Prerequisites

  • Python 3.10+ and pip installed
  • The token-savior-recall package (note: the PyPI package name is token-savior-recall, not token-savior)
  • An MCP-compatible AI coding client such as Claude Code, Cursor, or Cline
  • Git installed (for git-aware change tracking features)
1

Install token-savior-recall

Install the package with the mcp extra to include all MCP server dependencies. Note the package name on PyPI is token-savior-recall.

pip install "token-savior-recall[mcp]"
2

Initialize for your AI agent

Run the ts init command to configure token-savior for your agent (e.g., claude). This merges the necessary hook configurations into your agent's settings file idempotently.

ts init --agent claude --yes
3

Configure Claude Code to use token-savior as an MCP server

Add token-savior to your Claude Code MCP configuration, setting WORKSPACE_ROOTS to the directories you want indexed.

claude mcp add token-savior -- /path/to/venv/bin/token-savior
4

Set environment variables in your MCP client config

Configure WORKSPACE_ROOTS, TOKEN_SAVIOR_CLIENT, and TOKEN_SAVIOR_PROFILE in your client's env block. Optionally enable Bash compaction and command rewriting.

{
  "mcpServers": {
    "token-savior": {
      "command": "/path/to/venv/bin/token-savior",
      "args": [],
      "env": {
        "WORKSPACE_ROOTS": "/path/to/project1,/path/to/project2",
        "TOKEN_SAVIOR_CLIENT": "claude-code",
        "TOKEN_SAVIOR_PROFILE": "optimized",
        "TS_BASH_COMPACT": "1",
        "TS_BASH_REWRITE": "1"
      }
    }
  }
}
5

Verify the server is indexing your workspace

Ask your AI agent to find a symbol in your codebase. The server should return precise results immediately without the agent needing to read any source files.

Token Savior Examples

Client configuration (Claude Code)

Full MCP config for Claude Code using the optimized profile with Bash compaction enabled:

{
  "mcpServers": {
    "token-savior": {
      "command": "/path/to/venv/bin/token-savior",
      "args": [],
      "env": {
        "WORKSPACE_ROOTS": "/path/to/your/project",
        "TOKEN_SAVIOR_CLIENT": "claude-code",
        "TOKEN_SAVIOR_PROFILE": "optimized",
        "TS_BASH_COMPACT": "1",
        "TS_BASH_REWRITE": "1"
      }
    }
  }
}

Prompts to try

Use these prompts to leverage token-savior's surgical code search:

- "Find the definition of the UserService class in this codebase"
- "What functions call the process_payment method and what do they do?"
- "Show me the implementation of the authenticate function"
- "What files would be affected if I change the DatabaseConnection interface?"
- "Find all symbols related to error handling in the src/api directory"

Troubleshooting Token Savior

Command 'token-savior' not found after pip install

Ensure the virtual environment where you installed token-savior-recall is activated, or use the full path to the binary (/path/to/venv/bin/token-savior) in your MCP config. Alternatively, use uvx token-savior-recall to run without a venv.

WORKSPACE_ROOTS is set but the index appears empty

WORKSPACE_ROOTS must be a comma-separated list of absolute paths. Relative paths are not supported. Verify the paths exist and that the process has read access to them.

Bash compaction (TS_BASH_COMPACT) causes unexpected output truncation

Set TS_BASH_COMPACT=0 temporarily to disable compaction and verify the underlying commands are producing the expected output. If a specific tool's output is being over-truncated, report it as a compactor issue on the GitHub repository.

Frequently Asked Questions about Token Savior

What is Token Savior?

Token Savior is a Model Context Protocol (MCP) server that mcp server that provides structural codebase indexing and surgical query tools to drastically reduce token usage through symbol-level searches and transitive impact analysis. it supports multiple languages and integrates with git to help ai agents It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Token Savior?

Install via pip with: pip install token-savior. Then configure your AI client to connect to this MCP server.

Which AI clients work with Token Savior?

Token Savior works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Token Savior free to use?

Yes, Token Savior is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "token-savior": { "command": "pip", "args": ["install", "token-savior"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Token Savior?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides