{
  "id": 1181260,
  "title": "How I Cut MCP Token Usage by 91% (and Learned a Humbling Lesson About Tokenizers)",
  "url": "https://urgent.news/2026/08/16/how-i-cut-mcp-token-usage-by-91-and-learned-a-humbling-lesson-about",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-08-16T02:35:21.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/mcptokensaver/how-i-cut-mcp-token-usage-by-91-and-learned-a-humbling-lesson-about-tokenizers-5hl1"
  },
  "original_language": "en",
  "account": "MCP servers add their entire JSON schema to context when included in an AI coding agent. This can consume a significant portion of the context window, costing valuable token space. The author built a tool called mcptoon to address this issue. Mcptoon works in three ways:\n\n1. It compresses the JSON schema into a more compact format, reducing token usage by 91%. The original JSON schema for 255 tools used 39,964 tokens, but mcptoon compresses this down to just 3,511 tokens.\n\n2. Schemas are stored on disk in a config file, allowing the agent to discover available tools and execute them without context. The compressed output enters context only when needed.\n\n3. Results are returned in a human-readable key-value format (TOON) instead of nested JSON, saving even more token space. For example, instead of receiving a large JSON response, the agent gets a concise string like \"name: react stars: 219000\".\n\nThe author learned a valuable lesson about the importance of token optimization. An early attempt to replace null values with the empty set symbol (∅) actually increased the token count, demonstrating the need for thorough testing and measurement before implementing optimizations.\n\nThe cost impact of using mcptoon is substantial. At GPT-4o pricing, without the tool, 25 requests would consume 1 million tokens, costing $5. With mcptoon, the same number of requests would only use 87,500 tokens, costing just $0.44. This translates to around $540 in monthly savings for 100 sessions.\n\nImplementing mcptoon is straightforward. You can install it via pip, set it up with your existing MCP fetch tool, and generate a schema manifest to see what's available. After that, you can execute tools using a single command that works with any agent compatible with shell commands.\n\nWith over 3,000 lines of Python code, 309 tests, and no external dependencies, mcptoon is a lightweight solution to a common problem. The author is working on adding more MCP servers to the default configuration and plans to develop a more comprehensive quality benchmark beyond just token counts. Feedback on the SLIM format and suggestions for reducing other MCP token waste are welcome.",
  "summary": "The Problem When you add MCP servers to your AI coding agent, each one dumps its full JSON schema into context. 255 tools across all servers = 39,964 tokens. On a 128K context window, that's 31% gone before you type a single character. I was literally paying for JSON syntax overhead. Every API call included {\"content\":[{\"type\":\"text\",\"text\":\"...\"}]} — 80 tokens to deliver 6 tokens of data. The…",
  "key_points": [
    "MCP servers consume large token space by adding full JSON schema to context",
    "Mcptoon compresses JSON schema by 91%, reducing 39,964 tokens to 3,511",
    "Mcptoon returns results in human-readable TOON format, saving even more tokens"
  ],
  "editors_take": "The development means that AI coding agents can now operate more efficiently and cost-effectively, with significant token usage reductions and substantial cost savings, benefiting users who rely on MCP servers.",
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}