AI Briefing
KO

MCP Adoption Expands: Cloudflare's Reference Architecture for Simpler, Safer, Cheaper Enterprise Deployment

·2026.04.14 22:00

Key point

Cloudflare tied together security, cost, and operations with MCP server portals and Code Mode.

1 / 2

Details

Cloudflare has adopted MCP (Model Context Protocol) as a core part of its company-wide AI strategy, spreading agentic workflows across product, sales, marketing, and finance. At the same time, to guard against permission sprawl, prompt injection, and supply chain risk, it presented a reference architecture that combines security features from Cloudflare One and the Developer platform.

The core premise is that remote MCP servers are safer and easier to manage than local MCP servers. A central team runs a shared MCP platform inside an internal monorepo, standardizing approvals, template cloning, tool definition authoring, and deployment. Write default-deny, audit logging, auto-generated CI/CD pipelines, and secrets management are provided by default, allowing new MCP servers to be spun up in minutes.

Servers deployed this way go live under a custom domain on the Cloudflare Developer platform, and are automatically deployed across global data centers for low latency and visibility. Cloudflare Access is attached as the OAuth provider, applying context-based authentication such as SSO, MFA, IP, location, and device certificates.

As the number of available MCP servers grew, the next problem became discovery. Cloudflare addressed this with MCP server portals, letting users connect an MCP client to a single portal to see all the internal and external MCP servers they're authorized to use in one place, while also applying centralized logging, policy, and DLP guardrails.

Portals also allow fine-grained access control. For example, a policy could expose only read-only tools from an internal code repository MCP server to the finance group, while opening up more read/write tools on company-issued laptops for the engineering team.

The biggest cost problem was token usage. Cloudflare noted that existing MCP implementations list every API operation as a tool, which quickly consumes the context window. To address this, it introduced server-side Code Mode, which exposes thousands of endpoints of the Cloudflare API while cutting token usage by 99.9%.

This pattern has now been applied to MCP server portals as well, compressing all upstream MCP servers into two portal tools: portal_codemode_search and portal_codemode_execute.

  • search: Queries all connected upstream tool definitions via codemode.tools(), and the model filters down to just the needed tools in JavaScript.
  • execute: Calls tools directly through the codemode proxy object, chains multiple operations together in code, and handles error handling all at once.
  • Execution environment: This code runs in a sandboxed environment based on Dynamic Workers.

For example, when finding a Jira ticket and updating it to reflect the contents of a Google Drive document, the model first uses search to find the tool names and parameters, then executes Jira lookup, Drive document reading, and the Jira update sequentially with a single execute call. As a result, the entire tool schema no longer needs to be loaded into context, achieving security, governance, and cost savings simultaneously in large-scale enterprise MCP operations.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.