MCP Directory

How to add Token Savior to Claude Desktop

Structural code navigation, persistent memory, and Bash output compaction for AI coding agents. Paste the config into ~/Library/Application Support/Claude/claude_desktop_config.json and restart Claude Desktop.

Last updated June 14, 2026 ยท 993โ˜… ยท stdio ยท no auth

Claude Desktop config for Token Savior

pip install "token-savior-recall[mcp]"
{
  "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"
      }
    }
  }
}

Setup steps

  1. 1Open Claude Desktop โ†’ Settings โ†’ Developer โ†’ Edit Config (this opens ~/Library/Application Support/Claude/claude_desktop_config.json).
  2. 2Paste the Token Savior config below under the top-level "mcpServers" key.
  3. 3Fill in any placeholder secrets (API keys, paths) in the snippet.
  4. 4Save the file, then fully quit and reopen Claude Desktop.
  5. 5Open a chat and confirm Token Savior's tools appear under the ๐Ÿ”Œ tools menu.

Before you start

  • Python 3.11+
  • An MCP-compatible client (e.g. Claude Code, Cursor, Gemini, Codex)
  • Install the token-savior-recall PyPI package (with the [mcp] extra), or run via uvx

What Token Savior can do in Claude Desktop

find_symbol

Locate a symbol (function, class, import) by name and navigate to it by pointer instead of reading the whole file โ€” e.g. find_symbol("send_message") returns ~67 chars vs a full-file read.

get_function_source

Return the source of a named function directly, replacing a grep + cat chain.

get_change_impact

Report the change impact / call-graph dependents for a symbol (e.g. get_change_impact("LLMClient")).

get_edit_context

Provide the surrounding context needed to make a safe edit at a location.

memory_index

Index/store persistent memory observations (decisions, bugfixes, conventions, guardrails, session rollups) into the SQLite WAL + FTS5 + vector store.

memory_search

Search the persistent memory store, ranked by Bayesian validity and ROI, for relevant prior context.

capture_get

Retrieve the full original output that was sandboxed when hybrid compact mode emitted only a compact preview for a bulky Bash result.

get_usage_stats

Report token-usage statistics: a 30-day ASCII sparkline, a 7-day daily breakdown table, top tools cumulative, with optional format="json".

Security

Core navigation and memory require no credentials. Optional integrations use environment variables: TS_API_KEY (only for LLM auto-extraction of memory observations via TS_AUTO_EXTRACT=1) and TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID (critical-observation feed). Bash compaction (TS_BASH_COMPACT=1) and the PreToolUse command rewriter (TS_BASH_REWRITE=1) are opt-in; the rewriter supports an optional JSONL audit log of every rewrite via TS_BASH_REWRITE_LOG. The server reads local Claude Code transcripts under ~/.claude/projects for ts_discover and benchmarking; args are pruned to load-bearing keys (described as PII-safe).

Token Savior + Claude Desktop FAQ

Where is the Claude Desktop config file?

Claude Desktop reads MCP servers from ~/Library/Application Support/Claude/claude_desktop_config.json. Paste the Token Savior config there under the "mcpServers" key and restart the client.

Is Token Savior safe to use with Claude Desktop?

Core navigation and memory require no credentials. Optional integrations use environment variables: TS_API_KEY (only for LLM auto-extraction of memory observations via TS_AUTO_EXTRACT=1) and TELEGRAM_BOT_TOKEN + TELEGRAM_CHAT_ID (critical-observation feed). Bash compaction (TS_BASH_COMPACT=1) and the PreToolUse command rewriter (TS_BASH_REWRITE=1) are opt-in; the rewriter supports an optional JSONL audit log of every rewrite via TS_BASH_REWRITE_LOG. The server reads local Claude Code transcripts under ~/.claude/projects for ts_discover and benchmarking; args are pruned to load-bearing keys (described as PII-safe).

Which profile should I use?

The README recommends `optimized` (set TOKEN_SAVIOR_PROFILE=optimized). It exposes 15 hot tools with a thin inputSchema (~1.5 KT manifest), disables capture sandboxing, and gates memory hooks for cross-project safety โ€” the configuration it reports as the Pareto win on tsbench. Other profiles: auto (adaptive), tiny (6 tools), lean (51), full (68).

How do I enable Bash compaction and command rewriting?

They are opt-in. Set TS_BASH_COMPACT=1 (PostToolUse output compactors) and/or TS_BASH_REWRITE=1 (PreToolUse rewriter), then run `ts init --agent claude --yes` to auto-merge the hook config into ~/.claude/settings.json. `ts init` is idempotent, prints a unified diff, and backs up settings.json before writing.

Can I use it without MCP?

Yes. The `ts` CLI exposes a subset of tools via shell for non-MCP agents (Cursor, Aider, Continue, scripts, CI): e.g. `ts use <path>`, `ts get <symbol>`, `ts search <pattern>`, `ts daemon start`. On Claude Code the README recommends the MCP server, which it measured as cheaper than the CLI on Opus 4.7.

View repo Full Token Savior page