# Mibayy/token-savior [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/Mibayy/token-savior  
**GitHub Stars:** 1229  
**Views:** 7  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mibayy-token-savior

## Description
Structural code intelligence MCP server for AI-assisted development. Navigate and edit code by symbol names instead of raw text — symbol lookup, dependency graphs, call chains, dead code detection, and structural diff. Replaces grep/cat with semantic tools: 87% token reduction on large codebases.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "token-savior": {
    "command": "uvx",
    "args": ["token-savior-recall"],
    "env": {
      "WORKSPACE_ROOTS": "",
      "TOKEN_SAVIOR_CLIENT": "",
      "TOKEN_SAVIOR_PROFILE": "",
      "TS_BASH_COMPACT": "",
      "TS_BASH_REWRITE": "",
      "TS_BASH_REWRITE_LOG": ""
    }
  }
}
```

**Requires environment variables:** `WORKSPACE_ROOTS`, `TOKEN_SAVIOR_CLIENT`, `TOKEN_SAVIOR_PROFILE`, `TS_BASH_COMPACT`, `TS_BASH_REWRITE`, `TS_BASH_REWRITE_LOG` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Mibayy/token-savior does

Mibayy/token-savior MCP server is designed for AI-assisted software development. It indexes a workspace around code symbols, including functions, classes, imports, and call relationships. That index supports structural navigation instead of requiring an agent to search and print large portions of files.

The project adds two optional Bash features. PostToolUse compactors produce shorter renderings for commands such as Git, GitHub CLI, test runners, cloud tools, Docker, package managers, and common shell commands. A separate PreToolUse rewriter changes selected commands before execution. The README cautions that post-tool compaction does not reduce the output in the current turn; the raw output remains available, while the compact form is appended and retained in the capture sandbox.

## How it works

The server runs as a local MCP process and receives one or more workspace roots through configuration. Its code index lets an agent work from symbol-oriented references and relationships. Memory can be reintroduced as a compact delta at the start of a later session.

Bash behavior is controlled independently. Set `TS_BASH_COMPACT=1` to enable the PostToolUse compactors, or `TS_BASH_REWRITE=1` to enable the PreToolUse rewriting rules. An optional JSONL path records rewrites through `TS_BASH_REWRITE_LOG`. The `ts_discover` tool scans Claude Code transcripts for missed opportunities to use Token Savior features, including repeated read/search sequences and native shell operations on code files.

## Setup and configuration

Install the MCP extra from PyPI:

```bash
pip install "token-savior-recall[mcp]"
```

A configuration entry points to the installed `token-savior` executable and supplies `WORKSPACE_ROOTS`. `TOKEN_SAVIOR_CLIENT` identifies the client, while `TOKEN_SAVIOR_PROFILE=optimized` selects the documented profile with a smaller tool manifest, reduced input schemas, disabled capture sandboxing, and gated cross-project memory hooks.

The optional `ts init` command can merge hook settings for Claude, Cursor, Gemini, Codex, or OpenClaw. It supports dry runs, global configuration, duplicate detection, unified diffs, and timestamped backups.

## Tools and capabilities

- Structural code navigation through indexed symbols and relationships.
- Persistent project and session memory backed by SQLite and FTS5.
- Bash output compactors for Git, tests, cloud commands, Docker, packaging, and shell utilities.
- Pre-execution Bash rewriting with optional audit logging.
- `ts_discover` analysis of Claude Code transcripts and adoption patterns.
- Optimized MCP profile with a reduced manifest and compact schemas.

## Limitations and notes

The Bash compactors run after a command returns, so they cannot shrink the current model turn. They preserve raw output and add a compact rendering; use the PreToolUse rewriter when the command itself must be changed before execution. Compound commands can fall through to the final meaningful segment.

The README reports benchmark results but says the harness and fixtures are not publicly available, so those figures should be treated as reported rather than independently verified. The project requires Python 3.11 or newer. Client hook setup is separate from MCP installation, and Bash compaction and rewriting are opt-in.

_Full upstream README: https://allmcps.com/mcp/mibayy-token-savior/readme_

