Cloudflare Launches Code Mode MCP Server to Optimize Token Usage for AI Agents
Cloudflare's new server optimizes API interaction for AI agents.

Cloudflare has launched a new Model Context Protocol (MCP) server utilizing Code Mode, which significantly reduces the token cost for AI agents interacting with APIs. This innovative approach allows agents to efficiently access over 2,500 API endpoints while maintaining a minimal token footprint, enabling more complex task execution without exhausting the model's context. The server emphasizes security by executing user-generated code in a controlled environment, ensuring safe interactions with external tools.
Key Takeaways
- 1.
Code Mode reduces token usage from 1.17 million to approximately 1,000 tokens.
- 2.
The new server supports over 2,500 API endpoints across various Cloudflare services.
- 3.
Cloudflare open-sourced a Code Mode SDK to facilitate third-party MCP implementations.
Get your personalized feed
Trace groups the biggest stories, videos, and discussions into one feed so you can stay current without scanning ten tabs.
Try Trace free