toke-local

toke-local

A local, zero-dependency MCP server that cuts coding-agent round-trips by aggregating search, read, edit, exec, git, and savings tools into single, validated calls, with cost tracking and no data leaving the machine.

Category
访问服务器

README

toke-local

A local, zero-dependency MCP server that cuts the round-trips, re-reads and log floods out of coding agents — the same tool-aggregation model published by the commercial Tokeasy (tokeasy.net), implemented from scratch, auditable, and fully local.

12 calls  →  glob → grep → read → read → read → edit ✕ → re-read → retry → verify…
2 calls   →  agent_search → agent_edit

Every savings number is labeled counted / measured / estimated and every pricing assumption is a named constant in source.

Features

Tool What it does Saves
agent_search glob + grep + read + import graph in one ranked call: matches with score, context lines, per-file imports and reverse imported_by 4–5 calls → 1
agent_read structure-aware truncation: imports/types/interfaces/signatures kept, long bodies stubbed ([body omitted: N lines]); mode:"full" for the whole file full-file dumps → ~10–20% of bytes
agent_edit batched, multi-file edits; fuzzy match tolerates whitespace and quote drift; TS/JSON/YAML/Python validated before any write; invalid output rejected, ambiguous hunks refused failed-edit re-read + retry loops
agent_exec accepted command → failure-preserving digest: exit code, all failure lines, per-line ~200-char cap, receipt stored for exact fetch-back; wait_ms and until:regex; timeout kills 100 KB log → ~2 KB digest
agent_git branch, upstream, remote, ahead/behind, dirty, files changed, diffstat, recent commits, stash, merge state in one call 5+ git calls → 1
agent_savings persistent ledger with labeled totals (counted/measured/estimated), estimate, receipts, reset transparency (measure, don't guess)
[now: … UTC] every response stamps the clock, so the agent stops wasting a call asking the date 1 call per session

Plus safety: edits are applied snapshot-safe (immutable blob + 3-way merge + atomic write via the sibling snapedit project), path traversal (../) and symlink escapes are blocked with out_of_scope, and no code ever leaves your machine.

Benchmark

npm run bench reproduces the site's five benchmark categories (VR physics, worker provisioning, security audit, financial research, mobile refactor) with real tool outputs measured end-to-end and the session-transcript economics modeled with named constants:

Task Vanilla toke-local Δ
VR physics simulation game $3.00 $0.08 −97.4%
SaaS worker provisioning $1.99 $0.07 −96.2%
SaaS security audit $1.46 $0.07 −94.9%
Financial deep research $2.40 $0.07 −96.9%
Mobile app multi-day refactor $2.46 $0.07 −97.0%
Whole suite $11.32 $0.38 −96.6%

Honest caveat: this is a modeled benchmark (local measured tool outputs + published list-price constants), not a billed agent session. Real-world savings depend on how read/retry-heavy the workload is — the same mechanisms the commercial product documents as ~20% on its own suite. The happy-path claim is: architecturally the identical cost drivers are removed, measured locally rather than published by a committee. See docs/BENCHMARK.md.

Install

Requires Node ≥ 18. No runtime dependencies.

git clone https://github.com/rianprei/toke-local
cd toke-local

Connect to any MCP client

The server speaks JSON‑RPC 2.0 over stdio. Point Claude Code, Codex, opencode, Cursor, Copilot or Windsurf at:

node bin/toke-local mcp

Claude Code example:

claude mcp add toke-local -- npx -y github:rianprei/toke-local -- mcp   # or: node /abs/path/bin/toke-local mcp

CLI

toke-local mcp | search | read | edit | exec | git | savings [json-args]

Example:

node bin/toke-local search '{"query":"renderInvoice","root":".","context_lines":2}'
node bin/toke-local read '{"file":"src/invoice.ts"}'
node bin/toke-local edit '{"cwd":".","edits":[{"path":"src/invoice.ts","old_text":"…","new_text":"…"}]}'

Tests

npm test        # 25/25 pass (node:test, zero deps)
npm run bench   # the benchmark above

Repository layout

bench/bench.js         benchmark harness (5 tasks, vanilla vs toke, named constants)
bin/toke-local         executable entry point
src/server.js          MCP JSON‑RPC server (initialize, tools/list, tools/call)
src/cli.js             CLI dispatch
src/tools/             the six tools
src/ledger.js          savings ledger (labeled) with named constants
src/syntax.js          validators (TS/JS/JSON/YAML/Python)
src/util.js            tsHeader + small helpers
test/toke-local.test.js  25 tests
docs/                   architecture, benchmark methodology, runbook

License

MIT © 2026 rianprei — see LICENSE. Built to be the open, local, auditable alternative to a closed commercial MCP kit. Code never leaves your machine.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选