Code Mode
Code Mode: A Cloudflare approach where the agent writes code against a typed API instead of calling many tools one by one, set by portal policy. Example: Portal Code Mode policy can be off, opt_in, default_on or enforced. Also in the glossary is document.modelContext: The WebMCP entry point on the document object that holds registerTool, getTools and executeTool.
Definition
A Cloudflare approach where the agent writes code against a typed API instead of calling many tools one by one, set by portal policy.
Example, with source
Portal Code Mode policy can be off, opt_in, default_on or enforced. (developers.cloudflare.com, read 4 November 2026)
Where it appears on this site
Neighbouring terms
- Client ID Metadata Document (CIMD): A JSON file on the client's domain whose HTTPS URL is used as the OAuth client_id, the recommended MCP registration method.
- Confused deputy: An attack where a proxy with its own credentials is tricked into acting for someone else; MCP security guidance addresses it for OAuth proxies.
- document.modelContext: The WebMCP entry point on the document object that holds registerTool, getTools and executeTool.