Token Savior
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
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
Maintainer
Works with
Installation
PIP
pip install token-saviorManual Installation
pip install token-saviorConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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)
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]"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 --yesConfigure 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-saviorSet 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"
}
}
}
}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.
Token Savior Alternatives — Similar Developer Tools Servers
Looking for alternatives to Token Savior? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up Token Savior in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.