MCP Tool Discovery Ate 3,384 Tokens per Turn. I Got It Down to 816 with mcptoon.
Every time your AI Agent or coding assistant (like Claude Code or Cursor) connects to your infrastructure stack, it pays a silent "entry fee" in tokens before processing a single line of your actual prompt.
I recently audited our production DevOps MCP server setup—consisting of 7 core infrastructure services (Kubernetes, Terraform, AWS, Vault, Datadog, Docker, and GitHub Actions) hosting 38 tools in total.
Here is what the raw token count looked like when measured via cl100k_base tiktoken:
Raw JSON Schema Manifest: 3,384 Tokens
Slim Schema Filter: 1,388 Tokens (-59.0%)
mcptoon TOON Manifest: 816 Tokens (-75.9%)
Where Did 3,384 Tokens Go?
Most developers assume that token consumption happens when tools return large execution outputs. But the real leak happens earlier: in the initial tool discovery phase.
When an agent initialises, the system prompt gets injected with massive JSON Schema manifests for every registered tool. Brackets, quotes, nested properties, and verbose inputSchema boilerplate eat up thousands of tokens per request turn.
How I Optimized It Using mcptoon
Instead of manually editing JSON schemas for 38 tools, I used mcptoon (an open-source, zero-dependency CLI client for managing and compressing MCP servers).
-
Slim Manifest (
mcptoon manifest --slim): Removes redundant outer metadata, parameter type duplication, and default key definitions while keeping basic types (3,384 -> 1,388 tokens). -
Compact TOON Encoding (
mcptoon manifest --toon): Converts verbose JSON schemas into compact Token-Optimized Object Notation (1,388 -> 816 tokens).
# Audit and compress your MCP server manifests
mcptoon manifest --slim
mcptoon manifest --toon
If you are running multi-server setups with agents, check out mcptoon on GitHub and audit your manifest footprint before tuning your prompts!
Top comments (0)