mcp-context-budget
Click on "Deploy 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., "@mcp-context-budget How much of my context window are my MCP servers eating?"
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.
mcp-context-budget
Your MCP servers eat the context window before you type anything. This tells you how much, and which one to drop.
Free, local, read-only. No account, no network call, no telemetry.
The problem this solves
Every MCP server you install injects its full tool schema into every request. There is no lazy loading in the protocol. A dozen servers can consume tens of thousands of tokens before your first message, and nothing in the client tells you this is happening — the agent just gets quietly worse.
Known incidents from public reports:
Cloudflare's standard MCP server consumed 1.17M tokens in production, prompting a dedicated workaround.
A practitioner measured 45K tokens for GitHub MCP alone — 22.5% of a 200K window.
A 12-server setup reported the system prompt at 18,000 tokens before the user typed.
This tool measures your actual setup instead of quoting those numbers at you.
Related MCP server: mcp-checkup
Why measurement, not estimation
The config file only records how to start a server. The real cost lives in the tools/list payload, which changes with the server version and its runtime flags. Guessing from the config produces a confident wrong answer.
So this tool starts each stdio server, asks it for its tools, measures the payload, and shuts it down. That is the only honest method, and it takes a few seconds.
Install
Requires Python 3.8+. No dependencies.
git clone <repo> mcp-context-budgetAdd to your MCP client config (claude_desktop_config.json, .cursor/mcp.json, or ~/.workbuddy/mcp.json):
{
"mcpServers": {
"mcp-context-budget": {
"command": "python",
"args": ["/absolute/path/to/mcp-context-budget/run.py"]
}
}
}Tools
audit_context_budget
Full report: cost per server, cost per tool, findings with quantified savings, and a fix order.
How much of my context window are my MCP servers eating?Optional arguments: window (200k default, or 128k/32k/16k), config (explicit path), show_tools (list the N most expensive tools per server).
rank_servers_by_cost
Just the ranking. Answers "which server should I remove first" in one line per server.
explain_token_cost
Measure an arbitrary schema or string before you publish a server of your own. Reports the CJK/ASCII split and shows how wrong the naive len/4 heuristic would be.
What it detects
Finding | What it means |
| One tool costs ≥2.5% of the window on its own |
| The same sentence appears in 4+ tool descriptions |
| An enum is spelled out in prose and declared in the schema |
| 4+ tools with identical parameter shapes, differing only by verb |
| A parameter description that only repeats the field name |
Each finding carries an estimated token saving, so you can decide whether it is worth the edit.
What it does not do
Does not edit anything. It never writes to your configs and never removes a server.
Does not measure remote servers. URL-based (SSE / streamable HTTP) servers are listed as not probed rather than silently scored zero. Their cost is real but cannot be measured locally.
Does not prove a bad agent is caused by schema cost. It quantifies one specific tax. If your schemas are 2% of the window, the cause is elsewhere and the report says so.
Estimates, not exact tokenizer output. No tokenizer dependency, by design — that would triple install size and pin you to one model family. The estimator is calibrated to over-count slightly, because under-counting a budget is the failure that hurts.
Reading the verdict
Verdict | Share of window |
| under 5% |
| 5–10% |
| 10–20% |
| over 20% |
Ten percent is the line where trimming is worth the afternoon. Twenty percent is where the agent is measurably worse than it was before you installed things.
Self-verification
Do not take the claims on faith:
python tests/selftest.py28 checks, both directions: pathological schemas must be caught, and clean well-written servers must produce zero findings. The negative tests are the important half — a tool that cries wolf gets ignored, which is worse than no tool.
License
MIT.
Available Tools
3 toolsaudit_context_budgetA
Measure how many tokens the configured MCP servers consume in the context window. Probes each stdio server, reads its real tools/list payload, and reports cost per server and per tool against a chosen window size. Use when the agent feels degraded after adding servers, or before installing another one. Read-only.
Inputs: config, window, show_tools.
explain_token_costA
Estimate the context cost of an arbitrary tool schema or text snippet, split by CJK versus ASCII. Use to sanity-check a schema before publishing a server, or to compare two descriptions.
Inputs: text (required), json.
rank_servers_by_costA
Rank installed MCP servers by context cost without a full report. Answers 'which server should I remove first'. Cheaper and faster than audit_context_budget. Read-only.
Inputs: top, window.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
explain_token_cost is clearly separate (arbitrary schema/text estimation) from the two server-inventory tools. audit_context_budget and rank_servers_by_cost target the same data with different depth, but the descriptions explicitly frame them as full report vs. cheap ranking, so confusion is limited though real.
All three follow a clean verb_noun snake_case pattern (audit_*, rank_*, explain_*). The noun components vary sensibly with what each acts on.
Three tools is on the thin side, but the domain (context-cost measurement) is narrow and each tool covers a distinct query pattern. No filler tools are present.
Covers the core lifecycle: full audit, quick ranking, and ad-hoc schema/text estimation. Minor gaps exist — no single-server targeted query or budget-threshold/warning configuration — but agents can reach the same answers through the provided tools.
Maintenance
Related MCP Connectors
Statically audits MCP tool surfaces for token cost, schema quality, and design issues.
Grade MCP tool definitions for agent-readiness: score, A-F grade, fixes, est. token cost.
Free, no-key MCP server: token estimates, JSON Schema conversion, MCP configs, tool search.
LLM cost optimization gateway, repo token-waste auditor & model arbitrage MCP server.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceProvides tool to count token cost of any MCP server's tool definitions, enabling agents to assess cost before enabling.MIT
- AlicenseNot gradedqualityNot gradedmaintenanceDiagnoses MCP server token costs, finds duplicates, grades efficiency, and generates optimization reports.49 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables analyzing and optimizing context window token usage by measuring, compressing, and eliminating waste from MCP tool definitions.58 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables auditing MCP servers' tools by their estimated context token cost, ranking verbose names, descriptions, and schemas before they consume the agent window. Can run as an MCP tool so agents can budget their own context.1MIT