releases.shpreview
Cloudflare/Cloudflare Changelog/Access - Code mode for MCP server portals

Access - Code mode for MCP server portals

$npx -y @buildinternet/releases show rel_YFLKmMaYDiuaYGIYD2l_P

MCP server portals support code mode, a technique that reduces context window usage by replacing individual tool definitions with a single code execution tool. Code mode is turned on by default on all portals.

To turn it off, edit the portal in Access controls > AI controls and turn off Code mode under Basic information.

When code mode is active, the portal exposes a single code tool instead of listing every tool from every upstream MCP server. The connected AI agent writes JavaScript that calls typed codemode.* methods for each upstream tool. The generated code runs in an isolated Dynamic Worker environment, keeping authentication credentials and environment variables out of the model context.

To use code mode, append ?codemode=search_and_execute to your portal URL when connecting from an MCP client:


https://./mcp?codemode=search_and_execute

For more information, refer to code mode.

Fetched April 14, 2026