
Cache
io.github.rog0x由 GitHub 账号 rog0x 发布v1.0.2更新于 Oct 24, 2026
Cache headers, CDN, LRU simulation for AI agents
概览
让助手分析 HTTP 缓存头、生成确定性缓存键、模拟淘汰策略,并检查 CDN 与浏览器缓存。
- 可以做什么
- 该服务器提供五个缓存工具:analyze_cache_headers 对 HTTP 缓存头(Cache-Control、ETag、Last-Modified、Expires、Vary)进行 A+ 到 F 评级并给出改进建议;generate_cache_key 从 URL、请求体或组合部分生成确定性键,并可输出可直接使用的 Redis 或 Memcached 命令;simulate_cache 回放请求序列,对比 LRU、LFU、FIFO 和 TTL 淘汰策略的命中率与时间线;check_cdn_headers 从响应头识别 CDN 并报告缓存状态、边缘服务器和 POP 位置;analyze_browser_cache 估算页面会缓存哪些资源及重复访问的节省。
- 适用场景
- 适合在调优 Web 性能或排查缓存行为时使用:审查响应头、选择淘汰策略、为代理或 API 设计缓存键,或查明 CDN 与浏览器为何未按预期缓存资源。
- 运行要求
- 以 npm 包(@rog0x/mcp-cache-tools)通过 stdio 在本地运行,需要 Node.js;README 给出构建步骤(npm install、npm run build)以及指向构建产物 dist/index.js 的配置。未声明任何账号、API 密钥或环境变量。
安装
在 SourceWeft 中
- 打开 控制台中的 Cache,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
@rog0x/mcp-cache-tools
MCP Server #30 — Caching and memoization tools for AI agents.
Analyze, generate, simulate, and optimize caching strategies across HTTP, CDN, and browser layers.
Tools
1. analyze_cache_headers
Analyze HTTP cache headers (Cache-Control, ETag, Last-Modified, Expires, Vary). Grades the overall caching strategy A+ through F and provides actionable improvement suggestions with context-aware advice for static assets, API responses, HTML pages, and media.
2. generate_cache_key
Generate deterministic cache keys from various inputs:
- URL mode — normalizes URL, sorts query params, filters include/exclude params
- Body mode — hashes request body with JSON key sorting for consistency
- Composite mode — combines multiple key parts into a single deterministic hash
Supports namespacing, versioning, TTL, and outputs ready-to-use Redis/Memcached commands.
3. simulate_cache
Simulate cache behavior for a sequence of requests. Compare eviction strategies side-by-side:
- LRU — Least Recently Used
- LFU — Least Frequently Used
- FIFO — First In, First Out
- TTL — Time-To-Live based expiration
Outputs hit rate, miss rate, eviction count, and step-by-step timeline.
4. check_cdn_headers
Detect which CDN is serving a resource from response headers. Identifies Cloudflare, Fastly, Akamai, CloudFront, Vercel, Netlify, Google Cloud CDN, Azure CDN, KeyCDN, and Bunny CDN. Reports cache status (HIT/MISS/STALE/BYPASS), edge server, and POP location.
5. analyze_browser_cache
Analyze what resources a page would cache in the browser. Determines cache type (strong, heuristic, conditional, none), duration, revalidation strategy, and estimates bandwidth/time savings on repeat visits. Groups results by resource type with optimization suggestions.
Setup
MCP Configuration
License
MIT
来源:README.md,提交 791ad8f
工具
0版本历史
1- v1.0.2最新Sep 16, 2026
评分
已满足适用检查项的 40%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
请在仓库或注册中心条目中声明许可证。