English | 日本語
Power your agent
The publisher's own command. Not a PlugMCP endpoint.
Host a copy with our keys and logs.
npx -y [email protected]Claude Code has no install link for a local command. Copy the command below and run it in a terminal.
claude mcp add blackfoil-claude-token-saver-mcp -- npx -y claude-token-saver-mcp@0.3.2Run in a terminal.
{ "mcpServers": { "blackfoil-claude-token-saver-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}claude_desktop_config.json
Remote URL or a command on your machine? How the two installs differ
Run on PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
LaunchFrom the publisher
English | 日本語
MCP server that offloads coding tasks to local LLM (Ollama) to save Claude API tokens
Beta — 個人利用向け。736 テスト / カバレッジ 97%。
Claude Code の「それ、ローカルでよくない?」を自動化する MCP サーバー。
ボイラープレート生成、テスト作成、テキスト要約 — Cloud API に投げるまでもない定型タスクを、手元の Ollama でさばきます。セキュリティ対策込み。
Claude Code の API 利用を分析してみたら、リクエストの約 40% は定型的なコード生成やテキスト処理でした。この手のタスクは 7B クラスのローカルモデルでも実用的な品質が出ます。「推論は Cloud、作業は Local」— この振り分けを MCP で自動化したのがこのツールです。
ローカル LLM の進化は速いです。2024 年の Llama 3 から 2025 年の Qwen3 まで、わずか 1 年でコード生成ベンチマーク (HumanEval) のスコアは 60% → 85% に跳ね上がりました。
この調子なら、Agent ワークフローにローカル LLM が当たり前に組み込まれる日もそう遠くないでしょう。claude-token-saver-mcp は Cloud と Local を使い分けるための土台を提供します。
MCP (Model Context Protocol) は Claude Code が外部ツールを呼び出すための標準プロトコルです。このサーバーを登録すると、Claude Code がタスクの内容を見て、定型的な処理を自動的にローカル LLM へ回します。
Claude Code ──MCP──▶ token-saver ──HTTP──▶ Ollama (ローカル)
│ │
│ 「定型タスクだ → ローカルに振ろう」 │
│ │
└─── 高度な推論・設計判断は Cloud で継続 ───┘
Ollama が落ちていたり応答が遅い場合は Cloud API にフォールバック可能です。
前提: Node.js 20+ と Ollama がインストール済みであること。
0. Ollama を起動
ollama serve
1. プロジェクトルートに .mcp.json を作成
{
"mcpServers": {
"token-saver": { "command": "npx", "args": ["-y", "claude-token-saver-mcp"] }
}
}
2. Claude Code を起動して、こう頼む
コーディング用にローカルLLMをセットアップして
RAM に応じた最適モデルが推奨 → ダウンロード(約 4GB)→ プリロードまで自動で走ります。
3. 動作確認
TypeScript で配列をシャッフルする関数を書いて
「ローカルLLM(qwen2.5-coder:…)で生成しました」のようにローカルモデル名が表示されれば OK。
出ない場合は ollama list でモデルを確認し、トラブルシューティング を参照してください。
git clone https://github.com/BlackFoil/claude-token-saver-mcp.git
cd claude-token-saver-mcp
npm ci && npm run build
プロジェクトルートの .mcp.json に追加:
{
"mcpServers": {
"token-saver": {
"command": "node",
"args": ["/path/to/claude-token-saver-mcp/dist/server.js"]
}
}
}
auto_setup)あなた: 「ソート関数を書いて」 → offload_work がローカルで生成 💰 $0.02 節約
あなた: 「このログを要約して」 → compress_context がローカルで圧縮 💰 $0.05 節約
あなた: 「コスト節約を見せて」 → cost_dashboard: 累計 $47.89 節約
あなた: 「3つのAPIを一括実装して」 → batch_offload: 3 タスクを順次処理
ローカル 7B モデルの出力は Claude に及びません。それは前提です。ただ、定型タスクに限れば十分実用的です。
Claude Code がタスクの複雑さを判断して自動で振り分けます。ローカルの品質が足りなければ Cloud で処理されます。
ローカル LLM への入出力を自動で保護します。
[REDACTED] に置換src/
├── server.ts # MCP エントリポイント(11 ツール登録)
├── tools/ # offload_work, compress_context, auto_setup, batch_offload 等
├── ollama/ # Ollama クライアント & マルチノードロードバランサー
├── queue/ # FIFO キュー & 優先度キュー(URGENT/HIGH/NORMAL/LOW)
├── model-selector/ # モデル推奨エンジン, ベンチマーク DB, 実行トラッカー
├── validators/ # 入力バリデーション & プロンプトインジェクション検知
├── cost/ # コスト計算 & レポーター
├── metrics/ # Prometheus メトリクス収集
├── persistence/ # ExecutionTracker / BenchmarkStore のファイル永続化
├── config/ # Zod 設定スキーマ & ローダー
├── tiering/ # RAM ベースの自動ティアリング
├── logging/ # 構造化ログヘルパー
└── errors.ts # CTS-XXXX エラー体系
npm ci
npm test # 736 テスト(カバレッジ 97%)
npm run typecheck # 型チェック
npm run lint # ESLint
npm run build # プロダクションビルド
対応プラットフォーム: macOS / Linux / Windows(Ollama が動く環境)
コントリビューション歓迎です → CONTRIBUTING.md
MCP server that offloads coding tasks to local LLM (Ollama) to save Claude API tokens
{ "mcpServers": { "blackfoil-claude-token-saver-mcp": { "command": "npx", "args": [ "-y", "[email protected]" ] } }}Tools
No tool list yet. Remote servers get one after the first health check.
FAQ
Copy the stdio config for Cursor, Claude Desktop, Claude Code, or VS Code on this page. It uses the publisher's install, not a PlugMCP proxy.
No required environment variable is listed on this record.
Claude Token Saver runs locally over stdio.
Last checked 2026-10-28. MCP server that offloads coding tasks to local LLM (Ollama) to save Claude API tokens