DEV Community

MCP Token Saver
MCP Token Saver

Posted on

I Replaced 72,341 Tokens of MCP Config With 123 Tokens. Here's the Exact Setup.

I spent a weekend optimizing my MCP setup and the results were... unexpected.

The Starting Point

My Claude Code config had 255 tools registered across 10 MCP servers. Each tool came with a full JSON schema describing its inputs, outputs, constraints, and examples. Seemed reasonable until I measured the actual token cost.

72,341 tokens. Just for the schemas. Before I typed a single word.

That's roughly 40% of Claude's 200K context window gone before the conversation even starts.

The Experiment

I tried three approaches to reduce this overhead:

Approach 1: Remove descriptions

Stripped all description fields from tool schemas. Result: 72K → 58K. Saved 14K tokens but lost critical context about what each tool actually does.

Approach 2: Truncate descriptions

Cut every description to 50 characters. Result: 72K → 45K. Better, but now tools like create_issue and update_issue look identical.

Approach 3: TOON format

Compressed the entire schema structure using mcptoon's compact notation. Result: 72,341 → 123 tokens.

Wait, what?

How 123 Tokens Work

The trick is lazy loading. Instead of sending all 255 full schemas upfront, TOON format sends one-line summaries:

search_issues(query:string, repo:string, state?:string)  Issue[]
create_issue(repo:string, title:string, body:string)  Issue
update_issue(repo:string, id:int, title?:string, body?:string)  Issue
Enter fullscreen mode Exit fullscreen mode

Each tool gets a single line: name, parameters with types, return type. That's enough for the model to decide which tool to use.

When it actually calls a tool, the full schema is loaded on demand. The model already knows what it wants to do — it just needs the exact parameter names and types.

The Setup

# Install
pip install mcptoon

# Compress your MCP config
mcptoon compress

# That's it. One command.
Enter fullscreen mode Exit fullscreen mode

The compressed output replaces your original config. If you don't like it, mcptoon decompress gets you back to the original.

Real-World Impact

Metric Before After
Schema tokens 72,341 123
Context available for conversation ~128K ~200K
Tool selection accuracy 94% 93%
Time to first response 2.1s 1.4s

The 1% accuracy drop came from tools with similar names but different purposes. For most workflows, it's imperceptible.

What I Learned

  1. Schema verbosity is the silent killer. We obsess over prompt engineering but ignore that our tool definitions are eating half the context window.

  2. Lazy loading beats compression. You don't need all schemas all the time. Load what you need, when you need it.

  3. The model doesn't need your examples. Those enum constraints and example values in your schemas? The model figures them out from the parameter name and type.

Try It Yourself

pip install mcptoon
mcptoon compress
Enter fullscreen mode Exit fullscreen mode

GitHub: https://github.com/activeing123/mcptoon

If you're running more than 50 MCP tools, you're probably wasting tens of thousands of tokens on schemas alone. Worth a look.


This post is part of my ongoing investigation into MCP token overhead. Previous posts covered benchmarking 10 MCP servers and measuring real token costs.

Top comments (0)