@kodekloud: How Cloudflare's Code Mode Supercharges MCP! 🤖⚡ Despite claims that Cloudflare's Code Mode replaces the Model Context Protocol (MCP), it actually makes MCP dramatically more efficient. In a traditional setup, an AI agent loads thousands of tokens of tool descriptions upfront and executes actions one round trip at a time. Asking a model to schedule 31 distinct calendar events forces 31 separate inference loops, re-sending the entire conversation history and tool schemas on every single step. Code Mode eliminates this bottleneck by automatically converting MCP tool definitions into standard programming functions, allowing the model to write one short script with a loop instead of making dozens of individual tool calls. That generated script runs inside an isolated sandbox with no open internet access, communicating exclusively with the underlying MCP server under the agent's existing permissions. The program handles all 31 API calls locally and returns a brief summary to the model, slashing token usage by 81 percent. This pattern also solves massive context bloat at enterprise scale. Rather than stuffing over a million tokens of schemas for 2,500 platform actions into a prompt, Cloudflare's own MCP server exposes just two tools, one to search for actions and one to execute code, shrinking the footprint to roughly a thousand tokens. #ModelContextProtocol #Cloudflare #AIAgents #SoftwareEngineering #SystemDesign #TechExplained
KodeKloud
Region: SG
Saturday 21 November 2026 15:18:19 GMT
Music
Download
Comments
dgilmour76 :
So from API to MCP and now back to API 😜
2026-11-21 18:11:29
41
Ismael Wittwer :
Parallax.build already does this for months ✌️
2026-11-22 05:46:06
0
Yuggg :
but how does theodel know what is the tools available
2026-11-21 17:19:42
2
VonK :
It’s actually pretty similar to something I built, just with a different approach. With daily workflows, agents often have to repeat the same tool calls every time the workflow runs. Some companies run thousands of these workflows every day, so the overhead adds up. That’s why I built Hotpath. It’s a JIT compiler for AI agents: it records successful execution paths and compiles them into reusable workflows, making repeated runs cheaper and faster. It also has fallback mechanisms to handle changing data, execution errors and unexpected results. If anyone’s interested check out hotpath.run. It’s free and open source on GitHub too.
2026-11-21 18:03:16
1
ステファノ 「Stefano」 :
What if the mcp create_event because create_events() accepting array? Can’t do the create in one only command?
2026-11-22 03:47:52
0
Matchz :
Just build a db for tools or code templates made by ai/harness. So it can use old finished code as a template or use a working tool.
2026-11-22 00:57:02
1
Renato Perez :
Wouldn't it make more sense to build an agent-friendly CLI designed for deterministic, non-interactive execution, with structured JSON output? That would give LLM agents a reliable interface to invoke commands, consume results, and chain operations without getting stuck on interactive prompts or wasting context tokens parsing human-oriented output.
2026-11-21 17:28:32
4
Che Kape :
Okay so instead of running an agent per action, you sandbox actions and run them programmatically with 1 agent run. The optimization comes from analog computing instead of Ai reasoning
2026-11-21 20:44:02
1
nomad :
mcp was always of dubious quality
2026-11-22 02:11:20
0
gymnasie arbete :
I created different scripts for the different heavy MCP servers, for example the one connect to my neon Postgres db whenever I want to work with it I ask Claude to active the server only for that chat. When I open new chats for different other purposes the MCP for neon db is not activated to save the context window.
2026-11-21 15:24:34
0
john :
People who say MCP is dead don’t know what MCP is
2026-11-21 18:11:54
4
Will. I. Em. 🧿. ༽ 🪳 :
batch_create_event tool fixes the MCP server 🥴🥴
2026-11-21 18:31:35
0
soulz :
aku belum nak share tools yg aku buat untuk AI agent. jimat token, dan jauh lebih baik dari code run. asasnya keseluruhan tools aku dibina untuk ai dengan output terkawal dan padat. dan terikat secara langsung dengan sistem agent yg dikawal oleh hook. yg nak buat, boleh guna tips ni, kawal panjang input, kawal hasil carian, kawal input dari mcp. agent nak lihat 5 baris akhir mengapa kita berikan ia 100 baris?
2026-11-22 02:27:21
0
moneylover4life1 :
heloxai is free
2026-11-21 18:50:39
0
imjustheresoidontgetfired :
Not sure why MCPs were ever built, seems very flawed
2026-11-21 17:40:03
0
Luca Leen :
The initial context should be the same if I have to map the mcp tools to a list of functions definition... Isn't it? The difference is that it doesn't have to resend it at each tool call
2026-11-21 20:16:02
0
Robert Cressey :
You can do the same loop this time through a CLI. Without the MCP. this is better. and the way forward. MCP is definitely not dead but CLIs will take over in most cases.
2026-11-22 02:23:24
0
To see more videos from user @kodekloud, please go to the Tikwm
homepage.