save-token
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@save-token run a JS snippet to parse these logs, then show how many tokens we saved"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
save-token
Language: English | Tiếng Việt
Zero-dependency universal token-saving MCP server, CLI-first playbook, browser tight-scoping ladder, and 0-LLM cross-session handoff for AI coding & research agents.
Works across Antigravity, Claude Code, Codex, DeepSeek Harness (dsh), Cursor, Gemini CLI, and any stdio MCP host using built-in Node.js >= 22.5 (node:sqlite, node:vm, node:child_process) with 0 npm runtime dependencies.
Supported Platforms
Platform | Config / Skill Targets | Install Command |
Auto-detect (Recommended) | Detects installed harnesses + installs |
|
Antigravity |
|
|
Claude Code |
|
|
Codex |
|
|
DeepSeek Harness ( |
|
|
Cursor |
|
|
Gemini CLI |
|
|
All platforms | Installs every target above without clobbering existing config keys |
|
Options: Add
--dry-runto preview changes,--skip-browserto skip installingagent-browser, or--uninstall --target <name>to cleanly removesave-tokenentries without touching your other MCP servers.
Related MCP server: hypercontext
6 MCP Tools
save_token_exec: Persistent JS REPL (stateacross turns,await $`...`.compact()RTK-style log compactor,tools.fetchText(url)clean web/JSON reader,tools.detectClis(),tools.saveMemory/loadMemory,tools.glob/grep/readMany/edit/batchReplace) with automatic SQLite FTS5 BM25 + Trigram indexing and structural JSON truncation.save_token_poll: Monitor, wait for, or kill background commands spawned bytools.spawnBg(cmd)with optional.compactand FTS5intent.save_token_search: Query indexed outputs across current and previous sessions.save_token_handoff: Zero-LLM session handoff builder that persists selectedstatekeys intokv_memoryand writes a compact.mdsnapshot (also extracts prompts/files/errors when given atranscriptPathor AntigravityconversationId, including Voice Mode utterances).save_token_resume: 3-layer progressive disclosure resume (()list ->({ handoffId: "latest" })summary + keys ->save_token_search/tools.loadMemory).save_token_stats: Reports realrawProcessedvsreturnedToContextbytes,%saved,state,kv_memory, FTS5 sources, and jobs.
Quick Start
git clone https://github.com/rikkurea-boop/save-token.git
cd save-token
npm test # Runs 14 MCP E2E tests + cross-platform installer tests
node install.mjs # Auto-detects & configures your installed agent harnessesDeepSeek Harness (dsh) Extra Step
install.mjs --target dsh installs the skill to ~/.agents/skills/save-token (loaded automatically by @deepseek-ai/dsh-skill-filesystem) and writes ~/.dsh/save-token.cordis.yml. Copy the - id: mcp-save-token block into your cordis.yml plugins: list (see adapters/dsh-cordis.yml).
Default Browser CLI (agent-browser)
node install.mjs automatically installs agent-browser globally (npm install -g agent-browser) if it is not already on your PATH, enabling zero-screenshot browser automation (snapshot -i accessibility tree with @e1 refs, react, network, webmcp). Pass --skip-browser if you only want the MCP server and skills.
Requirements & Verification
Node.js
>= 22.5.0(Node 24+ recommended; uses built-innode:sqlite).Zero external npm runtime dependencies.
Verified on Windows 11 and macOS Apple Silicon (
arm64):npm test(server/test-save-token.mjs+server/test-installer.mjs).
Author & License
Author: Rikku_desu~
Repository: https://github.com/rikkurea-boop/save-token
License: MIT
Available Tools
6 toolssave_token_execB
Universal token-saving JS REPL across code, data, docs, static web, and CLIs: persists state across turns, runs await $`...`.compact(), tools.fetchText(url), tools.compactOutput(), tools.detectClis(), tools.saveMemory/loadMemory, tools.*, and indexes large output into SQLite FTS5+Trigram.
Inputs: code (required), cwd, mode, intent, +3 more.
save_token_handoffA
Build a zero-LLM session handoff snapshot: optionally extracts prompts/touched files/errors from a transcript, persists chosen state keys into SQLite kv_memory, and writes a compact .md file for starting a fresh chat.
Inputs: title (required), goal, project, maxChars, +6 more.
save_token_pollB
Check, wait for, or kill background jobs started via tools.spawnBg(cmd) with optional RTK compaction (compact) and FTS5 intent filtering.
Inputs: jobId (required), kill, intent, waitMs, +2 more.
save_token_resumeA
3-layer progressive disclosure resume from previous sessions: omit handoffId for a compact list; pass 'latest' or <id> for summary, memoryKeys, and indexedSources.
Inputs: handoffId.
save_token_searchB
Query large outputs and indexed sources stored in persistent SQLite (Porter BM25 + Trigram) across current and previous sessions.
Inputs: queries (required), limit, source, maxOutputChars.
save_token_statsB
Report real byte/token savings (rawProcessed vs returnedToContext), active state keys, persisted kv_memory, FTS5 sources, handoffs, and background jobs.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool has a largely distinct role: exec runs code, search queries indexed data, poll manages background jobs, handoff creates a session snapshot, resume reloads one, and stats reports metrics. There is some conceptual overlap between exec's indexing/output handling and search, but the descriptions make the intended division clear enough.
All tools use the same `save_token_` prefix and snake_case convention, making the set easy to scan. The suffixes are mostly verbs or clear action nouns, with `handoff` and `stats` being noun-like but still consistent within the server's vocabulary.
Six tools is well-scoped for a token-saving/session-continuity server. Each tool covers a distinct lifecycle stage: execution, search, background polling, handoff, resume, and reporting.
The surface covers the main token-saving workflow: run/compact, index/search, background jobs, session handoff, resume, and stats. Minor gaps exist around explicit cleanup or deletion of persisted memory/indexed sources, but agents can likely work around this through exec.
Maintenance
Related MCP Connectors
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
A paid remote MCP for AI agent browser DevTools MCP, built to return verdicts, receipts, usage logs,
System-of-record notebook for AI coding agents: pages, datastores, tasks, skills over MCP.
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables AI coding agents and local LLMs to store and recall project memory, compact verbose logs, look up code symbols, create and rewind workspace snapshots, detect risky commands and loops, pack context optimally, and draft tokens through MCP tools.102Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables AI coding agents to execute tools in a sandbox, retain searchable persistent memory, and reversibly compress long conversation histories through a unified MCP endpoint.5-
- AlicenseAqualityBmaintenanceEnables agents to accomplish multi-step work by writing a single sandboxed JavaScript program that drives shell, filesystem, HTTP, and every tool of any configured MCP server, returning only a small summary instead of raw JSON. This collapses dozens of advertised tool schemas into one tool, cutting per-request context by roughly 26× while keeping disabled upstream servers reachable.164 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables coding agents to reach every configured MCP server through just three tools (search, describe, execute) and a sandboxed JavaScript runtime, so a model writes one short program instead of making dozens of tool calls. Runs without network, filesystem, or credential access, returning only the result.28 npm9MIT