Fetching from the wire…
Top 5 · 2026-04-19 · source-backed
Cloudflare shipped Code Mode MCP this week, and the numbers are hard to ignore. They replaced per-endpoint tool definitions with exactly two tools: search() and execute(). That's it. The result? Their own API surface, all 2,500+ endpoints, went from 1.17 million tokens of tool definitions down to roughly 1,000 tokens. That's a 99.9% reduction. One enterprise deployment collapsed 52 tools across four MCP servers (9,400 tokens) into 2 portal tools at 600 tokens.
I've been building MCP integrations for months, and every time I wire up a new API, the tool definition bloat is the first thing that burns me. You define 40 endpoints, and half your context window is gone before the model does anything useful. Cloudflare's approach sidesteps this entirely. The search() tool lets the agent discover available endpoints by querying the OpenAPI spec. The execute() tool runs generated code against that spec inside a V8 isolate sandbox. The agent writes the API call as code, the sandbox executes it, and you get results back. Pagination, conditional logic, chained calls. All in a single cycle.
What makes this genuinely interesting and not just a Cloudflare marketing play is that the pattern is completely reusable. If you have any large API surface exposed via MCP, you can adopt this same architecture. Stop defining one tool per endpoint. Expose a spec search and a code execution sandbox. Let the model figure out which endpoints to call and compose them programmatically. The token savings alone justify the refactor, but the real win is that your agent can handle API combinations you never explicitly defined as tools.
I've already started sketching this pattern into my own MCP servers. If you're running anything with more than 10 MCP tools, you should be looking at this approach today. The era of hand-crafted per-endpoint tool definitions is over.
What to do now: Read the Cloudflare blog post, then audit your own MCP tool count. If you're above 15 tools, prototype a search-plus-execute pattern against your OpenAPI spec. The token budget you free up will make your agents meaningfully smarter.
Each link below shares sources, entities, or timing with this story.
Cloudflare supports MCP / Shared entities / Same source / Shared topic / What happened next
Linked by a graph relationship (Cloudflare supports MCP); both cover Cloudflare, Code Mode MCP, MCP, OpenAPI; cite the same source (Code Mode MCP).
Cloudflare released Code Mode / Shared entities / Same source / Shared topic / Earlier coverage
Linked by a graph relationship (Cloudflare released Code Mode); both cover Cloudflare, MCP; cite the same source (Code Mode MCP).
Cloudflare supports MCP / Shared entities / Same source domain / Shared topic / What happened next
Linked by a graph relationship (Cloudflare supports MCP); both cover Cloudflare, MCP; reported by the same outlet (blog.cloudflare.com).
Cloudflare released Workers / Shared entities / Same source domain / Shared topic / What happened next
Linked by a graph relationship (Cloudflare released Workers); both cover Cloudflare, Their; reported by the same outlet (blog.cloudflare.com).
Cloudflare supports MCP / Shared entities / Shared topic / What happened next
Linked by a graph relationship (Cloudflare supports MCP); both cover Cloudflare, MCP; overlapping topics (agent, code, definition, server, token).
Cloudflare released Workers / Shared entities / Same source domain / Shared topic / What happened next
Linked by a graph relationship (Cloudflare released Workers); both cover Cloudflare, Their; reported by the same outlet (blog.cloudflare.com).
Cloudflare supports MCP / Shared entities / Same source domain / Shared topic / What happened next
Linked by a graph relationship (Cloudflare supports MCP); both cover Cloudflare, MCP; reported by the same outlet (blog.cloudflare.com).
Cloudflare supports MCP / Shared entities / Shared topic / What happened next
Linked by a graph relationship (Cloudflare supports MCP); both cover Cloudflare, MCP; overlapping topics (agent, cloudflare, endpoint, pattern, server).