TokenSave alternative: trace-mcp vs TokenSave

TL;DR. TokenSave is a Rust-based code intelligence MCP server that indexes code into an embedded libSQL (SQLite) database with tree-sitter parsers across 50+ languages. It features 86 specialized MCP tools, subprocess-isolated grammar extraction, multi-branch indexing, git blame integration, and text replacement editing primitives.

The core architectural differences center on advertised prompt overhead, framework awareness, refactoring safety, and security. TokenSave advertises all 85+ tools by default on standard MCP hosts, consuming significant schema tokens on every session start, whereas trace-mcp ships a 28-tool minimal preset and dynamically escalates via load_tools. TokenSave extracts language syntax without resolving framework connections; trace-mcp builds semantic graph edges across 87 frameworks (routes, controllers, templates, ORM models). TokenSave edits code via string-replacement primitives; trace-mcp executes scope-aware AST refactorings with cross-file import rewrites and includes OWASP Top-10 taint analysis with SARIF output.

Pick TokenSave if you want a Rust binary indexing broad syntax across 50+ languages (including shaders, Basic dialects, and mainframe languages) with multi-branch database isolation. Pick trace-mcp if you develop web applications in modern frameworks, require compiler-calibrated 5-tier call graphs, need safe AST refactoring write tools, and want zero-setup distribution via npm.

Head-to-head

Capability trace-mcp TokenSave
GitHub stars 170 621
License MIT (permissive open-source) MIT (permissive open-source)
Written in TypeScript (Node.js) Rust (edition 2021)
Installation / Distribution npx -y trace-mcp@latest (npm registry) cargo binstall tokensave / Homebrew tap / Scoop / prebuilt binary
Underlying storage Embedded SQLite + FTS5 + local ONNX Embedded libSQL (SQLite fork) + FTS5 + ONNX runtime (ort)
Languages (AST parsing) 81 (tree-sitter WASM) 50+ (tree-sitter native, lite/medium/full tiers)
Framework integrations 87 semantic integrations ✗ (syntax AST only, no framework semantics)
Framework-aware edges ✓ route → handler, middleware, template, ORM
MCP tools defined 181 86 tools
Default advertised tools 28 (~11.6K tok, task presets) 85+ advertised on standard hosts (~12-15K tok schema)
Tool surface management Task presets (minimal, review, architecture, dev) + load_tools 5 tools marked anthropic/alwaysLoad; 85+ returned on tools/list
Call graph resolution 5-tier resolution (compiler_verified to fuzzy) with calibrated confidence Graph traversal (callers, callees, call_chain) over AST call sites
Refactoring capability ✓ AST-native safe transforms (rename, extract, move, codemods) String replacement primitives (str_replace, multi_str_replace, insert_at)
Security scanning ✓ OWASP Top-10 taint analysis, SARIF 2.1.0 ✗ (tokensave_unsafe_patterns syntactic grep only)
Session memory ✓ code-linked decision graph with staleness checks Text decisions with 14-day recency decay (tokensave_record_decision)
Extraction crash safety WASM sandbox (memory-safe, crash-isolated by runtime) Subprocess worker pool (extraction_worker.rs)
Multi-branch indexing Git-aware commit/file tracking in unified SQLite WAL Opt-in separate libSQL database per git branch

Verified on September 8, 2026 against TokenSave’s repository at master (v7.11.1, 621 stars). Tool definitions from src/mcp/tools/definitions.rs, server dispatch from src/mcp/server.rs, memory architecture from src/tokensave/memory.rs, storage and extraction from src/db/ and src/extraction/.

Key architectural differences

1. Tool Surface Management: 86 Advertised Tools vs. 28-Tool Minimal Preset

The number of tools an MCP server exposes directly impacts agent performance. Every tool definition consumes prompt tokens in the initial tools/list response, and large tool lists increase parameter hallucination and tool mis-selection rates (dispatch dilution).

TokenSave defines 86 MCP tools in get_tool_definitions(). In Anthropic-specific environments supporting the deferred-loading proposal (_meta: { "anthropic/alwaysLoad": true }), TokenSave tags 5 tools (tokensave_search, tokensave_context, tokensave_callees, tokensave_impact, tokensave_status). However, on all standard MCP hosts (including Claude Code, Codex CLI, Cursor, Antigravity, OpenCode, and Zed), the tools/list endpoint returns all 85+ tool definitions unconditionally. TokenSave’s own source comments in src/mcp/server.rs record this reality:

“The original metric only counted the tool’s own answer text, so overhead that’s very real to the model — 80+ tool schemas, the call itself, warning banners — was invisible.”

To balance this, TokenSave implements session debt accounting (settle_session_debt), charging the schema overhead against future token savings over multiple turns.

trace-mcp addresses context overhead architecturally through Adaptive Task Presets:

2. Pure Syntax Parsing vs. 87 Framework Semantic Integrations

Both trace-mcp and TokenSave parse source code using tree-sitter grammars. Where they diverge is how structural syntax is translated into architectural comprehension.

TokenSave is language-broad: it includes tree-sitter grammars for 50+ languages across three compilation tiers (lite with 11 core languages, medium with 9, and full adding 40+ including GLSL/HLSL/Metal shaders, CUDA, Fortran, Cobol, and Basic dialects). However, its extractors capture purely syntactic constructs: functions, classes, structs, methods, import statements, and call expressions. It contains no framework-specific extractors:

trace-mcp builds a true semantic code graph across 87 frameworks:

When an agent asks “what breaks if I change this endpoint parameter?”, trace-mcp traverses typed framework edges. In TokenSave, the agent must trace raw call sites and manually infer route bindings.

3. Code Modification: String Replacement Primitives vs. AST-Verified Refactoring

AI agents frequently introduce syntax errors or broken imports when editing code. The two tools approach code modification with fundamentally different primitives.

TokenSave provides string-level and regex-anchored editing tools:

While anchored string replacement is safer than raw shell sed commands, it operates on text slices rather than semantic symbols. If a symbol is renamed across a project, string replacement cannot update importing files or adjust lexical scopes.

trace-mcp provides a complete suite of AST-native refactoring write tools:

4. Memory Models: Text Recency Decay vs. Symbol-Bound Staleness Verification

Both tools provide persistent memory across agent sessions, recognizing that agents should not re-learn project architectural decisions from scratch on every turn.

TokenSave implements decision and code area memory (src/tokensave/memory.rs):

However, TokenSave’s decisions are stored as free-form text and path strings. If a referenced function is deleted, renamed, or refactored, the decision remains in the database and continues to be recalled.

trace-mcp implements Symbol-Bound Decision Memory:

5. Security & Quality Gates: General Intelligence vs. OWASP Top-10 Taint Analysis in CI

trace-mcp integrates static application security testing directly into the MCP server:

TokenSave includes tokensave_unsafe_patterns, which performs regex/AST pattern matching for known hazardous constructs (such as eval or unsafe blocks in Rust), but provides no cross-file taint analysis, no source-to-sink data flow tracking, and no SARIF report generation.

When to choose TokenSave

When to choose trace-mcp

Next steps

Last updated: September 8, 2026