claw-tsaver
claw-tsaver
专为 OpenClaw 用户设计的节省 Token 的 MCP 代理。通过延迟展开技术,将工具调用负载减少 90% 以上。
为什么使用它
MCP 工具调用通常会在单次响应中返回数千个 Token 的 HTML 或 JSON 数据,但模型通常只使用其中的 5%。剩下的 95% 会在无形中消耗上下文窗口并增加成本。claw-tsaver 位于 OpenClaw 和您的下游 MCP 服务器之间,拦截过大的响应,并向模型提供紧凑的预览和按需获取的句柄。
Related MCP server: TokenSaver MCP
如何工作
sequenceDiagram
participant U as OpenClaw (Claude)
participant C as claw-tsaver proxy
participant F as fetch / puppeteer / etc.
U->>C: call_tool("fetch", url)
C->>F: forward call
F-->>C: 11,507 tokens of HTML
Note over C: tiktoken count > threshold
C->>C: store full content in SQLite
C-->>U: {preview_head, preview_tail, expand_handle}<br/>(only 104 tokens)
Note over U: model decides if it needs full text
U->>C: expand_content(handle)
C-->>U: full 11,507 tokens实际测量
测试 | 原始 Token 数 | 返回 Token 数 | 节省比例 |
获取维基百科 "Tokenization (data security)" | 11,507 | 104 | 99.1% |
测试环境:OpenClaw + Claude Sonnet 4.6 + mcp-server-fetch,2026-04-25。
原始数据:benchmarks/mvp-day1-fetch.jsonl。
快速开始
1. 前置要求
安装 uv(仅需设置一次):
curl -LsSf https://astral.sh/uv/install.sh | sh无需安装 claw-tsaver —— uvx 会按需获取并运行它。
2. 配置下游 MCP 服务器
编辑 ~/.claw-tsaver/config.json(首次运行 claw-tsaver-mcp 时会自动创建模板):
{
"downstream_servers": [
{"name": "fetch", "command": "uvx", "args": ["mcp-server-fetch"]}
],
"compression_threshold_tokens": 500
}3. 在 OpenClaw 中注册
在 ~/.openclaw/openclaw.json 的顶层添加此代码块:
"mcp": {
"servers": {
"claw-tsaver": {
"command": "uvx",
"args": ["--from", "git+https://github.com/Yang1Bai/claw-tsaver",
"claw-tsaver-mcp"]
}
}
}然后重启 OpenClaw 网关:openclaw gateway restart
仪表盘
可选:用于实时查看 Token 节省统计数据的本地 Web UI。
uvx --from git+https://github.com/Yang1Bai/claw-tsaver claw-tsaver-dashboard在浏览器中打开 http://localhost:7878。
路线图
[x] 模块 A:延迟展开代理(本次发布)
[x] 模块 D:本地仪表盘(本次发布)
[ ] 模块 B:工具路由(每轮仅自动加载相关的 MCP)
[ ] 模块 C:对话历史压缩(原子事实卡片)
许可证
MIT — 详见 LICENSE 文件。
贡献
欢迎提交 Issue 和 PR。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that helps AI agents reduce token usage by converting data to TOON format and stripping comments and unnecessary whitespace from code files.MIT
- AlicenseAqualityCmaintenanceAn MCP server that reduces AI API costs by up to 97% through token measurement, compression, caching, and pruning, all without changing prompts.101Apache 2.0
- AlicenseAqualityAmaintenanceAn MCP server that intelligently filters and compresses tool outputs to reduce context window usage, saving up to 90% of tokens by removing noise such as passing tests and redundant information.520MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that reduces AI agent token usage by up to 90% through intelligent context compression. Enables efficient code exploration, multi-file refactoring, and debugging by providing tools for smart reading, searching, and managing code context.4MIT
Related MCP Connectors
Cloud-hosted MCP server for durable AI memory
An MCP server that integrates with Discord to provide AI-powered features.
MCP server for AI dialogue using various LLM models via AceDataCloud
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Yang1Bai/claw-tsaver'
If you have feedback or need assistance with the MCP directory API, please join our Discord server