A Lighthouse score for your MCP server's context budget

Every tool your MCP server exposes is serialized into the model's context window on every request — before the user types a word. mcp-tokenlint measures that hidden cost and gives you ranked, deterministic ways to shrink it.

$ npx github:fernforge/mcp-tokenlint --cmd "your-server"

The cost is real, large, and invisible to authors

43% → 14%
tool-selection accuracy collapse under prompt bloat
~55,000
tokens a 5-server setup burns before any work begins
97.1%
of 856 tool descriptions had at least one "smell"
19–62%
token reduction after pruning over-described tools

Every existing fix — Tool Search, gateways, proxies, dynamic toolsets — is consumer / runtime-side. mcp-tokenlint is shift-left: it scores and shrinks your footprint at publish time, in your own repo, in CI.

What you get

  mcp-tokenlint — MCP token-budget report

  Score 41/100  (grade F)  ████████░░░░░░░░░░░░
  18,204 tokens across 37 tools · avg 492/tool

  Sub-scores
    budget          42  ██████░░░░░░░░
    toolCount       90  █████████████░
    perToolBloat    55  ███████░░░░░░░
    hygiene         30  ████░░░░░░░░░░

  Suggestions  (est. recoverable: ~6,300 tokens)
     search_documents  An enum has 51 values (103 tokens). Validate server-side instead…
     search_documents  Description is 108 tokens. Tighten to ~60; cut examples/preamble.
     create_report     inputSchema is 740 tokens. Flatten nesting, drop unused fields…

Quick start — no install, no API key

# Point it at a live server over stdio
npx github:fernforge/mcp-tokenlint --cmd "npx -y @modelcontextprotocol/server-filesystem ."

# Or lint a tools/list dump
npx github:fernforge/mcp-tokenlint tools.json

# Gate a number in CI
npx github:fernforge/mcp-tokenlint tools.json --min-score 70

Fully deterministic — no LLM, no black box. Token counts use the o200k_base encoding as a stable, reproducible proxy for context cost; the scoring curve is open in src/score.ts.

Drop it in CI

# .github/workflows/mcp-budget.yml
- uses: fernforge/mcp-tokenlint@main
  with:
    cmd: "node build/server.js"   # or: tools: tools.json
    min-score: 70

Writes a Markdown report to the job summary and exposes score / total-tokens outputs you can gate on or post as a PR comment.

Live scorecard

Real scores for popular MCP servers, measured over stdio. Re-run any row yourself.

ServerToolsTokensScoreGrade
server-everything131,42399A
server-filesystem142,74194A
server-memory92,23094A
sequential-thinking194273C

One fat tool can sink a whole server: sequential-thinking exposes a single tool, but its description alone is 566 tokens. Token cost is per-definition, not per-server. Full scorecard →

Why authors, not users