
Echocache
io.github.kskurtveit由 GitHub 账号 kskurtveit 发布v0.1.3更新于 Oct 24, 2026
MCP server caching expensive LLM responses: HTTP-style freshness plus semantic recall.
概览
将昂贵的 LLM 结论缓存到本地 SQLite,支持 HTTP 式新鲜度与语义召回,供助手复用先前结果。
- 可以做什么
- Echocache 存储的是助手得出的结论,而不是它读过的内容。cache_get 与 cache_set 以模型、提示词和参数为键,并带有 TTL 与 stale-while-revalidate 新鲜度;cache_query 按语义查找相关条目;cache_related 沿相似度与 derived-from 图边遍历;cache_invalidate 删除条目并可级联到依赖项;cache_stats 报告命中率与已提供的 token 数。所有条目存放在一个可跨项目共享的 SQLite 文件中。
- 适用场景
- 当助手反复重新生成昂贵的研究或判断结论,或需要跨会话、跨主机重新理解某个代码库时,值得添加。README 指出它不适用于缓存文件读取,并且单一用户在同一主机的同一项目中,可能从宿主自带记忆中已获得大部分价值。
- 运行要求
- 作为本地 stdio 进程运行,通常用 npx -y echocache 启动,因此需要 Node.js 与 npm。不需要账号、API 密钥或网络访问。可选环境变量用于配置 SQLite 路径、LRU 上限、默认 TTL、相似度阈值和加密密钥。
安装
在 SourceWeft 中
- 打开 控制台中的 Echocache,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
echocache — MCP server for cached LLM responses
An MCP server for a cached LLM response — the way an HTTP cache caches an expensive server response, not the way a browser caches a static asset. Ask a question you already answered once, and the answer echoes back instead of being re-derived.
Two lookup paths, inspired by two different kinds of caching:
- Exact-match, HTTP-style —
cache_get/cache_setkey on(model, prompt, params), withttl_secondsandstale_while_revalidate_secondsbehaving likeCache-Control: fresh, stale, or expired. - Knowledge-graph recall — every stored entry is a node in a small similarity graph.
cache_queryfinds related entries by meaning, not just exact key;cache_relatedwalks graph edges (auto-linked "similar" entries, or explicit "derived-from" parents) to surface everything already known before an agent redoes work from scratch.cache_invalidatecan cascade through thosederived-fromedges when a source changes.
Runs as a standard stdio MCP server, so it works with Claude Code, Claude Desktop, Cursor, VS
Code + Copilot, or any other MCP-capable host — see Install below, and
AGENTS.md for the tool-use protocol any connected agent should follow.
What it's for — and what it isn't
Cache what an agent concluded, never what it read. This is the whole design, and it is worth stating plainly because the intuitive use is the wrong one: serving a cached file read costs the reader exactly the tokens that reading the file cost, since the content still has to enter the context. So caching file reads saves nothing at any hit rate, and if the agent re-emits the file to store it, that's output-rate tokens paid for zero benefit. A cache only pays when a hit stands in for regenerating something.
Where it pays, and where measurement said it does not:
- Pays best: an expensive research or judgment call. A real 22-tool-call research chain in this project's own history cost 37,119 output tokens to reach a 255-token conclusion — a 728x gap against serving that conclusion back, weighted for output pricing. A single reuse pays for the write ~145x over. Live-validated the same way with a fresh web-search-derived design decision, correctly recalled by different wording and correctly outranking an unrelated entry sharing surface vocabulary. Not proven to recur yet in this project's own history — but the payoff on one hit is large enough that low frequency isn't disqualifying, unlike a file read.
- Pays conditionally: re-orientation across sessions. An agent reads a codebase to understand
it, the session ends, and a later session needs that understanding again. On
express/lib— six files, 62KB — re-reading the source costs 15,504 tokens against 549 to serve the cached orientation, about 28× fewer. That holds when the later session genuinely needs broad understanding; if it only needs one specific answer, it will grep and read a slice for ~900 tokens, and the cache isn't competitive. - Does not pay: replacing reads in a parallel dispatch. Thirty subagents in one code-review
dispatch pulled ~374,000 tokens of content a sibling had already read — but 127 of their 166
reads used
offset/limit, so they were already taking slices rather than whole files. Substituting a shared derivation for those slices measured 27% worse than what they actually did: grep is already a cheap, precise pointer, and a cached map competes with it on its own ground and loses.
The rule all three point at: cache what grep cannot reconstruct. A conclusion, a judgement, the reason something is the way it is, a cross-file synthesis no single search reveals, a research finding, the fact that something is absent. Never a location — grep finds those for less than the cache costs to consult — and never a file.
When a cached entry does carry file paths or line numbers, that is to point a reader at exact
detail, not to replace reading it. And reach for cache_query rather than cache_get when
looking for a match: a later session, or another agent, will not phrase the question the way the
writer did.
What this is not: a way to avoid reading files, a source of truth, or a substitute for prompt caching within one conversation, which is cheaper and needs no server. echocache is for results that must outlive the context that produced them.
What Claude Code already does for free
If your only host is Claude Code, its own persistent memory already does the core of this: write a conclusion to a memory file instead of the files it came from, and a later session reads it back before redoing the work. That's the same rule this project converged on, running for free, with no server to register. This project's own findings and measurements from building it are stored there, not in echocache itself — worth noticing, since it means the tool wasn't used to cache the very research that produced it.
What's actually different, in order of how much it matters:
- Cross-project sharing. Claude Code's memory is scoped to one project directory. echocache is one SQLite file any project on the machine can register against, so a conclusion reached in one repo is queryable from another. Real, but unproven: this project's own history shows zero instances of a conclusion actually getting reused across sessions, and cross-project reuse is a narrower bar than that.
- Semantic recall.
cache_queryfinds a match by meaning, independent of how it was phrased or which file it's filed under. Memory is retrieved by an always-loaded index plus the agent's own judgment about what to open — no vector search. - Host-agnostic. Works from Cursor, VS Code, Claude Desktop, or any other MCP client — memory is native to Claude Code specifically.
- Explicit freshness. TTL/stale-while-revalidate freshness and hash-based
derived_frominvalidation catch a source going stale automatically. Memory has neither; staleness is caught only if an agent happens to notice.
For a single user on a single host in one project, memory already captures most of the value here for free. What's left as echocache's actual case is narrower than "a cache for LLM responses": it's specifically sharing a derivation across projects or hosts that don't already share a memory store — and that narrower case is unproven, not just untested, until it's been measured the way everything else in this document has.
Install
No clone or build needed — register it straight from npm.
Claude Code
Claude Desktop / Cursor / VS Code — add a stdio entry to the host's MCP config
(claude_desktop_config.json, .cursor/mcp.json, .vscode/mcp.json):
OpenCode — add an entry to opencode.jsonc (global: ~/.config/opencode/opencode.jsonc, or
project-level in the repo root):
Any other MCP-capable host takes the same launch command; only the config file differs. Then point
your agent at AGENTS.md so it knows when to reach for the cache — the protocol
matters more than the wiring, since caching the wrong things costs tokens rather than saving them.
The usage protocol also ships as skills (echocache-cache, echocache-gain), plus a
codebase-orienter subagent for Claude Code. Inside a clone of this repo they are discovered
automatically from .claude/skills/ and .opencode/skills/.
The npm package carries them too, but a host only discovers skills in its own skills directory, so
install them once after npm install -g echocache:
Configuration
Every setting is an environment variable, all optional:
The database directory is created 0700 and its files 0600. Set an encryption key to also
encrypt entry contents at rest:
Turning encryption on or off requires a fresh database — there is no in-place migration, and a key/database mismatch is refused at startup rather than failing on some later read.
Tools
One SQLite file backs all of them, shared across every project that registers the server — a conclusion reached in one repo is queryable from another. Concurrent readers and writers from separate processes are the expected case, not an edge case.
Developing
See CLAUDE.md for architecture and the module reference.
License
MIT
来源:README.md,提交 285892b
工具
0版本历史
1- v0.1.3最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分