Execute Cloudflare API operations via Code Mode
The agent generates and executes JavaScript code against the Cloudflare API to modify configurations or resources, using an isolated Dynamic Worker sandbox for safety.
How it works
The agent connects to the Cloudflare API MCP server, which uses a search-and-execute Code Mode pattern. Instead of loading individual tool definitions, the model writes JavaScript against a typed representation of the OpenAPI spec. The agent then executes this generated code inside an isolated Dynamic Worker sandbox to perform the requested API action, such as updating DNS records or configuring Workers.
Prompt
Paste this into an agent that has the servers below connected. Adjust the names and dates to your own.
Please update the DNS record for example.com to point to 192.0.2.1 using the Cloudflare API.MCP servers it needs
Source
The vendor page this playbook is drawn from, and the passage that supports it.
The generated code runs inside an isolated Dynamic Worker sandbox.Cloudflare's own MCP servers · Cloudflare Agents docs