Token Savior logo

Token Savior

by Mibayy

Indexes code by symbols, stores project memory, and compacts or rewrites Bash output for MCP coding agents.

Install Token Savior

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "mibayy-token-savior": {
      "command": "uvx",
      "args": [
        "token-savior-recall"
      ],
      "env": {
        "WORKSPACE_ROOTS": "YOUR_VALUE_HERE",
        "TOKEN_SAVIOR_CLIENT": "YOUR_VALUE_HERE",
        "TOKEN_SAVIOR_PROFILE": "YOUR_VALUE_HERE",
        "TS_BASH_COMPACT": "YOUR_VALUE_HERE",
        "TS_BASH_REWRITE": "YOUR_VALUE_HERE",
        "TS_BASH_REWRITE_LOG": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window — this can mean a slow first-time install rather than a real problem.

uvx token-savior-recall

No response to initialize.

This is an experimental automated check and can have false negatives — missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 24d ago.

Overview

Mibayy/token-savior MCP server gives coding agents structural code navigation, persistent memory, and optional Bash output compaction or command rewriting. It indexes symbols such as functions, classes, imports, and call relationships so agents can query code by structure rather than reading whole files. Configuration uses a stdio MCP command with workspace roots and optional client and profile settings. Reach for it when repeated codebase exploration, lost session context, or verbose shell output is consuming an agent's context budget.

Use cases

  • Navigate large codebases by symbol relationships
  • Carry decisions and conventions between coding sessions
  • Compact verbose Git, test, cloud, and shell output
  • Rewrite Bash commands before execution
  • Inspect transcripts for missed structural-tool opportunities

Key features

  • Symbol-indexed code navigation
  • Persistent SQLite, FTS5, and vector memory
  • PostToolUse Bash output compactors
  • PreToolUse Bash command rewriting
  • Transcript analysis with ts_discover
  • Optimized MCP profile

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

16/16 checks healthy over the last 30d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 9d ago via OSV.dev · token-savior-recall (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars1.2kStargazers on the source repository.
Last commit12d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window — often a slow first install.
Directory activity4 viewsConfig copies, upvotes, and views on AllMCPs.

How Token Savior works

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:

Terminal
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.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Token Savior

Mibayy/token-savior is an MCP server that connects AI coding agents to indexed project workspaces and Claude Code transcript data. Its main capabilities are structural code navigation by symbols and relationships, persistent session memory, Bash output compaction, Bash command rewriting, and the ts_discover tool for finding missed opportunities.

Install it with `pip install "token-savior-recall[mcp]"`, then add the installed `token-savior` executable to your MCP configuration. Set `WORKSPACE_ROOTS` to the project paths, and optionally provide a client name or the `optimized` profile.

Set `TS_BASH_COMPACT=1` before starting the server or agent, then optionally run `ts init --agent <agent> --yes` to merge hooks into the supported agent configuration. Compaction runs after commands return and appends a compact rendering without removing the raw output.

Set `TS_BASH_REWRITE=1` to enable the PreToolUse command rewriter. Use `ts init` to install the relevant hooks for Claude, Cursor, Gemini, Codex, or OpenClaw. Rewrites occur before execution, and `TS_BASH_REWRITE_LOG` can record them as JSONL.

Yes. Cursor-specific hook installation is available through `ts init --agent cursor`; Bash features remain opt-in.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewToken Savior AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/mibayy-token-savior?style=directory)](https://allmcps.com/mcp/mibayy-token-savior)
HTML Embed
<a href="https://allmcps.com/mcp/mibayy-token-savior"><img src="https://allmcps.com/api/badge/mibayy-token-savior?style=directory" alt="Token Savior on AllMCPs" /></a>