Skip to main content
Glama

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DOBOCACHE_LOG_DIRNoWhitebox log directory. Use an absolute path; relative paths are resolved against the server process cwd. Defaults to the platform standard directory: Windows %LOCALAPPDATA%\DoboCache\logs, macOS ~/Library/Logs/DoboCache, Linux $XDG_STATE_HOME/dobocache or ~/.local/state/dobocache.
CACHEFORGE_LOG_DIRNoLegacy alias for DOBOCACHE_LOG_DIR. If both are set, DOBOCACHE_LOG_DIR takes precedence.
DOBOCACHE_WHITEBOXNoWhitebox report card mode: quiet (write logs only; default), once (return a report once, then revert to quiet), or always (return a report every time; approximately 300+ tokens per call). Other values are ignored with a stderr warning.quiet
CACHEFORGE_WHITEBOXNoLegacy alias for DOBOCACHE_WHITEBOX. If both are set, DOBOCACHE_WHITEBOX takes precedence.
DOBOCACHE_LOG_MAX_MBNoMaximum size in MB for a single log file before it is rolled to .1. Must be an integer from 1 to 1024. Invalid values fall back to the default with a stderr warning.10
DOBOCACHE_LOG_KEEP_DAYSNoLog retention period in days, including today. Must be an integer from 1 to 365. Older logs are cleaned on the first write of the day. Invalid values fall back to the default.7
DOBOCACHE_HIT_PRICE_PER_MNoHit price coefficient used for relative cost calculations in cf_meter / cf_report. Must be a finite number >= 0. Invalid values fall back to the default and print a stderr warning.0.014
CACHEFORGE_HIT_PRICE_PER_MNoLegacy alias for DOBOCACHE_HIT_PRICE_PER_M. If both are set, DOBOCACHE_HIT_PRICE_PER_M takes precedence.
DOBOCACHE_MISS_PRICE_PER_MNoMiss price coefficient used for relative cost calculations in cf_meter / cf_report. Must be a finite number >= 0. Invalid values fall back to the default and print a stderr warning.0.5
CACHEFORGE_MISS_PRICE_PER_MNoLegacy alias for DOBOCACHE_MISS_PRICE_PER_M. If both are set, DOBOCACHE_MISS_PRICE_PER_M takes precedence.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

DoboCache 是本地 stdio MCP server,用于稳定化上下文前缀以命中厂商 prompt cache,并输出可追溯的白盒报告。 典型顺序:cf_tier 做价值分级准入 → cf_inject 注入(首次请求 reset=true,后续请求同 sessionId 复用冻结前缀)→ 需要时 cf_warmup 预热。 观测口径:cf_meter 报当前进程内即时快照(重启归零),cf_report 读本地日志做跨进程/跨天累计并给出日志实际落点(logDir / logDirSource);日志仅写本机,不含提问原文。 白盒卡片默认关闭:默认只在本地写日志、不往对话里塞报告,累计数据用 cf_report 随时查(不占对话 token);想看每次详情可设 DOBOCACHE_WHITEBOX=once(看一次)或 always(每次都看)。 命中率只认厂商回传的缓存 usage;调用方未回传 usage 时记为"未判定"(null),不按 0% 计。 所有工具均在本地计算,不发起任何网络请求,不上传任何数据。 平台说明:Windows 为已验证的主打平台;Linux / macOS 仅有单元测试覆盖,未经真机验证。

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
cf_pingA

连通性自检(最先调这个):返回 pong: dobocache ready 表示 MCP 服务已正常加载;同时探测代理端口并给出结构化结论——proxy: listening 表示改写链路在跑,refused 表示代理没起(此时请求不会被改写),listening_other 表示端口被别的程序占用,timeout 表示代理卡住。用户说「没反应 / 没效果 / 不生效」时先调它定位。

cf_judgeA

判定当前请求能否命中既有缓存上下文:关键词分层(实体锚词/意图修饰词)、三层匹配、时效衰减、负向过滤,输出可解释证据。【何时调】要判断「这段历史/记忆值不值得复用、能不能命中」时,在 cf_inject 之前调一次;不要每轮都调。

cf_tierA

对候选记忆/上下文片段做价值分级准入:提纯去噪 → A/B/C 分级 → 按预算从高到低填充,输出准入列表与丢弃明细。【何时调】候选片段超出预算、需要决定「留哪些、丢哪些」时;片段很少(不足 5 条)可直接注入,不必先分级。

cf_injectA

会话增量注入:固定版本化前缀(规则块+分级片段+固定补充块)逐字节不变,新内容(本次请求+易变内容)只追加到尾部 tail;同一 sessionId 自动冻结前缀支持跨请求复用;前缀不足最小有效长度时自动补高价值片段/固定文档块过门槛。【何时调】发请求前需要稳定前缀时:同一会话首次 reset=true,之后同一 sessionId 增量追加;短对话、一次性提问不必调用。

