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.

The takeaway: the future of agent tooling is less tool calling, more code writing.

Original post →

More from coding & agent

coding & agent channel →