Cloudflare Code Mode: Convert MCP Tools to TypeScript API — 81% Token Reduction on Complex Tasks, Entire API in 1,000 Tokens via Two Tools
Cloudflare Blog·high signal
Cloudflare's Code Mode converts MCP servers into typed TypeScript APIs that LLMs write code against instead of calling tools one-by-one. Two tools (search + execute) expose the entire Cloudflare API in ~1,000 tokens — versus 1.17M tokens for a traditional MCP server. For complex 31-event tasks, Code Mode uses 81% fewer tokens than direct tool calling. The model writes TypeScript against typed SDKs, chains multiple calls in code, and only reads back final results — eliminating the round-trip waste of feeding each tool output back through the neural network.