MCP makes AI agents look magical.
Connect a few tools, let the model call them, and suddenly your agent can search files, update records, query systems, automate workflows, and interact with real business infrastructure.
But here is the problem:
The more tools you add, the more expensive every request becomes.
Not because the task is harder.
Because the model often has to carry the entire tool catalog in context.
That means:
more tokens
more latency
more intermediate data
more room for mistakes
higher infrastructure cost
This is fine in a demo.
It gets painful in production.
That is where Code Mode becomes interesting.
Instead of showing the model every tool upfront, Code Mode lets the agent:
discover only what it needs
read compact tool interfaces
orchestrate workflows through code
keep unnecessary intermediate data outside the LLM context
Less context.
Fewer model turns.
Lower cost.
Cleaner architecture.
I wrote a full breakdown of why this matters for production AI…