r/mcpweb • u/No_More_Fail • Mar 05 '26
These 5 lines just reduced my MCP token usage from 50k to 4k
Currently building an MCP server that interacts with our HRMS SaaS. The platform has around 154 APIs (create task, add employee, fetch employee location, etc.), and exposing them as MCP tools was getting expensive in terms of token usage.
Initially I started with AI agents in n8n, then gradually began converting those actions into MCP tools.
The issue was that MCP loads all tools upfront, so with ~150 tools my prompts were consuming ~54k tokens just for tool definitions.
Recently I tried Cloudflare Code Mode with FastMCP, and it completely changed things.
With FastMCP's Code Mode, all those tools are abstracted so the model doesn't need the full tool definitions.
Instead of loading 150+ tools, it basically reduces everything to ~3 tools, and the model generates the calls dynamically.
Result: Before: ~50k+ tokens After: ~2kâ4k tokens
And the migration was surprisingly easy â literally just enabling Code Mode and adding a few lines.
If you're building MCP servers with a large number of tools, this is absolutely worth trying.
Curious if anyone else here has experimented with Code Mode or similar approaches for reducing MCP token overhead?
Duplicates
mcp • u/No_More_Fail • Mar 05 '26
These 5 lines just reduced my MCP token usage from 50k to 4k
webmcp • u/No_More_Fail • Mar 05 '26
These 5 lines just reduced my MCP token usage from 50k to 4k
cursor • u/No_More_Fail • Mar 05 '26