Token Guardian MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Token Guardian MCPshow me my token usage for the last 7 days, broken down by agent and model"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Token Guardian MCP
Token Guardian is a local, read-only MCP server for finding Claude Code and Codex token waste without making either client dumber.
It does two jobs:
Reports which agents, models, and sessions are processing the most tokens.
Recommends the cheapest safe model and effort level for a specific task.
It also includes a dry-run route-task command for testing prompt-first routing before the MCP is registered anywhere.
Hard safety boundary
Token Guardian cannot change model settings, effort levels, context limits, compaction, MCP registration, or running sessions. It has no model credentials and makes no paid API calls.
The usage tool calls ccusage with --offline and --no-cost. Codex titles are optional metadata read through sqlite3 -readonly. Every MCP tool is marked read-only, non-destructive, idempotent, and closed-world.
Related MCP server: token-pilot
Tools
token_guardian_usage_snapshot
Reads one through thirty days of local usage and returns:
Totals by agent and model
Cache-read, output, and frontier-model shares
Largest sessions
Exact duplicate Codex work titles
Evidence-backed quick wins
Processed tokens are a workload diagnostic. They are not the same as a subscription meter, especially when cached input dominates.
token_guardian_recommend_route
Accepts the client, task, risk, and current context size. It returns a model, effort level, reasons, and an optional frontier validator.
The policy fails closed. Security, architecture, production, destructive, high-risk, critical, or ambiguous work stays on a frontier model. Cheap models handle bounded mechanical work. Balanced models handle normal coding and debugging, with a frontier review when needed.
Test prompt-first routing
Build the project, then run the router from any folder:
node ./dist/route-cli.js --client codex --prompt "Implement a bounded TypeScript parser with tests." --cwd .The working folder does not need to be a repository. The router primarily uses the prompt. It checks up to 256 names in the current folder for optional project markers, without opening file contents or scanning subfolders.
The command only prints a recommendation and a session-scoped launch command. It does not run that command, change configuration, register the MCP, or touch an active session. Vague continuation prompts such as yeah, test that stay on the frontier route because their real context is missing.
Local requirements
Node.js 24 or newer
ccusageon PATHsqlite3on PATH for optional Codex thread titles
Build and test
npm install
npm test
npm run typecheck
npm run buildRun the built stdio server:
node dist/index.jsInspect it without registering it in a live client:
npx @modelcontextprotocol/inspector node dist/index.jsRegistration status
This first build is intentionally not registered with Claude, Codex, or the shared Kitsune gateway. Registration and any client restart are a separate change after the isolated server is accepted.
License
MIT. See 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