Skip to main content
Glama

claw-tsaver

OpenClawユーザー向けのトークン節約MCPプロキシ。遅延展開(lazy expansion)により、ツール呼び出しのペイロードを90%以上削減します。

なぜ必要なのか

MCPのツール呼び出しは、1回のレスポンスで数千トークンもの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

実測値

テスト

元のトークン数

返されたトークン数

削減率

Wikipedia「トークン化(データセキュリティ)」の取得

11,507

104

99.1%

OpenClaw + Claude Sonnet 4.6 + mcp-server-fetchにて検証(2026年4月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

ダッシュボード

オプション:リアルタイムのトークン節約統計を表示するローカル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を歓迎します。

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    An 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
  • A
    license
    A
    quality
    C
    maintenance
    An MCP server that reduces AI API costs by up to 97% through token measurement, compression, caching, and pruning, all without changing prompts.
    10
    1
    Apache 2.0
  • A
    license
    A
    quality
    A
    maintenance
    An 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.
    5
    20
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    MCP 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.
    4
    MIT

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

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