Token Guardian MCP
Token Guardian MCP
Token Guardian は、Claude Code と Codex のトークン無駄遣いを、どちらのクライアントも賢くすることなく見つけるためのローカル専用の MCP サーバーです。
次の 2 つの役割を担います。
どのエージェント、モデル、セッションが最も多くのトークンを処理しているかを報告します。
特定のタスクに対して、最も安全で安価なモデルと努力レベルを推奨します。
また、MCP がどこにも登録される前に、プロンプトファーストのルーティングをテストするためのドライランの route-task コマンドも含まれています。
厳格な安全境界
Token Guardian は、モデル設定、努力レベル、コンテキスト制限、コンパクション、MCP 登録、または実行中のセッションを変更できません。モデル認証情報を持たず、有料の API 呼び出しも行いません。
使用状況ツールは、ccusage を --offline および --no-cost で呼び出します。Codex のタイトルは sqlite3 -readonly を通して読み取られるオプションのメタデータです。すべての MCP ツールは、読み取り専用、非破壊的、冪等、かつ閉じた世界であるとマークされています。
Related MCP server: token-pilot
ツール
token_guardian_usage_snapshot
1 日から 30 日分のローカル使用状況を読み取り、以下を返します。
エージェントおよびモデル別の合計
キャッシュ読み取り、出力、およびフロンティアモデルのシェア
最大のセッション
重複する Codex 作業タイトル
証拠に基づくクイックウィン
処理されたトークンはワークロード診断です。特にキャッシュされた入力が支配的な場合、これらはサブスクリプションメーターと同じではありません。
token_guardian_recommend_route
クライアント、タスク、リスク、および現在のコンテキストサイズを受け入れます。モデル、努力レベル、理由、およびオプションのフロンティアバリデータを返します。
ポリシーはフェイルクローズされます。セキュリティ、アーキテクチャ、本番環境、破壊的、高リスク、重大、またはあいまいな作業はフロンティアモデルに残ります。安価なモデルは、境界のある機械的な作業を処理します。バランスの取れたモデルは、通常のコーディングとデバッグを処理し、必要に応じてフロンティアレビューを行います。
プロンプトファーストのルーティングをテストする
プロジェクトをビルドし、任意のフォルダからルーターを実行します。
node ./dist/route-cli.js --client codex --prompt "Implement a bounded TypeScript parser with tests." --cwd .作業フォルダはリポジトリである必要はありません。ルーターは主にプロンプトを使用します。現在のフォルダ内の最大 256 個の名前をチェックして、オプションのプロジェクトマーカーを探しますが、ファイルの内容を開いたり、サブフォルダをスキャンしたりしません。
このコマンドは、推奨事項とセッションスコープの起動コマンドのみを出力します。そのコマンドを実行したり、設定を変更したり、MCP を登録したり、アクティブなセッションに触れたりすることはありません。yeah, test that のようなあいまいな継続プロンプトは、実際のコンテキストが欠落しているため、フロンティアルートに残ります。
ローカル要件
Node.js 24 以降
PATH 上の
ccusageオプションの Codex スレッドタイトル用の PATH 上の
sqlite3
ビルドとテスト
npm install
npm test
npm run typecheck
npm run buildビルドされた stdio サーバーを実行します。
node dist/index.jsライブクライアントに登録せずに検査します。
npx @modelcontextprotocol/inspector node dist/index.js登録ステータス
この最初のビルドは、意図的に Claude、Codex、または共有の Kitsune ゲートウェイに登録されていません。登録とクライアントの再起動は、分離されたサーバーが承認された後、別の変更として行われます。
ライセンス
MIT。 LICENSE を参照してください。
Maintenance
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
- AlicenseAqualityCmaintenanceAn MCP server that helps AI agents reduce token usage by compressing, summarizing, and managing conversation/context data more efficiently.11MIT
- AlicenseAqualityCmaintenanceMCP server that reduces token consumption in AI coding assistants by up to 90% via structural reads, PreToolUse hooks, and tp-\* subagents.254254MIT
- Alicense-qualityDmaintenanceMCP server that analyzes AI agent session logs to find token waste and optimization opportunities.17MIT
- Flicense-qualityDmaintenanceAn MCP server that reduces token usage by lazily loading skills and tools only when needed, and routing repetitive subtasks to ML backends instead of the LLM.
Related MCP Connectors
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Agent Cost Allocator MCP — multi-tenant LLM cost attribution for chargeback billing. Companion to
Agent Token Budget MCP — hard per-session token + spend cap with signed budget-exhausted
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/KitsuneTech1/token-guardian-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server