A
argbe.tech - news
1min read

Cloudflare’s MCP “Code Mode” shrinks the Cloudflare API to ~1,000 tokens of tools

Cloudflare introduced a Code Mode-based MCP server that exposes the full Cloudflare API through just two tools while keeping the context footprint roughly fixed around 1,000 tokens. The design centers on spec search plus sandboxed code execution instead of a tool per endpoint.

Cloudflare introduced a Code Mode-based MCP server that it says gives agents access to the entire Cloudflare API using only two tools while consuming roughly ~1,000 tokens of context.

  • The MCP surface is intentionally small: search() queries the Cloudflare OpenAPI spec, and execute() runs generated JavaScript that calls the Cloudflare API.
  • Cloudflare says the context footprint stays about the same (~1,000 tokens) even as the number of API endpoints grows.
  • For comparison, Cloudflare estimates a “native” MCP server that mapped the full API into individual tools would weigh in at about 1.17 million tokens—positioning Code Mode as a 99.9% input-token reduction for large APIs.
  • Both tools run inside a Dynamic Worker isolate (a lightweight V8 sandbox) with no file system or environment variables, and with external fetches disabled by default.
  • Cloudflare also open-sourced a Code Mode SDK inside the Cloudflare Agents SDK so the same pattern can be used in other MCP servers and agents.