cf_meterA

输出测量仪表快照:判定命中率、平均分、价值分级分布、预计命中 token/比例;v0.2.1 新增按请求累计计费相对值曲线(累计命中/未命中 tokens)。注意:此处的 hitRate 是「cf_judge 判定命中率」(DoboCache 内部召回判定口径),且无判定样本时为 null(未判定,勿读作 0%);厂商 usage 回传的真实缓存命中率请看 cf_report 的 hitRate / judgedCalls。【何时调】用户问「当前判定/召回质量」时;问「真实缓存命中多少」请改用 cf_report(读落盘日志、跨进程累计)。

cf_warmupA

预热工具(v0.2.1):在正式请求前显式调用一次,用当前冻结前缀(sessionId)或传入片段构造最小占位请求;客户端需将返回的 prompt 发一次 LLM 请求以触发厂商前缀缓存建立。注意:必须显式调用、默认不自动触发;该占位请求本身会产生少量计费(按未命中计价系数);命中率无法由 server 侧确认,请以下一次请求的 usage 为准。【何时调】确认紧接着会有一次长上下文请求、想先把厂商缓存建立起来时;日常短任务不要调(占位请求本身也要计费)。

cf_reportA

历史报表:从本地白盒日志汇总请求次数、厂商 usage 真实缓存命中率、原始/优化 token、预计命中 token 与命中比例,【何时调】任务收尾、或用户问「缓存效果怎么样/命中多少」时调一次即可(读落盘日志,跨进程跨天累计,重启不丢);不要每轮轮询。支持 total / per_session 聚合,附带 cardMode(白盒卡片档位,默认 quiet)。与 cf_meter 的分工:cf_report 读落盘日志,可跨进程、跨天累计(source=disk,进程重启不丢);cf_meter 只报当前进程内即时快照。命中率为 null 表示本期没有可判定的厂商 usage 数据(未判定),不是 0%。日志默认写平台标准可写目录(DOBOCACHE_LOG_DIR 可覆盖),只在本机、不含提问原文、不占对话 token;按「单文件 10MB 轮转 + 默认保留 7 天」自动维护(DOBOCACHE_LOG_MAX_MB / DOBOCACHE_LOG_KEEP_DAYS 可调),返回中的 logPolicy 即当前生效值。

cf_pruneA

压缩你传入的文本,为稳定前缀腾出空间:去重行、压缩空白,按 maxChars / maxLines 双上限截断(默认保留头部),返回修剪前后体积比与丢弃行数。输入只认参数里的 text 字符串,输出是可直接拼进上下文的短文本;【何时调】工具输出很长、要压进上下文又不想破坏前缀稳定性时。要处理结构化行数据用 cf_normalize。白盒日志由服务端自维护(单文件 10MB 轮转、默认保留 7 天,DOBOCACHE_LOG_MAX_MB / DOBOCACHE_LOG_KEEP_DAYS 可调),体积无需人工干预。

cf_normalizeA

归一化结构化行数据(对象数组):按字段白名单裁剪 + 稳定排序,让内容相同但顺序抖动的返回归为同一个缓存键,输出归一后的 rows 与 nk- 前缀键指纹。与 cf_prune 的分工:cf_normalize 吃 rows 数组、产出稳定键;cf_prune 吃纯文本、产出短文本。【何时调】同类工具多次返回、内容相同但字段顺序抖动导致缓存键反复失效时调一次,把顺序固定下来。

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4.1/5.0

Scored across 9 tools

Disambiguation4/5

Although there are several measurement and context-selection tools, their descriptions clearly distinguish them: cf_meter covers in-process snapshots, cf_report covers on-disk historical logs, cf_ping covers connectivity only, and cf_prune covers plain text while cf_normalize covers structured rows. cf_judge (hit determination) and cf_tier (value grading) have similar goals but are explicitly separated by when to call them, so an agent can reasonably choose between them. Minor remaining overlap between judge/tier and meter/report keeps this from being a perfect score.

Naming Consistency5/5

All nine tools consistently follow the `cf_` + single verb/noun pattern (ping, judge, tier, inject, meter, warmup, report, prune, normalize), using snake_case throughout with no style mixing. The prefix groups the tools clearly by server, and each suffix is a concise action word.

Tool Count5/5

Nine tools is well within the ideal 3-15 range, and each covers a distinct stage of the cache lifecycle (diagnose, judge, tier, inject, warmup, measure, report, compress, normalize). No tool appears redundant or padding-like.

Completeness4/5

The surface covers the full cache/context-injection lifecycle from health check through judging, tiering, injecting, warming, and reporting, with clear text/structured compression variants. Minor gaps exist: no standalone tool for session listing or config/inspection beyond environment variables, and reset is only a parameter of cf_inject rather than a first-class operation.

Maintenance

ActivityNo data
ResponsivenessOutdated data