Cloudflare Code Mode gives agents an entire API in ~1,000 tokens, cutting 99.9% of MCP overhead
dinasaur_404 · x · 2026-11-23
Cloudflare shipped Code Mode: instead of registering every API endpoint as a separate MCP tool, an agent gets just two tools — search() and execute() — and writes JavaScript against a typed SDK to explore and chain calls, running in an isolated sandbox that returns only results.
For the full Cloudflare API (2,500+ endpoints), naive MCP tool definitions alone would consume 1.17M tokens — more than most models' entire context window. Code Mode compresses that to 1,000 tokens, a 99.9% reduction, with a fixed footprint regardless of endpoint count.
- New MCP server covers the whole Cloudflare API (DNS, Zero Trust, Workers, R2)
- A Code Mode SDK is open-sourced in the Cloudflare Agents SDK
- Anthropic independently explored the same pattern via code execution + programmatic tool calling
The takeaway: the future of agent tooling is less tool calling, more code writing.
More from coding & agent
- dhh: Gemini 4 Neon cut Omarchy boot time in half — cgarciae88 · 2026-11-23
- Free 542-Lesson AI Engineering Course Turns Your Coding Agent Into a Personal Tutor — ghumare64 · 2026-11-23
- Alibaba's CoEvoBench: GPT-6 Astra closes 4/5 of agent co-evolution gap in 24h RSI test — omarsar0 · 2026-11-23
- Free remote MCP server stamps SHA-256 hashes on-chain, no account or key needed — Most_Issue3095 · 2026-11-23
- Decision models route support tickets directly—no JSON, no LLM parsing needed — dfinke · 2026-11-23
- Most production "AI agents" are just cron jobs with a chatbot attached — dyingdonkey23 · 2026-11-23