
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/">
    <channel>
        <title><![CDATA[ The Cloudflare Blog ]]></title>
        <description><![CDATA[ Get the latest news on how products at Cloudflare are built, technologies used, and join the teams helping to build a better Internet. ]]></description>
        <link>https://blog.cloudflare.com</link>
        <atom:link href="https://blog.cloudflare.com/" rel="self" type="application/rss+xml"/>
        <language>en-us</language>
        <image>
            <url>https://blog.cloudflare.com/favicon.png</url>
            <title>The Cloudflare Blog</title>
            <link>https://blog.cloudflare.com</link>
        </image>
        <lastBuildDate>Fri, 03 Apr 2026 17:07:56 GMT</lastBuildDate>
        <item>
            <title><![CDATA[Sandboxing AI agents, 100x faster]]></title>
            <link>https://blog.cloudflare.com/dynamic-workers/</link>
            <pubDate>Tue, 24 Mar 2026 13:00:00 GMT</pubDate>
            <description><![CDATA[ We’re introducing Dynamic Workers, which allow you to execute AI-generated code in secure, lightweight isolates. This approach is 100 times faster than traditional containers, enabling millisecond startup times for AI agent sandboxing. ]]></description>
            <content:encoded><![CDATA[ <p>Last September we introduced <a href="https://blog.cloudflare.com/code-mode/"><u>Code Mode</u></a>, the idea that agents should perform tasks not by making tool calls, but instead by writing code that calls APIs. We've shown that simply converting an MCP server into a TypeScript API can <a href="https://www.youtube.com/watch?v=L2j3tYTtJwk"><u>cut token usage by 81%</u></a>. We demonstrated that Code Mode can also operate <i>behind</i> an MCP server instead of in front of it, creating the new <a href="https://blog.cloudflare.com/code-mode-mcp/"><u>Cloudflare MCP server that exposes the entire Cloudflare API with just two tools and under 1,000 tokens</u></a>.</p><p>But if an agent (or an MCP server) is going to execute code generated on-the-fly by AI to perform tasks, that code needs to run somewhere, and that somewhere needs to be secure. You can't just <code>eval() </code>AI-generated code directly in your app: a malicious user could trivially prompt the AI to inject vulnerabilities.</p><p>You need a <b>sandbox</b>: a place to execute code that is isolated from your application and from the rest of the world, except for the specific capabilities the code is meant to access.</p><p>Sandboxing is a hot topic in the AI industry. For this task, most people are reaching for containers. Using a Linux-based container, you can start up any sort of code execution environment you want. Cloudflare even offers <a href="https://developers.cloudflare.com/containers/"><u>our container runtime</u></a> and <a href="https://developers.cloudflare.com/sandbox/"><u>our Sandbox SDK</u></a> for this purpose.</p><p>But containers are expensive and slow to start, taking hundreds of milliseconds to boot and hundreds of megabytes of memory to run. You probably need to keep them warm to avoid delays, and you may be tempted to reuse existing containers for multiple tasks, compromising the security.</p><p><b>If we want to support consumer-scale agents, where every end user has an agent (or many!) and every agent writes code, containers are not enough. We need something lighter.</b></p><h6>And we have it.</h6>
    <div>
      <h2>Dynamic Worker Loader: a lean sandbox</h2>
      <a href="#dynamic-worker-loader-a-lean-sandbox">
        
      </a>
    </div>
    <p>Tucked into our Code Mode post in September was the announcement of a new, experimental feature: the Dynamic Worker Loader API. This API allows a Cloudflare Worker to instantiate a new Worker, in its own sandbox, with code specified at runtime, all on the fly.</p><p><b>Dynamic Worker Loader is now in open beta, available to all paid Workers users.</b></p><p><a href="https://developers.cloudflare.com/workers/runtime-apis/bindings/worker-loader/"><u>Read the docs for full details</u></a>, but here's what it looks like:</p>
            <pre><code>// Have your LLM generate code like this.
let agentCode: string = `
  export default {
    async myAgent(param, env, ctx) {
      // ...
    }
  }
`;

// Get RPC stubs representing APIs the agent should be able
// to access. (This can be any Workers RPC API you define.)
let chatRoomRpcStub = ...;

// Load a worker to run the code, using the worker loader
// binding.
let worker = env.LOADER.load({
  // Specify the code.
  compatibilityDate: "2026-03-01",
  mainModule: "agent.js",
  modules: { "agent.js": agentCode },

  // Give agent access to the chat room API.
  env: { CHAT_ROOM: chatRoomRpcStub },

  // Block internet access. (You can also intercept it.)
  globalOutbound: null,
});

// Call RPC methods exported by the agent code.
await worker.getEntrypoint().myAgent(param);
</code></pre>
            <p>That's it.</p>
    <div>
      <h3>100x faster</h3>
      <a href="#100x-faster">
        
      </a>
    </div>
    <p>Dynamic Workers use the same underlying sandboxing mechanism that the entire Cloudflare Workers platform has been built on since its launch, eight years ago: isolates. An isolate is an instance of the V8 JavaScript execution engine, the same engine used by Google Chrome. They are <a href="https://developers.cloudflare.com/workers/reference/how-workers-works/"><u>how Workers work</u></a>.</p><p>An isolate takes a few milliseconds to start and uses a few megabytes of memory. That's around 100x faster and 10x-100x more memory efficient than a typical container.</p><p><b>That means that if you want to start a new isolate for every user request, on-demand, to run one snippet of code, then throw it away, you can.</b></p>
    <div>
      <h3>Unlimited scalability</h3>
      <a href="#unlimited-scalability">
        
      </a>
    </div>
    <p>Many container-based sandbox providers impose limits on global concurrent sandboxes and rate of sandbox creation. Dynamic Worker Loader has no such limits. It doesn't need to, because it is simply an API to the same technology that has powered our platform all along, which has always allowed Workers to seamlessly scale to millions of requests per second.</p><p>Want to handle a million requests per second, where <i>every single request</i> loads a separate Dynamic Worker sandbox, all running concurrently? No problem!</p>
    <div>
      <h3>Zero latency</h3>
      <a href="#zero-latency">
        
      </a>
    </div>
    <p>One-off Dynamic Workers usually run on the same machine — the same thread, even — as the Worker that created them. No need to communicate around the world to find a warm sandbox. Isolates are so lightweight that we can just run them wherever the request landed. Dynamic Workers are supported in every one of Cloudflare's hundreds of locations around the world.</p>
    <div>
      <h3>It's all JavaScript</h3>
      <a href="#its-all-javascript">
        
      </a>
    </div>
    <p>The only catch, vs. containers, is that your agent needs to write JavaScript.</p><p>Technically, Workers (including dynamic ones) can use Python and WebAssembly, but for small snippets of code — like that written on-demand by an agent — JavaScript will load and run much faster.</p><p>We humans tend to have strong preferences on programming languages, and while many love JavaScript, others might prefer Python, Rust, or countless others.</p><p>But we aren't talking about humans here. We're talking about AI. AI will write any language you want it to. LLMs are experts in every major language. Their training data in JavaScript is immense.</p><p>JavaScript, by its nature on the web, is designed to be sandboxed. It is the correct language for the job.</p>
    <div>
      <h3>Tools defined in TypeScript</h3>
      <a href="#tools-defined-in-typescript">
        
      </a>
    </div>
    <p>If we want our agent to be able to do anything useful, it needs to talk to external APIs. How do we tell it about the APIs it has access to?</p><p>MCP defines schemas for flat tool calls, but not programming APIs. OpenAPI offers a way to express REST APIs, but it is verbose, both in the schema itself and the code you'd have to write to call it.</p><p>For APIs exposed to JavaScript, there is a single, obvious answer: TypeScript.</p><p>Agents know TypeScript. TypeScript is designed to be concise. With very few tokens, you can give your agent a precise understanding of your API.</p>
            <pre><code>// Interface to interact with a chat room.
interface ChatRoom {
  // Get the last `limit` messages of the chat log.
  getHistory(limit: number): Promise&lt;Message[]&gt;;

  // Subscribe to new messages. Dispose the returned object
  // to unsubscribe.
  subscribe(callback: (msg: Message) =&gt; void): Promise&lt;Disposable&gt;;

  // Post a message to chat.
  post(text: string): Promise&lt;void&gt;;
}

type Message = {
  author: string;
  time: Date;
  text: string;
}
</code></pre>
            <p>Compare this with the equivalent OpenAPI spec (which is so long you have to scroll to see it all):</p><pre>
openapi: 3.1.0
info:
  title: ChatRoom API
  description: &gt;
    Interface to interact with a chat room.
  version: 1.0.0

paths:
  /messages:
    get:
      operationId: getHistory
      summary: Get recent chat history
      description: Returns the last `limit` messages from the chat log, newest first.
      parameters:
        - name: limit
          in: query
          required: true
          schema:
            type: integer
            minimum: 1
      responses:
        "200":
          description: A list of messages.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Message"

    post:
      operationId: postMessage
      summary: Post a message to the chat room
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - text
              properties:
                text:
                  type: string
      responses:
        "204":
          description: Message posted successfully.

  /messages/stream:
    get:
      operationId: subscribeMessages
      summary: Subscribe to new messages via SSE
      description: &gt;
        Opens a Server-Sent Events stream. Each event carries a JSON-encoded
        Message object. The client unsubscribes by closing the connection.
      responses:
        "200":
          description: An SSE stream of new messages.
          content:
            text/event-stream:
              schema:
                description: &gt;
                  Each SSE `data` field contains a JSON-encoded Message object.
                $ref: "#/components/schemas/Message"

components:
  schemas:
    Message:
      type: object
      required:
        - author
        - time
        - text
      properties:
        author:
          type: string
        time:
          type: string
          format: date-time
        text:
          type: string
</pre><p>We think the TypeScript API is better. It's fewer tokens and much easier to understand (for both agents and humans).  </p><p>Dynamic Worker Loader makes it easy to implement a TypeScript API like this in your own Worker and then pass it in to the Dynamic Worker either as a method parameter or in the env object. The Workers Runtime will automatically set up a <a href="https://blog.cloudflare.com/capnweb-javascript-rpc-library/"><u>Cap'n Web RPC</u></a> bridge between the sandbox and your harness code, so that the agent can invoke your API across the security boundary without ever realizing that it isn't using a local library.</p><p>That means your agent can write code like this:</p>
            <pre><code>// Thinking: The user asked me to summarize recent chat messages from Alice.
// I will filter the recent message history in code so that I only have to
// read the relevant messages.
let history = await env.CHAT_ROOM.getHistory(1000);
return history.filter(msg =&gt; msg.author == "alice");
</code></pre>
            
    <div>
      <h3>HTTP filtering and credential injection</h3>
      <a href="#http-filtering-and-credential-injection">
        
      </a>
    </div>
    <p>If you prefer to give your agents HTTP APIs, that's fully supported. Using the <code>globalOutbound</code> option to the worker loader API, you can register a callback to be invoked on every HTTP request, in which you can inspect the request, rewrite it, inject auth keys, respond to it directly, block it, or anything else you might like.</p><p>For example, you can use this to implement <b>credential injection</b> (token injection): When the agent makes an HTTP request to a service that requires authorization, you add credentials to the request on the way out. This way, the agent itself never knows the secret credentials, and therefore cannot leak them.</p><p>Using a plain HTTP interface may be desirable when an agent is talking to a well-known API that is in its training set, or when you want your agent to use a library that is built on a REST API (the library can run inside the agent's sandbox).</p><p>With that said, <b>in the absence of a compatibility requirement, TypeScript RPC interfaces are better than HTTP:</b></p><ul><li><p>As shown above, a TypeScript interface requires far fewer tokens to describe than an HTTP interface.</p></li><li><p>The agent can write code to call TypeScript interfaces using far fewer tokens than equivalent HTTP.</p></li><li><p>With TypeScript interfaces, since you are defining your own wrapper interface anyway, it is easier to narrow the interface to expose exactly the capabilities that you want to provide to your agent, both for simplicity and security. With HTTP, you are more likely implementing <i>filtering</i> of requests made against some existing API. This is hard, because your proxy must fully interpret the meaning of every API call in order to properly decide whether to allow it, and HTTP requests are complicated, with many headers and other parameters that could all be meaningful. It ends up being easier to just write a TypeScript wrapper that only implements the functions you want to allow.</p></li></ul>
    <div>
      <h3>Battle-hardened security</h3>
      <a href="#battle-hardened-security">
        
      </a>
    </div>
    <p>Hardening an isolate-based sandbox is tricky, as it is a more complicated attack surface than hardware virtual machines. Although all sandboxing mechanisms have bugs, security bugs in V8 are more common than security bugs in typical hypervisors. When using isolates to sandbox possibly-malicious code, it's important to have additional layers of defense-in-depth. Google Chrome, for example, implemented strict process isolation for this reason, but it is not the only possible solution.</p><p>We have nearly a decade of experience securing our isolate-based platform. Our systems automatically deploy V8 security patches to production within hours — faster than Chrome itself. Our <a href="https://blog.cloudflare.com/mitigating-spectre-and-other-security-threats-the-cloudflare-workers-security-model/"><u>security architecture</u></a> features a custom second-layer sandbox with dynamic cordoning of tenants based on risk assessments. <a href="https://blog.cloudflare.com/safe-in-the-sandbox-security-hardening-for-cloudflare-workers/"><u>We've extended the V8 sandbox itself</u></a> to leverage hardware features like MPK. We've teamed up with (and hired) leading researchers to develop <a href="https://blog.cloudflare.com/spectre-research-with-tu-graz/"><u>novel defenses against Spectre</u></a>. We also have systems that scan code for malicious patterns and automatically block them or apply additional layers of sandboxing. And much more.</p><p>When you use Dynamic Workers on Cloudflare, you get all of this automatically.</p>
    <div>
      <h2>Helper libraries</h2>
      <a href="#helper-libraries">
        
      </a>
    </div>
    <p>We've built a number of libraries that you might find useful when working with Dynamic Workers: </p>
    <div>
      <h3>Code Mode</h3>
      <a href="#code-mode">
        
      </a>
    </div>
    <p><a href="https://www.npmjs.com/package/@cloudflare/codemode"><code>@cloudflare/codemode</code></a> simplifies running model-generated code against AI tools using Dynamic Workers. At its core is <code>DynamicWorkerExecutor()</code>, which constructs a purpose-built sandbox with code normalisation to handle common formatting errors, and direct access to a <code>globalOutbound</code> fetcher for controlling <code>fetch()</code> behaviour inside the sandbox — set it to <code>null</code> for full isolation, or pass a <code>Fetcher</code> binding to route, intercept or enrich outbound requests from the sandbox.</p>
            <pre><code>const executor = new DynamicWorkerExecutor({
  loader: env.LOADER,
  globalOutbound: null, // fully isolated 
});

const codemode = createCodeTool({
  tools: myTools,
  executor,
});

return generateText({
  model,
  messages,
  tools: { codemode },
});
</code></pre>
            <p>The Code Mode SDK also provides two server-side utility functions. <code>codeMcpServer({ server, executor })</code> wraps an existing MCP Server, replacing its tool surface with a single <code>code()</code> tool. <code>openApiMcpServer({ spec, executor, request })</code> goes further: given an OpenAPI spec and an executor, it builds a complete MCP Server with <code>search()</code> and <code>execute()</code> tools as used by the Cloudflare MCP Server, and better suited to larger APIs.</p><p>In both cases, the code generated by the model runs inside Dynamic Workers, with calls to external services made over RPC bindings passed to the executor.</p><p><a href="https://www.npmjs.com/package/@cloudflare/codemode"><u>Learn more about the library and how to use it.</u></a> </p>
    <div>
      <h3>Bundling</h3>
      <a href="#bundling">
        
      </a>
    </div>
    <p>Dynamic Workers expect pre-bundled modules. <a href="https://www.npmjs.com/package/@cloudflare/worker-bundler"><code>@cloudflare/worker-bundler</code></a> handles that for you: give it source files and a <code>package.json</code>, and it resolves npm dependencies from the registry, bundles everything with <code>esbuild</code>, and returns the module map the Worker Loader expects.</p>
            <pre><code>import { createWorker } from "@cloudflare/worker-bundler";

const worker = env.LOADER.get("my-worker", async () =&gt; {
  const { mainModule, modules } = await createWorker({
    files: {
      "src/index.ts": `
        import { Hono } from 'hono';
        import { cors } from 'hono/cors';

        const app = new Hono();
        app.use('*', cors());
        app.get('/', (c) =&gt; c.text('Hello from Hono!'));
        app.get('/json', (c) =&gt; c.json({ message: 'It works!' }));

        export default app;
      `,
      "package.json": JSON.stringify({
        dependencies: { hono: "^4.0.0" }
      })
    }
  });

  return { mainModule, modules, compatibilityDate: "2026-01-01" };
});

await worker.getEntrypoint().fetch(request);
</code></pre>
            <p>It also supports full-stack apps via <code>createApp</code> — bundle a server Worker, client-side JavaScript, and static assets together, with built-in asset serving that handles content types, ETags, and SPA routing.</p><p><a href="https://www.npmjs.com/package/@cloudflare/worker-bundler"><u>Learn more about the library and how to use it.</u></a></p>
    <div>
      <h3>File manipulation</h3>
      <a href="#file-manipulation">
        
      </a>
    </div>
    <p><a href="https://www.npmjs.com/package/@cloudflare/shell"><code>@cloudflare/shell</code></a> gives your agent a virtual filesystem inside a Dynamic Worker. Agent code calls typed methods on a <code>state</code> object — read, write, search, replace, diff, glob, JSON query/update, archive — with structured inputs and outputs instead of string parsing.</p><p>Storage is backed by a durable <code>Workspace</code> (SQLite + R2), so files persist across executions. Coarse operations like <code>searchFiles</code>, <code>replaceInFiles</code>, and <code>planEdits</code> minimize RPC round-trips — the agent issues one call instead of looping over individual files. Batch writes are transactional by default: if any write fails, earlier writes roll back automatically.</p>
            <pre><code>import { Workspace } from "@cloudflare/shell";
import { stateTools } from "@cloudflare/shell/workers";
import { DynamicWorkerExecutor, resolveProvider } from "@cloudflare/codemode";

const workspace = new Workspace({
  sql: this.ctx.storage.sql, // Works with any DO's SqlStorage, D1, or custom SQL backend
  r2: this.env.MY_BUCKET, // large files spill to R2 automatically
  name: () =&gt; this.name   // lazy — resolved when needed, not at construction
});

// Code runs in an isolated Worker sandbox with no network access
const executor = new DynamicWorkerExecutor({ loader: env.LOADER });

// The LLM writes this code; `state.*` calls dispatch back to the host via RPC
const result = await executor.execute(
  `async () =&gt; {
    // Search across all TypeScript files for a pattern
    const hits = await state.searchFiles("src/**/*.ts", "answer");
    // Plan multiple edits as a single transaction
    const plan = await state.planEdits([
      { kind: "replace", path: "/src/app.ts",
        search: "42", replacement: "43" },
      { kind: "writeJson", path: "/src/config.json",
        value: { version: 2 } }
    ]);
    // Apply atomically — rolls back on failure
    return await state.applyEditPlan(plan);
  }`,
  [resolveProvider(stateTools(workspace))]
);</code></pre>
            <p>The package also ships prebuilt TypeScript type declarations and a system prompt template, so you can drop the full <code>state</code> API into your LLM context in a handful of tokens.</p><p><a href="https://www.npmjs.com/package/@cloudflare/shell"><u>Learn more about the library and how to use it.</u></a></p>
    <div>
      <h2>How are people using it?</h2>
      <a href="#how-are-people-using-it">
        
      </a>
    </div>
    
    <div>
      <h4>Code Mode</h4>
      <a href="#code-mode">
        
      </a>
    </div>
    <p>Developers want their agents to write and execute code against tool APIs, rather than making sequential tool calls one at a time. With Dynamic Workers, the LLM generates a single TypeScript function that chains multiple API calls together, runs it in a Dynamic Worker, and returns the final result back to the agent. As a result, only the output, and not every intermediate step, ends up in the context window. This cuts both latency and token usage, and produces better results, especially when the tool surface is large.</p><p>Our own <a href="https://github.com/cloudflare/mcp-server-cloudflare">Cloudflare MCP server</a> is built exactly this way: it exposes the entire Cloudflare API through just two tools — search and execute — in under 1,000 tokens, because the agent writes code against a typed API instead of navigating hundreds of individual tool definitions.</p>
    <div>
      <h4>Building custom automations </h4>
      <a href="#building-custom-automations">
        
      </a>
    </div>
    <p>Developers are using Dynamic Workers to let agents build custom automations on the fly. <a href="https://www.zite.com/"><u>Zite</u></a>, for example, is building an app platform where users interact through a chat interface — the LLM writes TypeScript behind the scenes to build CRUD apps, connect to services like Stripe, Airtable, and Google Calendar, and run backend logic, all without the user ever seeing a line of code. Every automation runs in its own Dynamic Worker, with access to only the specific services and libraries that the endpoint needs.</p><blockquote><p><i>“To enable server-side code for Zite’s LLM-generated apps, we needed an execution layer that was instant, isolated, and secure. Cloudflare’s Dynamic Workers hit the mark on all three, and out-performed all of the other platforms we benchmarked for speed and library support. The NodeJS compatible runtime supported all of Zite’s workflows, allowing hundreds of third party integrations, without sacrificing on startup time. Zite now services millions of execution requests daily thanks to Dynamic Workers.” </i></p><p><i>— </i><b><i>Antony Toron</i></b><i>, CTO and Co-Founder, Zite </i></p></blockquote>
    <div>
      <h4>Running AI-generated applications</h4>
      <a href="#running-ai-generated-applications">
        
      </a>
    </div>
    <p>Developers are building platforms that generate full applications from AI — either for their customers or for internal teams building prototypes. With Dynamic Workers, each app can be spun up on demand, then put back into cold storage until it's invoked again. Fast startup times make it easy to preview changes during active development. Platforms can also block or intercept any network requests the generated code makes, keeping AI-generated apps safe to run.</p>
    <div>
      <h2>Pricing</h2>
      <a href="#pricing">
        
      </a>
    </div>
    <p>Dynamically-loaded Workers are priced at $0.002 per unique Worker loaded per day (as of this post’s publication), in addition to the usual CPU time and invocation pricing of regular Workers.</p><p>For AI-generated "code mode" use cases, where every Worker is a unique one-off, this means the price is $0.002 per Worker loaded (plus CPU and invocations). This cost is typically negligible compared to the inference costs to generate the code.</p><p>During the beta period, the $0.002 charge is waived. As pricing is subject to change, please always check our Dynamic Workers <a href="https://developers.cloudflare.com/dynamic-workers/pricing/"><u>pricing</u></a> for the most current information. </p>
    <div>
      <h2>Get Started</h2>
      <a href="#get-started">
        
      </a>
    </div>
    <p>If you’re on the Workers Paid plan, you can start using <a href="https://developers.cloudflare.com/dynamic-workers/">Dynamic Workers</a> today. </p>
    <div>
      <h4>Dynamic Workers Starter</h4>
      <a href="#dynamic-workers-starter">
        
      </a>
    </div>
    <a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/agents/tree/main/examples/dynamic-workers"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p>
<p>Use this “hello world” <a href="https://github.com/cloudflare/agents/tree/main/examples/dynamic-workers">starter</a> to get a Worker deployed that can load and execute Dynamic Workers. </p>
    <div>
      <h4>Dynamic Workers Playground</h4>
      <a href="#dynamic-workers-playground">
        
      </a>
    </div>
    <a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/agents/tree/main/examples/dynamic-workers-playground"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>You can also deploy the <a href="https://github.com/cloudflare/agents/tree/main/examples/dynamic-workers-playground">Dynamic Workers Playground</a>, where you’ll be able to write or import code, bundle it at runtime with <code>@cloudflare/worker-bundler</code>, execute it through a Dynamic Worker, see real-time responses and execution logs. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/32d0ficYALnSneKc4jZPja/0d4d07d747fc14936f16071714b7a8e5/BLOG-3243_2.png" />
          </figure><p>Dynamic Workers are fast, scalable, and lightweight. <a href="https://discord.com/channels/595317990191398933/1460655307255578695"><u>Find us on Discord</u></a> if you have any questions. We’d love to see what you build!</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/mQOJLnMtXULmj6l3DgKZg/ef2ee4cef616bc2d9a7caf35df5834f5/BLOG-3243_3.png" />
          </figure><p></p> ]]></content:encoded>
            <category><![CDATA[MCP]]></category>
            <category><![CDATA[Workers AI]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Agents]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">1tc7f8AggVLw5D8OmaZri5</guid>
            <dc:creator>Kenton Varda</dc:creator>
            <dc:creator>Sunil Pai</dc:creator>
            <dc:creator>Ketan Gupta</dc:creator>
        </item>
        <item>
            <title><![CDATA[An AI Index for all our customers]]></title>
            <link>https://blog.cloudflare.com/an-ai-index-for-all-our-customers/</link>
            <pubDate>Fri, 26 Sep 2025 14:00:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare will soon automatically create an AI-optimized search index for your domain, and expose a set of ready-to-use standard APIs and tools including an MCP server, LLMs.txt, and a search API. ]]></description>
            <content:encoded><![CDATA[ <p>Today, we’re announcing the <b>private beta</b> of <b>AI Index </b>for domains on Cloudflare, a new type of web index that gives content creators the tools to make their data discoverable by AI, and gives AI builders access to better data for fair compensation.</p><p>With AI Index enabled on your domain, we will automatically create an AI-optimized search index for your website, and expose a set of ready-to-use standard APIs and tools including an MCP server, LLMs.txt, and a search API. Our customers will own and control that index and how it’s used, and you will have the ability to monetize access through <a href="https://developers.cloudflare.com/ai-crawl-control/features/pay-per-crawl/what-is-pay-per-crawl/"><u>Pay per crawl</u></a> and the new <a href="https://blog.cloudflare.com/x402/"><u>x402 integrations</u></a>. You will be able to use it to build modern search experiences on your own site, and more importantly, interact with external AI and Agentic providers to make your content more discoverable while being fairly compensated.</p><p>For AI builders—whether developers creating agentic applications, or AI platform companies providing foundational LLM models—Cloudflare will offer a new way to discover and retrieve web content: direct <b>pub/sub connections</b> to individual websites with AI Index. Instead of indiscriminate crawling, builders will be able to subscribe to specific sites that have opted in for discovery, receive structured updates as soon as content changes, and pay fairly for each access. Access is always at the discretion of the site owner.</p><p>From the individual indexes, Cloudflare will also build an aggregated layer, the <b>Open Index</b>, that bundles together participating sites. Builders get a single place to search across collections or the broader web, while every site still retains control and can earn from participation. </p>
    <div>
      <h3>Why build an AI Index?</h3>
      <a href="#why-build-an-ai-index">
        
      </a>
    </div>
    <p>AI platforms are quickly becoming one of the main ways people discover information online. Whether asking a chatbot to summarize a news article or find a product recommendation, the path to that answer almost always starts with crawling original content and indexing or using that data for training. However, today, that process is largely controlled by platforms: what gets crawled, how often, and whether the site owner has any input in the matter.</p><p>Although Cloudflare now offers to monitor and control how AI services respect your access policies and how they access your content, it's still challenging to make new content visible. Content creators have no efficient way to signal to AI builders when a page is published or updated. On the other hand, for AI builders, crawling and recrawling unstructured content is costly, wastes resources, especially when you don’t know the quality and cost in advance.</p><p>We need a fairer and healthier ecosystem for content discovery and usage that bridges the gap between content creators and AI builders.</p>
    <div>
      <h3>How AI Index will work</h3>
      <a href="#how-ai-index-will-work">
        
      </a>
    </div>
    <p>When you onboard a domain to Cloudflare, or if you have an existing domain on Cloudflare, you will have the choice to enable an AI Index. If enabled, we will automatically create an AI-optimized search index for your domain that you own and control.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3kV7Oru6D5jPWeGeWDQDsi/7d738250f24250cf98db2e96222319ec/image1.png" />
          </figure><p>As your site updates and grows, the index will evolve with it. New or updated pages will be processed in real-time using the same technology that powers Cloudflare <a href="https://developers.cloudflare.com/ai-search/"><u>AI Search (formerly AutoRAG)</u></a> and its <a href="https://developers.cloudflare.com/ai-search/configuration/data-source/website/"><u>Website</u></a> as a data source. Best of all, we will manage everything; you won't have to worry about each individual component of compute, storage resources, databases, embeddings, chunking, or AI models. Everything will happen behind the scenes, automatically.</p><p>Importantly, you will have control over what content to <b>include or exclude </b>from your website's index, and <b>who</b> can get access to your content via <b>AI</b> <b>Crawl Control</b>, ensuring that only the data you want to expose is made searchable and accessible. You also will be able to opt out of the AI Index completely; it will all be up to you.</p><p>When your AI Index is set up, you will get a set of ready-to-use APIs:                                                                                                                                                   </p><ul><li><p><b>An MCP Server: </b>Agentic applications will be able to connect directly to your site using the <a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/"><u>Model Context Protocol (MCP)</u></a>, making your content discoverable to agents in a standardized way. This includes support for <a href="https://developers.cloudflare.com/ai-search/how-to/nlweb/"><u>NLWeb</u></a> tools, an open project developed by Microsoft that defines a standard protocol for natural language queries on websites.</p></li><li><p><b>A flexible search API: </b>This endpoint will<b> </b>return relevant results in structured JSON. </p></li><li><p><b>LLMs.txt and LLMs-full.txt: </b>Standard files that provide LLMs with a machine-readable map of your site, following <a href="https://github.com/AnswerDotAI/llms-txt"><u>emerging open standards</u></a>. These will help models understand how to use your site’s content at inference time. An example of <a href="https://developers.cloudflare.com/llms.txt"><u>llms.txt</u></a> exists in the Cloudflare Developer Documentation.</p></li><li><p><b>A bulk data API: </b>An endpoint<b> </b>for transferring large amounts of content efficiently, available under the rules you set. Instead of querying for every document, AI providers will be able to ingest in one shot.</p></li><li><p><b>Pub-sub subscriptions: </b>AI platforms will be able to subscribe to your site’s index and receive events and content updates directly from Cloudflare in a structured format in real-time, making it easy for them to stay current without re-crawling.</p></li><li><p><b>Discoverability directives:</b> In robots.txt and well-known URIs to allow AI agents and crawlers visiting your site to discover and use the available API automatically.</p></li></ul>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4Hr3EhsMBH0oVwMVKywwre/2a01efbe03d67a8154123b63c05c000f/image3.png" />
          </figure><p>The index will integrate directly with <a href="https://developers.cloudflare.com/ai-crawl-control/"><u>AI Crawl Control</u></a>, so you will be able to see who’s accessing your content, set rules, and manage permissions. And with <a href="https://developers.cloudflare.com/ai-crawl-control/features/pay-per-crawl/what-is-pay-per-crawl/"><u>Pay per crawl</u></a> and <a href="https://blog.cloudflare.com/x402/"><u>x402 integrations</u></a>, you can choose to directly monetize access to your content. </p>
    <div>
      <h3>A feed of the web for AI builders</h3>
      <a href="#a-feed-of-the-web-for-ai-builders">
        
      </a>
    </div>
    <p>As an AI builder, you will be able to discover and subscribe to high-quality, permissioned web data through individual site’s AI indexes. Instead of sending crawlers blindly across the open Internet, you will connect via a pub/sub model: participating websites will expose structured updates whenever their content changes, and you will be able to subscribe to receive those updates in real-time. With this model, your new workflow may look something like this:</p><ol><li><p><b>Discover websites that have opted in: </b>Browse and filter through a directory of websites that make their indexes available through Cloudflare.</p></li><li><p><b>Evaluate content with metadata and metrics: </b>Get content metadata information on various metrics (e.g., uniqueness, depth, contextual relevance, popularity) before accessing it.</p></li><li><p><b>Pay fairly for access:</b> When content is valuable, platforms can compensate creators directly through Pay per crawl. These payments not only enable access but also support the continued creation of original content, helping to sustain a healthier ecosystem for discovery.</p></li><li><p><b>Subscribe to updates: </b>Use pub-sub subscriptions to receive events about changes made by the website, so you know when to retrieve or crawl for new content without wasting resources on constant re-crawling. </p></li></ol><p>By shifting from blind crawling to a permissioned pub/sub system for the web, AI builders save time, cut costs, and gain access to cleaner, high-quality data while content creators remain in control and are fairly compensated.</p>
    <div>
      <h3>The aggregated Open Index</h3>
      <a href="#the-aggregated-open-index">
        
      </a>
    </div>
    <p>Individual indexes provide AI platforms with the ability to access data directly from specific sites, allowing them to subscribe for updates, evaluate value, and pay for full content access on a per-site basis. But when builders need to work at a larger scale, managing dozens or hundreds of separate subscriptions can become complex. The <b>Open Index </b>will provide an additional option: a bundled, opt-in collection of those indexes, featuring sophisticated features such as quality, uniqueness, originality, and depth of content filters, all accessible in one place.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6rjkK5UCh9BLSqceUuG0RI/92413aed318baced0ee8812bec511cfb/image2.png" />
          </figure><p>The Open Index is designed to make content discovery at scale easier:</p><ul><li><p><b>Get unified access: </b>Query and retrieve data across many participating sites simultaneously. This reduces integration overhead and enables builders to plug into a curated collection of data, or use it as a ready-made web search layer that can be accessed at query time.</p></li><li><p><b>Discover broader scopes: </b>Work with topic-specific bundles (e.g., news, documentation, scientific research) or a general discovery index covering the broader web. This makes it simple to explore new content sources you may not have identified individually.</p></li><li><p><b>Bottom-up monetization: </b>Results still originate from an individual site’s AI index, with monetization flowing back to that site through Pay per crawl, helping preserve fairness and sustainability at scale.</p></li></ul><p>Together, per-site AI indexes and the Open Index will provide flexibility and precise control when you want full content from individual sites (i.e., for training, AI agents, or search experiences), and broad search coverage when you need a unified search across the web.</p>
    <div>
      <h3>How you can participate in the shift</h3>
      <a href="#how-you-can-participate-in-the-shift">
        
      </a>
    </div>
    <p>With AI Index and the Cloudflare Open Index, we’re creating a model where websites decide how their content is accessed, and AI builders receive structured, reliable data at scale to build a fairer and healthier ecosystem for content discovery and usage on the Internet.</p><p>We’re starting with a <b>private beta</b>. If you want to enroll your website into the AI Index or access the pub/sub web feed as an AI builder, you can <a href="https://www.cloudflare.com/aiindex-signup/"><b><u>sign up today</u></b></a>.</p> ]]></content:encoded>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Pay Per Crawl]]></category>
            <category><![CDATA[AI Search]]></category>
            <category><![CDATA[MCP]]></category>
            <guid isPermaLink="false">7rcW6x4j6v7O6ZEHir5fmK</guid>
            <dc:creator>Celso Martinho</dc:creator>
            <dc:creator>Anni Wang</dc:creator>
        </item>
        <item>
            <title><![CDATA[Code Mode: the better way to use MCP]]></title>
            <link>https://blog.cloudflare.com/code-mode/</link>
            <pubDate>Fri, 26 Sep 2025 13:00:00 GMT</pubDate>
            <description><![CDATA[ It turns out we've all been using MCP wrong. Most agents today use MCP by exposing the "tools" directly to the LLM. ]]></description>
            <content:encoded><![CDATA[ <p>It turns out we've all been using MCP wrong.</p><p>Most agents today use MCP by directly exposing the "tools" to the <a href="https://www.cloudflare.com/learning/ai/what-is-large-language-model/"><u>LLM</u></a>.</p><p>We tried something different: Convert the MCP tools into a TypeScript API, and then ask an LLM to write code that calls that API.</p><p>The results are striking:</p><ol><li><p>We found agents are able to handle many more tools, and more complex tools, when those tools are presented as a TypeScript API rather than directly. Perhaps this is because LLMs have an enormous amount of real-world TypeScript in their training set, but only a small set of contrived examples of tool calls.</p></li><li><p>The approach really shines when an agent needs to string together multiple calls. With the traditional approach, the output of each tool call must feed into the LLM's neural network, just to be copied over to the inputs of the next call, wasting time, energy, and tokens. When the LLM can write code, it can skip all that, and only read back the final results it needs.</p></li></ol><p>In short, LLMs are better at writing code to call MCP, than at calling MCP directly.</p>
    <div>
      <h2>What's MCP?</h2>
      <a href="#whats-mcp">
        
      </a>
    </div>
    <p>For those that aren't familiar: <a href="https://modelcontextprotocol.io/docs/getting-started/intro"><u>Model Context Protocol</u></a> is a standard protocol for giving AI agents access to external tools, so that they can directly perform work, rather than just chat with you.</p><p>Seen another way, MCP is a uniform way to:</p><ul><li><p>expose an API for doing something,</p></li><li><p>along with documentation needed for an LLM to understand it,</p></li><li><p>with authorization handled out-of-band.</p></li></ul><p>MCP has been making waves throughout 2025 as it has suddenly greatly expanded the capabilities of AI agents.</p><p>The "API" exposed by an MCP server is expressed as a set of "tools". Each tool is essentially a remote procedure call (RPC) function – it is called with some parameters and returns a response. Most modern LLMs have <a href="https://developers.cloudflare.com/workers-ai/features/function-calling/"><u>the capability to use "tools" (sometimes called "function calling")</u></a>, meaning they are trained to output text in a certain format when they want to invoke a tool. The program invoking the LLM sees this format and invokes the tool as specified, then feeds the results back into the LLM as input.</p>
    <div>
      <h3>Anatomy of a tool call</h3>
      <a href="#anatomy-of-a-tool-call">
        
      </a>
    </div>
    <p>Under the hood, an LLM generates a stream of "tokens" representing its output. A token might represent a word, a syllable, some sort of punctuation, or some other component of text.</p><p>A tool call, though, involves a token that does <i>not</i> have any textual equivalent. The LLM is trained (or, more often, fine-tuned) to understand a special token that it can output that means "the following should be interpreted as a tool call," and another special token that means "this is the end of the tool call." Between these two tokens, the LLM will typically write tokens corresponding to some sort of JSON message that describes the call.</p><p>For instance, imagine you have connected an agent to an MCP server that provides weather info, and you then ask the agent what the weather is like in Austin, TX. Under the hood, the LLM might generate output like the following. Note that here we've used words in <code>&lt;|</code> and <code>|&gt;</code> to represent our special tokens, but in fact, these tokens do not represent text at all; this is just for illustration.</p><p>I will use the Weather MCP server to find out the weather in Austin, TX.</p>
            <pre><code>I will use the Weather MCP server to find out the weather in Austin, TX.

&lt;|tool_call|&gt;
{
  "name": "get_current_weather",
  "arguments": {
    "location": "Austin, TX, USA"
  }
}
&lt;|end_tool_call|&gt;</code></pre>
            <p>Upon seeing these special tokens in the output, the LLM's harness will interpret the sequence as a tool call. After seeing the end token, the harness pauses execution of the LLM. It parses the JSON message and returns it as a separate component of the structured API result. The agent calling the LLM API sees the tool call, invokes the relevant MCP server, and then sends the results back to the LLM API. The LLM's harness will then use another set of special tokens to feed the result back into the LLM:</p>
            <pre><code>&lt;|tool_result|&gt;
{
  "location": "Austin, TX, USA",
  "temperature": 93,
  "unit": "fahrenheit",
  "conditions": "sunny"
}
&lt;|end_tool_result|&gt;</code></pre>
            <p>The LLM reads these tokens in exactly the same way it would read input from the user – except that the user cannot produce these special tokens, so the LLM knows it is the result of the tool call. The LLM then continues generating output like normal.</p><p>Different LLMs may use different formats for tool calling, but this is the basic idea.</p>
    <div>
      <h3>What's wrong with this?</h3>
      <a href="#whats-wrong-with-this">
        
      </a>
    </div>
    <p>The special tokens used in tool calls are things LLMs have never seen in the wild. They must be specially trained to use tools, based on synthetic training data. They aren't always that good at it. If you present an LLM with too many tools, or overly complex tools, it may struggle to choose the right one or to use it correctly. As a result, MCP server designers are encouraged to present greatly simplified APIs as compared to the more traditional API they might expose to developers.</p><p>Meanwhile, LLMs are getting really good at writing code. In fact, LLMs asked to write code against the full, complex APIs normally exposed to developers don't seem to have too much trouble with it. Why, then, do MCP interfaces have to "dumb it down"? Writing code and calling tools are almost the same thing, but it seems like LLMs can do one much better than the other?</p><p>The answer is simple: LLMs have seen a lot of code. They have not seen a lot of "tool calls". In fact, the tool calls they have seen are probably limited to a contrived training set constructed by the LLM's own developers, in order to try to train it. Whereas they have seen real-world code from millions of open source projects.</p><p><b><i>Making an LLM perform tasks with tool calling is like putting Shakespeare through a month-long class in Mandarin and then asking him to write a play in it. It's just not going to be his best work.</i></b></p>
    <div>
      <h3>But MCP is still useful, because it is uniform</h3>
      <a href="#but-mcp-is-still-useful-because-it-is-uniform">
        
      </a>
    </div>
    <p>MCP is designed for tool-calling, but it doesn't actually <i>have to</i> be used that way.</p><p>The "tools" that an MCP server exposes are really just an RPC interface with attached documentation. We don't really <i>have to</i> present them as tools. We can take the tools, and turn them into a programming language API instead.</p><p>But why would we do that, when the programming language APIs already exist independently? Almost every MCP server is just a wrapper around an existing traditional API – why not expose those APIs?</p><p>Well, it turns out MCP does something else that's really useful: <b>It provides a uniform way to connect to and learn about an API.</b></p><p>An AI agent can use an MCP server even if the agent's developers never heard of the particular MCP server, and the MCP server's developers never heard of the particular agent. This has rarely been true of traditional APIs in the past. Usually, the client developer always knows exactly what API they are coding for. As a result, every API is able to do things like basic connectivity, authorization, and documentation a little bit differently.</p><p>This uniformity is useful even when the AI agent is writing code. We'd like the AI agent to run in a sandbox such that it can only access the tools we give it. MCP makes it possible for the agentic framework to implement this, by handling connectivity and authorization in a standard way, independent of the AI code. We also don't want the AI to have to search the Internet for documentation; MCP provides it directly in the protocol.</p>
    <div>
      <h2>OK, how does it work?</h2>
      <a href="#ok-how-does-it-work">
        
      </a>
    </div>
    <p>We have already extended the <a href="https://developers.cloudflare.com/agents/"><u>Cloudflare Agents SDK</u></a> to support this new model!</p><p>For example, say you have an app built with ai-sdk that looks like this:</p>
            <pre><code>const stream = streamText({
  model: openai("gpt-5"),
  system: "You are a helpful assistant",
  messages: [
    { role: "user", content: "Write a function that adds two numbers" }
  ],
  tools: {
    // tool definitions 
  }
})</code></pre>
            <p>You can wrap the tools and prompt with the codemode helper, and use them in your app: </p>
            <pre><code>import { codemode } from "agents/codemode/ai";

const {system, tools} = codemode({
  system: "You are a helpful assistant",
  tools: {
    // tool definitions 
  },
  // ...config
})

const stream = streamText({
  model: openai("gpt-5"),
  system,
  tools,
  messages: [
    { role: "user", content: "Write a function that adds two numbers" }
  ]
})</code></pre>
            <p>With this change, your app will now start generating and running code that itself will make calls to the tools you defined, MCP servers included. We will introduce variants for other libraries in the very near future. <a href="https://github.com/cloudflare/agents/blob/main/docs/codemode.md"><u>Read the docs</u></a> for more details and examples. </p>
    <div>
      <h3>Converting MCP to TypeScript</h3>
      <a href="#converting-mcp-to-typescript">
        
      </a>
    </div>
    <p>When you connect to an MCP server in "code mode", the Agents SDK will fetch the MCP server's schema, and then convert it into a TypeScript API, complete with doc comments based on the schema.</p><p>For example, connecting to the MCP server at <a href="https://gitmcp.io/cloudflare/agents"><u>https://gitmcp.io/cloudflare/agents</u></a>, will generate a TypeScript definition like this:</p>
            <pre><code>interface FetchAgentsDocumentationInput {
  [k: string]: unknown;
}
interface FetchAgentsDocumentationOutput {
  [key: string]: any;
}

interface SearchAgentsDocumentationInput {
  /**
   * The search query to find relevant documentation
   */
  query: string;
}
interface SearchAgentsDocumentationOutput {
  [key: string]: any;
}

interface SearchAgentsCodeInput {
  /**
   * The search query to find relevant code files
   */
  query: string;
  /**
   * Page number to retrieve (starting from 1). Each page contains 30
   * results.
   */
  page?: number;
}
interface SearchAgentsCodeOutput {
  [key: string]: any;
}

interface FetchGenericUrlContentInput {
  /**
   * The URL of the document or page to fetch
   */
  url: string;
}
interface FetchGenericUrlContentOutput {
  [key: string]: any;
}

declare const codemode: {
  /**
   * Fetch entire documentation file from GitHub repository:
   * cloudflare/agents. Useful for general questions. Always call
   * this tool first if asked about cloudflare/agents.
   */
  fetch_agents_documentation: (
    input: FetchAgentsDocumentationInput
  ) =&gt; Promise&lt;FetchAgentsDocumentationOutput&gt;;

  /**
   * Semantically search within the fetched documentation from
   * GitHub repository: cloudflare/agents. Useful for specific queries.
   */
  search_agents_documentation: (
    input: SearchAgentsDocumentationInput
  ) =&gt; Promise&lt;SearchAgentsDocumentationOutput&gt;;

  /**
   * Search for code within the GitHub repository: "cloudflare/agents"
   * using the GitHub Search API (exact match). Returns matching files
   * for you to query further if relevant.
   */
  search_agents_code: (
    input: SearchAgentsCodeInput
  ) =&gt; Promise&lt;SearchAgentsCodeOutput&gt;;

  /**
   * Generic tool to fetch content from any absolute URL, respecting
   * robots.txt rules. Use this to retrieve referenced urls (absolute
   * urls) that were mentioned in previously fetched documentation.
   */
  fetch_generic_url_content: (
    input: FetchGenericUrlContentInput
  ) =&gt; Promise&lt;FetchGenericUrlContentOutput&gt;;
};</code></pre>
            <p>This TypeScript is then loaded into the agent's context. Currently, the entire API is loaded, but future improvements could allow an agent to search and browse the API more dynamically – much like an agentic coding assistant would.</p>
    <div>
      <h3>Running code in a sandbox</h3>
      <a href="#running-code-in-a-sandbox">
        
      </a>
    </div>
    <p>Instead of being presented with all the tools of all the connected MCP servers, our agent is presented with just one tool, which simply executes some TypeScript code.</p><p>The code is then executed in a secure sandbox. The sandbox is totally isolated from the Internet. Its only access to the outside world is through the TypeScript APIs representing its connected MCP servers.</p><p>These APIs are backed by RPC invocation which calls back to the agent loop. There, the Agents SDK dispatches the call to the appropriate MCP server.</p><p>The sandboxed code returns results to the agent in the obvious way: by invoking <code>console.log()</code>. When the script finishes, all the output logs are passed back to the agent.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6DRERHP138FSj3GG0QYj3M/99e8c09b352560b7d4547ca299482c27/image2.png" />
          </figure>
    <div>
      <h2>Dynamic Worker loading: no containers here</h2>
      <a href="#dynamic-worker-loading-no-containers-here">
        
      </a>
    </div>
    <p>This new approach requires access to a secure sandbox where arbitrary code can run. So where do we find one? Do we have to run containers? Is that expensive?</p><p>No. There are no containers. We have something much better: isolates.</p><p>The Cloudflare Workers platform has always been based on V8 isolates, that is, isolated JavaScript runtimes powered by the <a href="https://v8.dev/"><u>V8 JavaScript engine</u></a>.</p><p><b>Isolates are far more lightweight than containers.</b> An isolate can start in a handful of milliseconds using only a few megabytes of memory.</p><p>Isolates are so fast that we can just create a new one for every piece of code the agent runs. There's no need to reuse them. There's no need to prewarm them. Just create it, on demand, run the code, and throw it away. It all happens so fast that the overhead is negligible; it's almost as if you were just eval()ing the code directly. But with security.</p>
    <div>
      <h3>The Worker Loader API</h3>
      <a href="#the-worker-loader-api">
        
      </a>
    </div>
    <p>Until now, though, there was no way for a Worker to directly load an isolate containing arbitrary code. All Worker code instead had to be uploaded via the Cloudflare API, which would then deploy it globally, so that it could run anywhere. That's not what we want for Agents! We want the code to just run right where the agent is.</p><p>To that end, we've added a new API to the Workers platform: the <a href="https://developers.cloudflare.com/workers/runtime-apis/bindings/worker-loader/"><u>Worker Loader API</u></a>. With it, you can load Worker code on-demand. Here's what it looks like:</p>
            <pre><code>// Gets the Worker with the given ID, creating it if no such Worker exists yet.
let worker = env.LOADER.get(id, async () =&gt; {
  // If the Worker does not already exist, this callback is invoked to fetch
  // its code.

  return {
    compatibilityDate: "2025-06-01",

    // Specify the worker's code (module files).
    mainModule: "foo.js",
    modules: {
      "foo.js":
        "export default {\n" +
        "  fetch(req, env, ctx) { return new Response('Hello'); }\n" +
        "}\n",
    },

    // Specify the dynamic Worker's environment (`env`).
    env: {
      // It can contain basic serializable data types...
      SOME_NUMBER: 123,

      // ... and bindings back to the parent worker's exported RPC
      // interfaces, using the new `ctx.exports` loopback bindings API.
      SOME_RPC_BINDING: ctx.exports.MyBindingImpl({props})
    },

    // Redirect the Worker's `fetch()` and `connect()` to proxy through
    // the parent worker, to monitor or filter all Internet access. You
    // can also block Internet access completely by passing `null`.
    globalOutbound: ctx.exports.OutboundProxy({props}),
  };
});

// Now you can get the Worker's entrypoint and send requests to it.
let defaultEntrypoint = worker.getEntrypoint();
await defaultEntrypoint.fetch("http://example.com");

// You can get non-default entrypoints as well, and specify the
// `ctx.props` value to be delivered to the entrypoint.
let someEntrypoint = worker.getEntrypoint("SomeEntrypointClass", {
  props: {someProp: 123}
});</code></pre>
            <p>You can start playing with this API right now when running <code>workerd</code> locally with Wrangler (<a href="https://developers.cloudflare.com/workers/runtime-apis/bindings/worker-loader/"><u>check out the docs</u></a>), and you can <a href="https://forms.gle/MoeDxE9wNiqdf8ri9"><u>sign up for beta access</u></a> to use it in production.</p>
    <div>
      <h2>Workers are better sandboxes</h2>
      <a href="#workers-are-better-sandboxes">
        
      </a>
    </div>
    <p>The design of Workers makes it unusually good at sandboxing, especially for this use case, for a few reasons:</p>
    <div>
      <h3>Faster, cheaper, disposable sandboxes</h3>
      <a href="#faster-cheaper-disposable-sandboxes">
        
      </a>
    </div>
    <p><a href="https://developers.cloudflare.com/workers/reference/how-workers-works/"><u>The Workers platform uses isolates instead of containers.</u></a> Isolates are much lighter-weight and faster to start up. It takes mere milliseconds to start a fresh isolate, and it's so cheap we can just create a new one for every single code snippet the agent generates. There's no need to worry about pooling isolates for reuse, prewarming, etc.</p><p>We have not yet finalized pricing for the Worker Loader API, but because it is based on isolates, we will be able to offer it at a significantly lower cost than container-based solutions.</p>
    <div>
      <h3>Isolated by default, but connected with bindings</h3>
      <a href="#isolated-by-default-but-connected-with-bindings">
        
      </a>
    </div>
    <p>Workers are just better at handling isolation.</p><p>In Code Mode, we prohibit the sandboxed worker from talking to the Internet. The global <code>fetch()</code> and <code>connect()</code> functions throw errors.</p><p>But on most platforms, this would be a problem. On most platforms, the way you get access to private resources is, you <i>start</i> with general network access. Then, using that network access, you send requests to specific services, passing them some sort of API key to authorize private access.</p><p>But Workers has always had a better answer. In Workers, the "environment" (<code>env</code> object) doesn't just contain strings, <a href="https://blog.cloudflare.com/workers-environment-live-object-bindings/"><u>it contains live objects</u></a>, also known as "bindings". These objects can provide direct access to private resources without involving generic network requests.</p><p>In Code Mode, we give the sandbox access to bindings representing the MCP servers it is connected to. Thus, the agent can specifically access those MCP servers <i>without</i> having network access in general.</p><p>Limiting access via bindings is much cleaner than doing it via, say, network-level filtering or HTTP proxies. Filtering is hard on both the LLM and the supervisor, because the boundaries are often unclear: the supervisor may have a hard time identifying exactly what traffic is legitimately necessary to talk to an API. Meanwhile, the LLM may have difficulty guessing what kinds of requests will be blocked. With the bindings approach, it's well-defined: the binding provides a JavaScript interface, and that interface is allowed to be used. It's just better this way.</p>
    <div>
      <h3>No API keys to leak</h3>
      <a href="#no-api-keys-to-leak">
        
      </a>
    </div>
    <p>An additional benefit of bindings is that they hide API keys. The binding itself provides an already-authorized client interface to the MCP server. All calls made on it go to the agent supervisor first, which holds the access tokens and adds them into requests sent on to MCP.</p><p>This means that the AI cannot possibly write code that leaks any keys, solving a common security problem seen in AI-authored code today.</p>
    <div>
      <h2>Try it now!</h2>
      <a href="#try-it-now">
        
      </a>
    </div>
    
    <div>
      <h3>Sign up for the production beta</h3>
      <a href="#sign-up-for-the-production-beta">
        
      </a>
    </div>
    <p>The Dynamic Worker Loader API is in closed beta. To use it in production, <a href="https://forms.gle/MoeDxE9wNiqdf8ri9"><u>sign up today</u></a>.</p>
    <div>
      <h3>Or try it locally</h3>
      <a href="#or-try-it-locally">
        
      </a>
    </div>
    <p>If you just want to play around, though, Dynamic Worker Loading is fully available today when developing locally with Wrangler and <code>workerd</code> – check out the docs for <a href="https://developers.cloudflare.com/workers/runtime-apis/bindings/worker-loader/"><u>Dynamic Worker Loading</u></a> and <a href="https://github.com/cloudflare/agents/blob/main/docs/codemode.md"><u>code mode in the Agents SDK</u></a> to get started.</p> ]]></content:encoded>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Birthday Week]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Agents]]></category>
            <category><![CDATA[MCP]]></category>
            <guid isPermaLink="false">61nEdL3TSdS4diA4x21O5e</guid>
            <dc:creator>Kenton Varda</dc:creator>
            <dc:creator>Sunil Pai</dc:creator>
        </item>
        <item>
            <title><![CDATA[Securing the AI Revolution: Introducing Cloudflare MCP Server Portals]]></title>
            <link>https://blog.cloudflare.com/zero-trust-mcp-server-portals/</link>
            <pubDate>Tue, 26 Aug 2025 14:05:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare MCP Server Portals are now available in Open Beta. MCP Server Portals are a new capability that enable you to centralize, secure, and observe every MCP connection in your organization. ]]></description>
            <content:encoded><![CDATA[ 
    <div>
      <h3><b>Securing the AI Revolution: Introducing Cloudflare MCP Server Portals</b></h3>
      <a href="#securing-the-ai-revolution-introducing-cloudflare-mcp-server-portals">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/learning/ai/what-is-large-language-model/"><u>Large Language Models (LLMs)</u></a> are rapidly evolving from impressive information retrieval tools into active, intelligent agents. The key to unlocking this transformation is the <b>Model Context Protocol (MCP)</b>, an open-source standard that allows LLMs to securely connect to and interact with any application — from Slack to Canva, to your own internal databases.</p><p>This is a massive leap forward. With MCP, an LLM client like Gemini, Claude, or ChatGPT can answer more than just "tell me about Slack." You can ask it: "What were the most critical engineering P0s in Jira from last week, and what is the current sentiment in the #engineering-support Slack channel regarding them? Then propose updates and bug fixes to merge."</p><p>This is the power of MCP: turning models into teammates.</p><p>But this great power comes with proportional risk. Connecting LLMs to your most critical applications creates a new, complex, and largely unprotected <a href="https://www.cloudflare.com/learning/security/what-is-an-attack-surface/"><u>attack surface</u></a>. Today, we change that. We’re excited to announce Cloudflare <b>MCP Server Portals</b> are now available in Open Beta. MCP Server Portals are a new capability that enable you to centralize, secure, and observe every MCP connection in your organization. This feature is part of <a href="https://www.cloudflare.com/zero-trust/"><u>Cloudflare One</u></a>, our <a href="https://www.cloudflare.com/learning/access-management/what-is-sase/"><u>secure access service edge (SASE)</u></a> platform that helps connect and protect your workspace.</p>
    <div>
      <h3><b>What Exactly is the Model Context Protocol?</b></h3>
      <a href="#what-exactly-is-the-model-context-protocol">
        
      </a>
    </div>
    <p>Think of <a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/"><u>MCP</u></a> as a universal translator or a digital switchboard for AI. It’s a standardized set of rules that lets two very different types of software—LLMs and everyday applications—talk to each other effectively. It consists of two primary components:</p><ul><li><p><b>MCP Clients:</b> These are the LLMs you interact with, like ChatGPT, Claude, or Gemini. The client is the front end to the AI that you use to ask questions and give commands.</p></li><li><p><b>MCP Servers:</b> These can be developed for any application you want to connect to your LLM. SaaS providers like Slack or Atlassian may offer MCP servers for their products, or your own developers can also build custom ones for internal tools.</p></li></ul>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4Du5DBczqtDdq3qhNPbQWt/479d741dcef445f73b5da82e716fdd32/image3.png" />
          </figure><p>Credit: <a href="https://modelcontextprotocol.io/docs/learn/architecture"><u>Architecture Overview - Model Context Protocol</u></a></p><p>For a useful connection, MCP relies on a few other key concepts:</p><ul><li><p><b>Resources:</b> A mechanism for the server to give the LLM context. This could be a specific file, a database schema, or a list of users in an application.</p></li><li><p><b>Prompts:</b> Standardized questions the server can ask the client to get the information it needs to fulfill a request (e.g., "Which user do you want to search for?").</p></li><li><p><b>Tools:</b> These are the actions the client can ask the server to perform, like querying a database, calling an API, or sending a message.</p></li></ul><p>Without MCP, your LLM is isolated. With MCP, it's integrated, capable of interacting with your entire software ecosystem in a structured and predictable way.</p>
    <div>
      <h3><b>The Peril of an Unsecured AI Ecosystem</b></h3>
      <a href="#the-peril-of-an-unsecured-ai-ecosystem">
        
      </a>
    </div>
    <p>Think of an LLM as the most brilliant and enthusiastic junior hire you've ever had. They have boundless energy and can produce incredible work, but they lack the years of judgment to know what they <i>shouldn't</i> do. The current, decentralized approach to MCP is like giving that junior hire a master key to every office and server room on their first day.</p><p>It's not a matter of <i>if</i> something will go wrong, but <i>when</i>.</p><p>This "shadow AI" infrastructure is the modern equivalent of the early Internet, where every server had a public IP address, fully exposed to the world. It’s the Wild West of unmanaged connections, impossible to secure. And the risks go far beyond accidental data deletion. Attackers are actively exploiting the unique vulnerabilities of LLM-driven ecosystems:</p><ul><li><p><b>Prompt and tool injection:</b> This is more than just telling a model to "ignore previous instructions." Attackers are now hiding malicious commands inside the descriptions of MCP tools themselves. Consider an LLM seeking to use a seemingly harmless "WebSearch" tool. A poisoned description could trick it into also running a query against a financial database and exfiltrating the results.</p></li><li><p><b>Supply chain attacks:</b> How can you trust the third-party MCP servers used by your teams? In mid-2025, a critical vulnerability (<a href="https://nvd.nist.gov/vuln/detail/CVE-2025-6514"><b><u>CVE-2025-6514</u></b></a>) was discovered in a popular npm package used for MCP authentication, exposing countless servers. In another incident dubbed "<b>NeighborJack</b>," security researchers found hundreds of MCP servers inadvertently exposed to the public Internet because they were bound to 0.0.0.0 without a firewall, allowing for potential OS command injection and host takeover.</p></li><li><p><b>Privilege escalation and the "confused deputy":</b> An attacker doesn't need to break your LLM; they just need to confuse it. In one documented case, an AI agent running with high-level privileges was tricked into executing SQL commands embedded in a support ticket. The agent, acting as a "confused deputy," couldn't distinguish the malicious SQL from the legitimate ticket data and dutifully executed the commands, compromising an entire database.</p></li><li><p><b>Data leakage:</b> Without centralized controls, data can bleed between systems in unexpected ways. <a href="https://www.bleepingcomputer.com/news/security/asana-warns-mcp-ai-feature-exposed-customer-data-to-other-orgs/"><u>In June 2025</u></a>, a popular team collaboration tool’s MCP integration suffered a privacy breach where a bug caused some customer information to become visible in other customers' MCP instances, forcing them to take the integration offline for two weeks.</p></li></ul>
    <div>
      <h3><b>The Solution: A Single Front Door for Your MCP Servers</b></h3>
      <a href="#the-solution-a-single-front-door-for-your-mcp-servers">
        
      </a>
    </div>
    <p>You can't protect what you can't see. <b>Cloudflare MCP Server Portals</b> solve this problem by providing a single, centralized gateway for all your MCP servers, somewhat similar to an application launcher for <a href="https://www.cloudflare.com/learning/access-management/what-is-sso/"><u>single sign-on</u></a>. Instead of developers distributing dozens of individual server endpoints, they register their servers with Cloudflare. You provide your users with a single, unified Portal endpoint to configure in their MCP client.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5gIceb6D72AwuQSNjq0eqb/25147ec57731dd2e016887d6bab33f55/image1.png" />
          </figure><p>This changes the security posture and user experience immediately. By routing all MCP traffic through Cloudflare, you get:</p><ul><li><p><b>Centralized policy enforcement:</b> You can integrate MCP Server Portals directly into Cloudflare One. This means you can enforce the same granular access policies for your AI connections that you do for your human users. Require <a href="https://www.cloudflare.com/learning/access-management/what-is-multi-factor-authentication/"><u>multi-factor authentication</u></a>, check for device posture, restrict by geography, and ensure only the right users can access specific servers and tools.</p></li><li><p><b>Comprehensive visibility and logging:</b> Who is accessing which MCP server and which toolsets are they engaging with? What prompts are being run? What tools are being invoked? Previously, this data was scattered across every individual server. Server Portals aggregate all MCP request logs into a single place, giving you the visibility needed to audit activity and detect anomalies before they become breaches.</p></li><li><p><b>A curated AI user experience based on least privilege:</b> Administrators can now review and approve MCP servers before making them available to users through a Portal. When a user authenticates through their Portal, they are only presented with the curated list of servers and tools they are authorized to use, preventing the use of unvetted or malicious third-party servers. This approach adheres to the <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/"><u>Zero Trust security</u></a> best practice of <a href="https://www.cloudflare.com/learning/access-management/principle-of-least-privilege/"><u>least privilege</u></a>.</p></li><li><p><b>Simplified user configuration: </b>Instead of having to load individual MCP server configurations into a MCP Client, users can load a single URL that pulls down all accessible MCP Servers. This drastically simplifies how many URLs need to be shared out and known by users. As new MCP Servers are added, they become dynamically available through the portal, instead of sharing each new URL on publishing of a server.</p></li></ul><p>When a user connects to their MCP Server Portal, <a href="https://www.cloudflare.com/zero-trust/products/access/"><u>Access</u></a> prompts them to authenticate with their corporate identity provider. Once authenticated, Cloudflare enforces which MCP Servers the user has access to, regardless of the underlying server’s authorization policies. </p><p>For MCP servers with domains hosted on Cloudflare, Access policies can be used to enforce the server’s direct authorization. This is done by creating an <a href="https://developers.cloudflare.com/cloudflare-one/applications/configure-apps/mcp-servers/linked-apps/"><u>OAuth server that is linked to the domain’s existing Access Application</u></a>. For MCP servers with domains outside Cloudflare and/or hosted by a third party, they require <a href="https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization"><u>authorization controls</u></a> outside of Cloudflare Access, this is usually done using OAuth.</p>
    <div>
      <h3><b>The Road Ahead: What's Next for AI Security</b></h3>
      <a href="#the-road-ahead-whats-next-for-ai-security">
        
      </a>
    </div>
    <p>MCP Server Portals are a foundational step in our mission to <a href="https://www.cloudflare.com/ai-security/">secure the AI revolution</a>. This is just the beginning. In the coming months, we plan to build on this foundation by:</p><ul><li><p><b>Mechanisms to lock down MCP Servers: </b>Unless an MCP Server author enforces <a href="https://modelcontextprotocol.io/specification/2025-06-18/basic/authorization"><u>Authorization</u></a> controls, users can still technically access MCPs outside of a Portal. We will build additional enforcement mechanisms to prevent this.</p></li><li><p><b>Integrating with Firewall for AI:</b> Imagine applying the power of our <a href="https://www.cloudflare.com/application-services/products/waf/"><u>WAF</u></a> to your MCP traffic, detecting and blocking prompt injection attacks before they ever reach your servers.</p></li><li><p><b>Cloudflare hosted MCP Servers: </b>We will make it easy to deploy MCP Servers using Cloudflare’s <a href="https://www.cloudflare.com/developer-platform/products/ai-gateway/"><u>AI Gateway</u></a>. This will allow for deeper prompt filtering and controls.</p></li><li><p><b>Applying machine learning to detect abuse:</b> We will layer our own <a href="https://www.cloudflare.com/learning/ai/what-is-machine-learning/"><u>machine learning models</u></a> on top of your MCP logs to automatically identify anomalous behavior, such as unusual data exfiltration patterns or suspicious tool usage.</p></li><li><p><b>Enhancing the protocol:</b> We are committed to working with the open-source community to strengthen the MCP standard itself, contributing to a more secure and robust ecosystem for everyone.</p></li></ul><p>This is our commitment: to provide the tools you need to innovate with confidence.</p>
    <div>
      <h3><b>Get Started Today!</b></h3>
      <a href="#get-started-today">
        
      </a>
    </div>
    <p>Progress doesn't have to come at the expense of security. With MCP Server Portals, you can empower your teams to build the future with AI, safely. This is a critical piece of helping to build a better Internet, and we are excited to see what you will build with it.</p><p>MCP Server Portals are now available in Open Beta for all Cloudflare One customers. To get started, navigate to the <b>Access &gt; AI Controls</b> page in the Zero Trust Dashboard. If you don't have an account, you can <a href="https://dash.cloudflare.com/sign-up/zero-trust"><u>sign up today</u></a> and get started with up to 50 free seats or <a href="https://www.cloudflare.com/products/zero-trust/plans/enterprise/?utm_medium=referral&amp;utm_source=blog&amp;utm_campaign=2025-q3-acq-gbl-connectivity-ge-ge-general-ai_week_blog"><u>contact our experts</u></a> to explore larger deployments.</p><p>Cloudflare is also starting a user research program focused on <a href="https://www.cloudflare.com/learning/ai/what-is-ai-security/">AI security</a>. If you are interested in previews of new functionality or want to help shape our roadmap, <a href="https://www.cloudflare.com/lp/ai-security-user-research-program-2025"><u>please express your interest here</u></a>.  </p><div>
  
</div><p></p> ]]></content:encoded>
            <category><![CDATA[AI Week]]></category>
            <category><![CDATA[MCP]]></category>
            <guid isPermaLink="false">6UkXhpttlAzNjxsaKtVwje</guid>
            <dc:creator>Kenny Johnson</dc:creator>
        </item>
        <item>
            <title><![CDATA[Best Practices for Securing Generative AI with SASE]]></title>
            <link>https://blog.cloudflare.com/best-practices-sase-for-ai/</link>
            <pubDate>Tue, 26 Aug 2025 14:00:00 GMT</pubDate>
            <description><![CDATA[ This guide provides best practices for Security and IT leaders to securely adopt generative AI using Cloudflare’s SASE architecture as part of a strategy for AI Security Posture Management (AI-SPM). ]]></description>
            <content:encoded><![CDATA[ <p>As <a href="https://www.cloudflare.com/learning/ai/what-is-generative-ai/"><u>Generative AI</u></a> revolutionizes businesses everywhere, security and IT leaders find themselves in a tough spot. Executives are mandating speedy adoption of Generative AI tools to drive efficiency and stay abreast of competitors. Meanwhile, IT and Security teams must rapidly develop an <a href="https://www.cloudflare.com/ai-security/">AI Security Strategy</a>, even before the organization really understands exactly how it plans to adopt and deploy Generative AI. </p><p>IT and Security teams are no strangers to “building the airplane while it is in flight”. But this moment comes with new and complex security challenges. There is an explosion in new AI capabilities adopted by employees across all business functions — both sanctioned and unsanctioned. AI Agents are ingesting authentication credentials and autonomously interacting with sensitive corporate resources. Sensitive data is being shared with AI tools, even as security and compliance frameworks struggle to keep up.</p><p>While it demands strategic thinking from Security and IT leaders, the problem of governing the use of AI internally is far from insurmountable. <a href="https://www.cloudflare.com/zero-trust/"><u>SASE (Secure Access Service Edge)</u></a> is a popular cloud-based network architecture that combines networking and security functions into a single, integrated service that provides employees with secure and efficient access to the Internet and to corporate resources, regardless of their location. The SASE architecture can be effectively extended to meet the risk and security needs of organizations in a world of AI. </p><p>Cloudflare’s SASE Platform is uniquely well-positioned to help IT teams govern their AI usage in a secure and responsible way — without extinguishing innovation. What makes Cloudflare different in this space is that we are one of the few SASE vendors that operate not just in cybersecurity, but also in AI infrastructure. This includes: providing AI infrastructure for developers (e.g. <a href="https://developers.cloudflare.com/workers-ai/"><u>Workers AI</u></a>, <a href="https://developers.cloudflare.com/ai-gateway/"><u>AI Gateway</u></a>, <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>remote MCP servers</u></a>, <a href="https://realtime.cloudflare.com/"><u>Realtime AI Apps</u></a>) to securing public-facing LLMs (e.g. <a href="https://developers.cloudflare.com/waf/detections/firewall-for-ai/"><u>Firewall for AI</u></a> or <a href="https://blog.cloudflare.com/ai-labyrinth/"><u>AI Labyrinth</u></a>), to allowing content creators to <a href="https://blog.cloudflare.com/introducing-pay-per-crawl/"><u>charge AI crawlers for access to their content</u></a>, and the list goes on. Our expertise in this space gives us a unique view into governing AI usage inside an organization.  It also gives our customers the opportunity to plug different components of our platform together to build out their AI <i>and</i> AI cybersecurity infrastructure.</p><p>This week, we are taking this AI expertise and using it to help ensure you have what you need to implement a successful <a href="https://www.cloudflare.com/learning/ai/what-is-ai-security/">AI Security Strategy</a>. As part of this, we are announcing several new AI Security Posture Management (AI-SPM) features, including:</p><ul><li><p><a href="http://blog.cloudflare.com/shadow-AI-analytics/"><u>shadow AI reporting</u></a> to gain visibility into employee’s use of AI,</p></li><li><p><a href="http://blog.cloudflare.com/confidence-score-rubric/"><u>confidence scoring</u></a> of AI providers to manage risk, </p></li><li><p><a href="http://blog.cloudflare.com/ai-prompt-protection/"><u>AI prompt protection</u></a> to defend against malicious inputs and prevent data loss, </p></li><li><p>out-of-band <a href="http://blog.cloudflare.com/casb-ai-integrations/"><u>API CASB integrations </u></a>with AI providers to detect misconfigurations, </p></li><li><p>new tools that <a href="http://blog.cloudflare.com/zero-trust-mcp-server-portals/"><u>untangle and secure</u></a>  <a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/"><u>Model Context Protocol (MCP)</u></a> deployments in the enterprise.</p></li></ul><p>All of these new AI-SPM features are built directly into Cloudflare’s powerful <a href="https://www.cloudflare.com/zero-trust/"><u>SASE</u></a> platform.</p><p>And we’re just getting started. In the coming months you can expect to see additional valuable AI-SPM features launch across the <a href="https://www.cloudflare.com/"><u>Cloudflare platform</u></a>, as we continue investing in making Cloudflare the best place to protect, connect, and build with AI.</p>
    <div>
      <h3>What’s in this AI security guide?</h3>
      <a href="#whats-in-this-ai-security-guide">
        
      </a>
    </div>
    <p>In this guide, we will cover best practices for adopting generative AI in your organization using Cloudflare’s <a href="https://www.cloudflare.com/zero-trust/"><u>SASE (Secure Access Service Edge)</u></a> platform. We start by covering how IT and Security leaders can formulate their AI Security Strategy. Then, we show how to implement this strategy using long-standing features of our SASE platform alongside the new AI-SPM features we launched this week. </p><p>This guide below is divided into three key pillars for dealing with (human) employee access to AI – Visibility, Risk Management and Data Protection — followed by additional guidelines around deploying agentic AI in the enterprise using MCP. Our objective is to help you align your security strategy with your business goals while driving adoption of AI across all your projects and teams. </p><p>And we do this all using our single <a href="https://www.cloudflare.com/zero-trust/"><u>SASE</u></a> platform, so you don’t have to deploy and manage a complex hodgepodge of point solutions and security tools. In fact, we provide you with an overview of your AI security posture in a single dashboard, as you can see here:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5y6ZHDu9lwCSHZ1FuZsoWT/b3f6a9eb034a3cdb2b663cff428a2335/1.png" />
          </figure><p><i>AI Security Report in Cloudflare’s SASE platform</i></p>
    <div>
      <h2>Develop your AI Security Strategy</h2>
      <a href="#develop-your-ai-security-strategy">
        
      </a>
    </div>
    <p>The first step to securing AI usage is to establish your organization's level of risk tolerance. This includes pinpointing your biggest security concerns for your users and your data, along with relevant legal and compliance requirements.   Relevant issues to consider include: </p><ul><li><p>Do you have specific <b>sensitive data that should not be shared</b> with certain AI tools? (Some examples include personally identifiable information (PII), personal health information (PHI), sensitive financial data, secrets and credentials, source code or other proprietary business information.)</p></li><li><p>Are there <b>business decisions that your employees should not be making using assistance from AI</b>? (For instance, the EU AI Act AI prohibits the use of AI to evaluate or classify individuals based on their social behavior, personal characteristics, or personality traits.)</p></li><li><p>Are you subject to <b>compliance frameworks</b> that require you to produce records of the generative AI tools that your employees used, and perhaps even the prompts that your employees input into AI providers? (For example, HIPAA requires organizations to implement audit trails that records who accessed PHI and when, GDPR requires the same for PII, SOC2 requires the same for secrets and credentials.)</p></li><li><p>Do you have specific data protection requirements that require employees to use the <b>sanctioned, enterprise version of a certain generative AI provider</b>, and avoid certain AI tools or their consumer versions?  (Enterprise AI tools often have more favorable terms of service, including shorter data retention periods, more limited data-sharing with third-parties, and/or a promise not to train AI models on user inputs.)</p></li><li><p>Do you require employees to completely <b>avoid the use of certain AI tools</b>, perhaps because they are unreliable, unreviewed or headquartered in a risky geography? </p></li><li><p>Are there security protections offered by your organization's sanctioned AI providers and to what extent do you plan to <b>protect against misconfigurations of AI tools</b> that can result in leaks of sensitive data?  </p></li><li><p>What is your <a href="https://www.cloudflare.com/the-net/building-cyber-resilience/secure-govern-ai-agents/">policy around the use of autonomous AI agents</a>?  What is your strategy for <b>adopting the </b><a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/"><b><u>Model Context Protocol (MCP)</u></b></a>? (The Model Context Protocol is a standard way to make information available to large language models (LLMs), similar to the way an application programming interface (API) works. It supports agentic AI that autonomously pursues goals and takes action.)</p></li></ul><p>While almost every organization has relevant compliance requirements that implicate their use of generative AI, there is no “one size fits all” for addressing these issues. </p><ul><li><p>Some organizations have mandates to broadly adopt AI tools of all stripes, while others require employees to interact with sanctioned AI tools only. </p></li><li><p>Some organizations are rapidly adopting the MCP, while others are not yet ready for agents to autonomously interact with their corporate resources. </p></li><li><p>Some organizations have robust requirements around data loss prevention (DLP), while others are still early in the process of deploying DLP in their organization.</p></li></ul><p>Even with this diversity of goals and requirements, Cloudflare SASE provides a flexible platform for the implementation of your organization’s AI Security Strategy.</p>
    <div>
      <h2>Build a solid foundation for AI Security </h2>
      <a href="#build-a-solid-foundation-for-ai-security">
        
      </a>
    </div>
    <p>To implement your AI Security Strategy, you first need a solid <a href="https://developers.cloudflare.com/reference-architecture/architectures/sase/"><u>SASE deployment</u></a>. </p><p>SASE provides a unified platform that consolidates security and networking, replacing a fragmented patchwork of point solutions with a single platform that controls application visibility, user authentication, <a href="https://www.cloudflare.com/learning/access-management/what-is-dlp/"><u>Data Loss Prevention (DLP)</u></a>, and other policies for access to the Internet and access to internal corporate resources.  SASE is the essential foundation for an effective AI Security Strategy. </p><p><a href="https://www.cloudflare.com/learning/access-management/what-is-sase/"><u>SASE architecture</u></a> allows you to execute your AI security strategy by discovering and inventorying the AI tools used by your employees. With this visibility, you can proactively manage risk and support compliance requirements by monitoring AI prompts and responses to understand what data is being shared with AI tools. Robust DLP allows you to scan and block sensitive data from being entered into AI tools, preventing data leakage and protecting your organization's most valuable information. Our <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/"><u>Secure Web Gateway (SWG)</u></a> allows you to redirect traffic from unsanctioned AI providers to user education pages or to sanctioned enterprise AI providers. And our new integration of MCP tooling into our SASE platform helps you secure the deployment of agentic AI inside your organization.</p><p>If you're just starting your SASE journey, our <a href="https://developers.cloudflare.com/learning-paths/secure-internet-traffic/concepts/"><u>Secure Internet Traffic Deployment Guide</u></a> is the best place to begin. For this guide, however, we will skip these introductory details and dive right into using SASE to secure the use of Generative AI. </p>
    <div>
      <h2>Gain visibility into your AI landscape </h2>
      <a href="#gain-visibility-into-your-ai-landscape">
        
      </a>
    </div>
    <p>You can't protect what you can't see. The first step is to gain visibility into your AI landscape, which is essential for discovering and inventorying all the AI tools that your employees are using, deploying or experimenting with in your organization. </p>
    <div>
      <h3>Discover Shadow AI </h3>
      <a href="#discover-shadow-ai">
        
      </a>
    </div>
    <p>Shadow AI refers to the use of AI applications that haven't been officially sanctioned by your IT department. Shadow AI is not an uncommon phenomenon – Salesforce found that <a href="https://www.salesforce.com/news/stories/ai-at-work-research/?utm_campaign=amer_cbaw&amp;utm_content=Salesforce_World+Tour&amp;utm_medium=organic_social&amp;utm_source=linkedin"><u>over half of the knowledge workers it surveyed</u></a> admitted to using unsanctioned AI tools at work. Use of unsanctioned AI is not necessarily a sign of malicious intent; employees are often just trying to do their jobs better. As an IT or Security leader, your goal should be to discover Shadow AI and then apply the appropriate AI security policy. There are two powerful ways to do this: inline and out-of-band.</p>
    <div>
      <h4>Discover employee usage of AI, inline</h4>
      <a href="#discover-employee-usage-of-ai-inline">
        
      </a>
    </div>
    <p>The most direct way to get visibility is by using <a href="https://www.cloudflare.com/zero-trust/products/gateway/"><u>Cloudflare's Secure Web Gateway (SWG)</u></a>. </p><p>SWG helps you get a clear picture of both sanctioned and unsanctioned AI and chat applications. By reviewing your detected usage, you'll gain insight into which AI apps are being used in your organization. This knowledge is essential for building policies that support approved tools, and block or control risky ones. This feature requires you to deploy the WARP client in Gateway proxy mode on your end-user devices.</p><p>You can review your company’s AI app usage using our new Application Library and <a href="http://blog.cloudflare.com/shadow-AI-analytics/"><u>Shadow IT </u></a>dashboards. These tools allow you to: </p><ul><li><p>Review traffic from user devices to understand how many users engage with a specific application over time.</p></li><li><p>Denote application’s status (e.g., Approved, Unapproved) inside your organization, and use that as input to a variety of SWG policies that control access to applications with that status. </p></li><li><p> Automate assessment of SaaS and Gen AI applications at scale with our soon-to-be-released <a href="http://blog.cloudflare.com/confidence-score-rubric/"><u>Cloudflare Application Confidence Scores</u><b><u>. </u></b></a></p></li></ul>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3NFrOpJkBMH6tsPZVec02Q/37b54f7477082dedcac2adcba31e2c29/2.png" />
          </figure><p><sup><i>Shadow IT dashboard showing utilization of applications of different status (Approved, Unapproved, In Review, Unreviewed).</i></sup></p>
    <div>
      <h4>Discover employee usage of AI, out-of-band</h4>
      <a href="#discover-employee-usage-of-ai-out-of-band">
        
      </a>
    </div>
    <p>Even if your organization doesn't use a device client, you can still get valuable data on Shadow AI usage if you use Cloudflare's integrations for Cloud Access Security Broker (<a href="https://www.cloudflare.com/zero-trust/products/casb/"><u>CASB</u></a>) with services like Google Workspace, Microsoft 365, or GitHub. </p><p><a href="https://www.cloudflare.com/zero-trust/products/casb/"><u>Cloudflare CASB</u></a> provides high-fidelity detail about your SaaS environments, including sensitive data visibility and suspicious user activity. By integrating CASB with your SSO provider, you can see if your users have authenticated to any third-party AI applications, giving you a clear and non-invasive sense of app usage across your organization.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3HDUtSAX9f5XZasSyACTiV/367f80a5d745070fd8e0191d0e36e61d/3.png" />
          </figure><p><sup><i>An API CASB integration with Google Workspace, showing findings filtered to third party integrations. Findings discover multiple LLM integrations.</i></sup></p>
    <div>
      <h2>Implement an AI risk management framework</h2>
      <a href="#implement-an-ai-risk-management-framework">
        
      </a>
    </div>
    <p>Now that you’ve gained visibility into your AI landscape, the next step is to proactively manage that risk. Cloudflare’s SASE platform allows you to monitor AI prompts and responses, enforce granular security policies, coach users on secure behavior, and prevent misconfigurations in your enterprise AI providers.</p>
    <div>
      <h3>Detect and monitor AI prompts and responses</h3>
      <a href="#detect-and-monitor-ai-prompts-and-responses">
        
      </a>
    </div>
    <p>If you have <a href="https://developers.cloudflare.com/learning-paths/replace-vpn/configure-device-agent/enable-tls-decryption/"><u>TLS decryption enabled</u></a> in your SASE platform, you can gain new and powerful insights into how your employees are using AI with our new <a href="http://blog.cloudflare.com/ai-prompt-protection/"><u>AI prompt protection</u></a> feature.  </p><p>AI Prompt Protection provides you with visibility into the exact prompts and responses from your employees’ interactions with supported AI applications. This allows you to go beyond simply knowing which tools are being used and gives you insight into exactly what kind of information is being shared.  </p><p>This feature also works with <a href="https://developers.cloudflare.com/cloudflare-one/policies/data-loss-prevention/dlp-profiles/"><u>DLP profiles</u></a> to detect sensitive data in prompts. You can also choose whether to block the action or simply monitor it.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/JpNZiyklt6qBRjW4LZuSW/1ea4043b6d03f8de31ce24175aa6ca02/4.png" />
          </figure><p><sup><i>Log entry for a prompt detected using AI prompt protection.</i></sup></p>
    <div>
      <h3>Build granular AI security policies</h3>
      <a href="#build-granular-ai-security-policies">
        
      </a>
    </div>
    <p>Once your monitoring tools give you a clear understanding of AI usage, you can begin building security policies to achieve your security goals. Cloudflare's Gateway allows you to create policies based on application categories, application approval status, users, user groups, and device status. For example, you can:</p><ul><li><p>create policies to explicitly allow approved AI applications while blocking unapproved AI applications;</p></li><li><p>create <a href="https://developers.cloudflare.com/changelog/2025-04-11-http-redirect-custom-block-page-redirect/"><u>policies that redirect users</u></a> from unapproved AI applications to an approved AI application;</p></li><li><p>limit access to certain applications to specific users or groups that have specific device security posture;</p></li><li><p>build policies to enable prompt capture (with<a href="http://blog.cloudflare.com/ai-prompt-protection/"><u> AI prompt protection</u></a>) for specific high-risk user groups, such as contractors or new employees, without affecting the rest of the organization; and</p></li><li><p>put certain applications behind <a href="https://developers.cloudflare.com/cloudflare-one/policies/browser-isolation/"><u>Remote Browser Isolation (RBI)</u></a>, to prevent end users from uploading files or pasting data into the application.</p></li></ul>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2BCDxoKrUDRAOO13V8Qd4W/28e84e4529f3e040ba4a2c3c98c6eed7/5.png" />
          </figure><p><sup><i>Gateway application status policy selector</i></sup></p><p>All of these policies can be written in Cloudflare Gateway’s unified policy builder, making it easy to deploy your AI Security Strategy across your organization.</p>
    <div>
      <h3>Control access to internal LLMs </h3>
      <a href="#control-access-to-internal-llms">
        
      </a>
    </div>
    <p>You can use <a href="https://developers.cloudflare.com/cloudflare-one/policies/access/"><u>Cloudflare Access</u></a> to control your employees’ access to your organization’s internal LLMs, including any <a href="https://www.cloudflare.com/learning/ai/how-to-secure-training-data-against-ai-data-leaks/">proprietary models you train internally</a> and/or models that your organization runs on <a href="https://developers.cloudflare.com/workers-ai/"><u>Cloudflare Worker’s AI</u></a>. </p><p>Cloudflare Access allows you to gate access to these LLMs using fine-grained policies, including ensuring users are granted access based on their identity, user group, device posture, and other contextual signals. For example, you can use <a href="https://developers.cloudflare.com/cloudflare-one/policies/access/"><u>Cloudflare Access</u></a> to write a policy that ensures that only certain data scientists at your organization can access a <a href="https://developers.cloudflare.com/workers-ai/"><u>Workers AI</u></a> model that is <a href="https://developers.cloudflare.com/workers-ai/guides/tutorials/fine-tune-models-with-autotrain/"><u>trained</u></a> on certain types of customer data. </p>
    <div>
      <h3>Manage the security posture of third-party AI providers</h3>
      <a href="#manage-the-security-posture-of-third-party-ai-providers">
        
      </a>
    </div>
    <p>As you define which AI tools are sanctioned, you can develop functional security controls for consistent usage. Cloudflare newly supports <a href="http://blog.cloudflare.com/casb-ai-integrations/"><u>API CASB integrations with popular AI tools</u></a> like OpenAI (ChatGPT), Anthropic (Claude), and Google Gemini. These "out-of-band" integrations provide immediate visibility into how users are engaging with sanctioned AI tools, allowing you to report on posture management findings include:</p><ul><li><p>Misconfigurations related to sharing settings.</p></li><li><p>Best practices for API key management.</p></li><li><p>DLP profile matches in uploaded attachments</p></li><li><p>Riskier AI features (e.g. autonomous web browsing, code execution) that are toggled on</p></li></ul>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/0a6FVjCwejeyUzdQR0pyb/79f29b0d92c27bcd400ed7ded8d4c4e3/6.png" />
          </figure><p><sup><i>OpenAI API CASB Integration showing riskier features that are toggled on, security posture risks like unused admin credentials, and an uploaded attachment with a DLP profile match.</i></sup></p>
    <div>
      <h2>Layer on data protection </h2>
      <a href="#layer-on-data-protection">
        
      </a>
    </div>
    <p>Robust data protection is the final pillar that protects your employee’s access to AI.. </p>
    <div>
      <h3>Prevent data loss</h3>
      <a href="#prevent-data-loss">
        
      </a>
    </div>
    <p>Our SASE platform has long supported Data Loss Prevention (<a href="https://developers.cloudflare.com/cloudflare-one/policies/data-loss-prevention/"><u>DLP</u></a>) tools that scan and block sensitive data from being entered into AI tools, to prevent data leakage and protect your organization's most valuable information.  You can write policies that detect sensitive data while adapting to <a href="https://blog.cloudflare.com/improving-data-loss-prevention-accuracy-with-ai-context-analysis/"><u>organization-specific traffic patterns</u></a>, and use Cloudflare Gateway’s unified policy builder to apply these to your users' interactions with AI tools or other applications. For example, you could write a DLP policy that detects and blocks the upload of a social security number (SSN), phone number or address.</p><p>As part of our new <a href="http://blog.cloudflare.com/ai-prompt-protection/"><u>AI prompt protection</u></a> feature, you can now also gain a semantic understanding of your users’ interactions with supported AI providers. Prompts are classified <i>inline </i>into meaningful, high-level topics that include PII, credentials and secrets, source code, financial information, code abuse / malicious code and prompt injection / jailbreak.  You can then build inline granular policies based on these high-level topic classifications. For example, you could create a policy that blocks a non-HR employee from submitting a prompt with the intent to receive PII from the response, while allowing the HR team to do so during a compensation planning cycle. </p><p>Our new <a href="http://blog.cloudflare.com/ai-prompt-protection/"><u>AI prompt protection</u></a> feature empowers you to apply smart, user-specific DLP rules that empower your teams to get work done, all while strengthening your security posture. To use our most advanced DLP feature, you'll need to enable TLS decryption to inspect traffic.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3dUnu8P5cMS18k9BxkGoHY/16fdccae7f8e99dc34ebfe7399db4b94/7.png" />
          </figure><p><sup><i>The above policy blocks all ChatGPT prompts that may receive PII back in the response for employees in engineering, marketing, product, and finance </i></sup><a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/identity-selectors/"><sup><i><u>user groups</u></i></sup></a><sup><i>. </i></sup></p>
    <div>
      <h2>Secure MCP — and Agentic AI </h2>
      <a href="#secure-mcp-and-agentic-ai">
        
      </a>
    </div>
    <p>MCP (Model Context Protocol) is an emerging AI standard, where MCP servers act as a translation layer for <a href="https://www.cloudflare.com/learning/ai/what-is-agentic-ai/"><u>AI agents</u></a>, allowing them to communicate with public and private APIs, understand datasets, and perform actions. Because these servers are a primary entry point for AI agents to engage with and manipulate your data, they are a new and critical security asset for your security team to manage.</p><p>Cloudflare already offers a robust set of developer tools for deploying <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>remote MCP servers</u></a>—a cloud-based server that acts as a bridge between a user's data and tools and various AI applications. But now our customers are asking for help securing their enterprise MCP deployments. </p><p>That is why we’re making MCP security controls a core part of our SASE platform.</p>
    <div>
      <h4>Control MCP Authorization</h4>
      <a href="#control-mcp-authorization">
        
      </a>
    </div>
    <p>MCP servers typically use OAuth for authorization, where the server inherits the permissions of the authorizing user. While this adheres to least-privilege for the user, it can lead to <b>authorization sprawl </b>— where the agent accumulates an excessive number of permissions over time. This makes the agent a high-value target for attackers.</p><p><a href="https://developers.cloudflare.com/cloudflare-one/applications/configure-apps/mcp-servers"><u>Cloudflare Access</u></a> now helps you manage authorization sprawl by applying <a href="https://www.cloudflare.com/learning/security/glossary/what-is-zero-trust/"><u>Zero Trust principles</u></a> to MCP server access. A Zero Trust model assumes no user, device, or network can be trusted implicitly, so every request is continuously verified. This <a href="https://developers.cloudflare.com/cloudflare-one/applications/configure-apps/mcp-servers"><u>approach </u></a>ensures secure authentication and management of these critical assets as your business adopts more agentic workflows. </p>
    <div>
      <h4>Centralize management of MCP servers</h4>
      <a href="#centralize-management-of-mcp-servers">
        
      </a>
    </div>
    <p><a href="http://blog.cloudflare.com/zero-trust-mcp-server-portals/"><u>Cloudflare MCP Server Portal</u></a> is a new feature in Cloudflare’s SASE platform that centralizes the management, security, and observation of an organization’s MCP servers.</p><p>MCP Server Portal allows you to register all your MCP servers with Cloudflare and provide your end users with a single, unified Portal endpoint to configure in their MCP client. This approach simplifies the user experience, because it eliminates the need to configure a one-to-one connection between every MCP client and server. It also means that new MCP servers dynamically become available to users whenever they are added to the Portal. </p><p>Beyond these usability enhancements, MCP Server Portal addresses the significant security risks associated with MCP in the enterprise. The current decentralized approach of MCP deployments creates a tangle of unmanaged one-to-one connections that are difficult to secure. The lack of centralized controls creates a variety of risks including prompt injection, tool injection (where malicious code is part of the MCP server itself), supply chain attacks and data leakage. </p><p>MCP Server Portals solve this by routing all MCP traffic through Cloudflare, allowing for centralized policy enforcement, comprehensive visibility and logging, and a curated user experience based on the principle of least privilege. Administrators can review and approve MCP servers before making them available, and users are only presented with the servers and tools they are authorized to use, which prevents the use of unvetted or malicious third-party servers.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/64a5Snga1xwRHeCmdbYrpj/f23dc4584618f0c37fb0be8f3399554b/8.png" />
          </figure><p><sup><i>An MCP Server Portal in the Cloudflare Dashboard</i></sup></p><p>All of these features are only the beginning of our MCP security roadmap, as we continue advancing our support for MCP infrastructure and security controls across the entire Cloudflare platform.</p>
    <div>
      <h2>Implement your AI security strategy in a single platform</h2>
      <a href="#implement-your-ai-security-strategy-in-a-single-platform">
        
      </a>
    </div>
    <p>As organizations rapidly develop and deploy their AI security strategies, Cloudflare’s SASE platform is ideally situated to implement policies that balance productivity with data and security controls.</p><p>Our SASE has a full suite of features to protect employee interactions with AI. Some of these features are deeply integrated in our <a href="https://developers.cloudflare.com/cloudflare-one/policies/gateway/"><u>Secure Web Gateway (SWG)</u></a>, including the ability to write fine-grained access policies, gain visibility into <a href="http://blog.cloudflare.com/shadow-AI-analytics/"><u>Shadow IT </u></a>and introspect on interactions with AI tools using <a href="http://blog.cloudflare.com/ai-prompt-protection/"><u>AI prompt protection</u></a>. Apart from these inline controls, our <a href="https://developers.cloudflare.com/cloudflare-one/applications/casb/"><u>CASB</u></a> provides visibility and control using out-of-band API integrations. Our Cloudflare <a href="https://developers.cloudflare.com/cloudflare-one/policies/access/"><u>Access</u></a> product can apply Zero Trust principles while protecting employee access to corporate LLMs that are hosted on <a href="https://developers.cloudflare.com/workers-ai/"><u>Workers AI</u></a> or elsewhere. We’re newly integrating controls for <a href="http://blog.cloudflare.com/zero-trust-mcp-server-portals/"><u>securing MCP</u></a> that can also be used alongside Cloudflare’s <a href="https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/"><u>Remote MCP Server</u></a> platform.</p><p>And all of these features are integrated directly into Cloudflare’s SASE’s unified dashboard, providing a unified platform for you to implement your AI security strategy. You can even gain a holistic view of all of your AI-SPM controls using our newly-released AI-SPM overview dashboard. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6WzeNXp9TbX0h0QF8Nyby5/bcbeb8824e3eb5558826aed2cb17c11a/9.png" />
          </figure><p><sup><i>AI security report showing utilization of AI applications.</i></sup></p><p>As one the few SASE vendors that also offer AI infrastructure, Cloudflare’s SASE platform can also be deployed alongside products from our developer and application security platforms to holistically implement your AI security strategy alongside your AI infrastructure strategy (using, for example, <a href="https://developers.cloudflare.com/workers-ai/"><u>Workers AI</u></a>, <a href="https://developers.cloudflare.com/ai-gateway/"><u>AI Gateway</u></a>, <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>remote MCP servers</u></a>, <a href="https://realtime.cloudflare.com/"><u>Realtime AI Apps</u></a>, <a href="https://developers.cloudflare.com/waf/detections/firewall-for-ai/"><u>Firewall for AI</u></a>, <a href="https://blog.cloudflare.com/ai-labyrinth/"><u>AI Labyrinth</u></a>, or <a href="https://blog.cloudflare.com/introducing-pay-per-crawl/"><u>pay per crawl</u></a> .)</p>
    <div>
      <h2>Cloudflare is committed to helping enterprises securely adopt AI</h2>
      <a href="#cloudflare-is-committed-to-helping-enterprises-securely-adopt-ai">
        
      </a>
    </div>
    <p>Ensuring AI is scalable, safe, and secure is a natural extension of Cloudflare’s mission, given so much of our success relies on a safe Internet. As AI adoption continues to accelerate, so too does our mission to provide a market-leading set of controls for AI Security Posture Management (AI-SPM). Learn more about how <a href="https://developers.cloudflare.com/learning-paths/holistic-ai-security/concepts/"><u>Cloudflare helps secure AI</u></a> or start exploring our new AI-SPM features in Cloudflare’s SASE <a href="https://dash.cloudflare.com/"><u>dashboard </u></a>today!</p> ]]></content:encoded>
            <category><![CDATA[AI Week]]></category>
            <category><![CDATA[Cloudflare One]]></category>
            <category><![CDATA[Cloudflare Zero Trust]]></category>
            <category><![CDATA[SASE]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[AI-SPM]]></category>
            <category><![CDATA[DLP]]></category>
            <category><![CDATA[CASB]]></category>
            <category><![CDATA[Access]]></category>
            <category><![CDATA[MCP]]></category>
            <guid isPermaLink="false">55IAKy7DMqbZKAy8htcUiO</guid>
            <dc:creator>AJ Gerstenhaber</dc:creator>
            <dc:creator>Sharon Goldberg</dc:creator>
            <dc:creator>Corey Mahan</dc:creator>
            <dc:creator>Yumna Moazzam</dc:creator>
        </item>
        <item>
            <title><![CDATA[Connect any React application to an MCP server in three lines of code]]></title>
            <link>https://blog.cloudflare.com/connect-any-react-application-to-an-mcp-server-in-three-lines-of-code/</link>
            <pubDate>Wed, 18 Jun 2025 13:00:00 GMT</pubDate>
            <description><![CDATA[ We're open-sourcing use-mcp, a React library that connects to any MCP server in just 3 lines of code, as well as our AI Playground, a complete chat interface that can connect to remote MCP servers.  ]]></description>
            <content:encoded><![CDATA[ <p>You can <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>deploy</u></a> a <a href="https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/"><u>remote Model Context Protocol (MCP) server</u></a> on Cloudflare in just one-click. Don’t believe us? Click the button below. </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-authless"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>This will get you started with a remote MCP server that supports the latest MCP standards and is the reason why thousands of remote MCP servers have been deployed on Cloudflare, including ones from companies like <a href="https://blog.cloudflare.com/mcp-demo-day/"><u>Atlassian, Linear, PayPal, and more</u></a>. </p><p>But deploying servers is only half of the equation — we also wanted to make it just as easy to build and deploy remote MCP clients that can connect to these servers to enable new AI-powered service integrations. That's why we built <code>use-mcp</code>, a React library for connecting to remote MCP servers, and we're excited to contribute it to the MCP ecosystem to enable more developers to build remote MCP clients.</p><p>Today, we're open-sourcing two tools that make it easy to build and deploy MCP clients:</p><ol><li><p><a href="https://github.com/modelcontextprotocol/use-mcp"><u>use-mcp</u></a> — A React library that connects to any remote MCP server in just 3 lines of code, with transport, authentication, and session management automatically handled. We're excited to contribute this library to the <a href="https://github.com/modelcontextprotocol"><u>MCP ecosystem</u></a> to enable more developers to build remote MCP clients. </p></li><li><p><a href="https://github.com/cloudflare/ai/tree/main/playground/ai"><u>The AI Playground</u></a> — Cloudflare’s <a href="https://playground.ai.cloudflare.com/"><u>AI chat interface</u></a> platform that uses a number of LLM models to interact with remote MCP servers, with support for the latest MCP standard, which you can now deploy yourself. </p></li></ol><p>Whether you're building an AI-powered chat bot, a support agent, or an internal company interface, you can leverage these tools to connect your AI agents and applications to external services via MCP. </p><p>Ready to get started? Click on the button below to deploy your own instance of Cloudflare’s AI Playground to see it in action. </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/playground/ai"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p>
    <div>
      <h2>use-mcp: a React library for building remote MCP clients</h2>
      <a href="#use-mcp-a-react-library-for-building-remote-mcp-clients">
        
      </a>
    </div>
    <p><a href="https://github.com/modelcontextprotocol/use-mcp"><u>use-mcp</u></a> is a <a href="https://www.npmjs.com/package/use-mcp"><u>React library</u></a> that abstracts away all the complexity of building MCP clients. Add the <code>useMCP()</code> hook into any React application to connect to remote MCP servers that users can interact with. </p><p>Here’s all the code you need to add to connect to a remote MCP server: </p>
            <pre><code>mport { useMcp } from 'use-mcp/react'
function MyComponent() {
  const { state, tools, callTool } = useMcp({
    url: 'https://mcp-server.example.com'
  })
  return &lt;div&gt;Your actual UI code&lt;/div&gt;
}</code></pre>
            <p>Just specify the URL, and you're instantly connected. </p><p>Behind the scenes, <code>use-mcp</code> handles the transport protocols (both Streamable HTTP and Server-Sent Events), authentication flows, and session management. It also includes a number of features to help you build reliable, scalable, and production-ready MCP clients. </p>
    <div>
      <h3>Connection management </h3>
      <a href="#connection-management">
        
      </a>
    </div>
    <p>Network reliability shouldn’t impact user experience. <code>use-mcp </code>manages connection retries and reconnections with a backoff schedule to ensure your client can recover the connection during a network issue and continue where it left off. The hook exposes real-time <a href="https://github.com/modelcontextprotocol/use-mcp/tree/main?tab=readme-ov-file#return-value"><u>connection states</u></a> ("connecting", "ready", "failed"), allowing you to build responsive UIs that keep users informed without requiring you to write any custom connection handling logic. </p>
            <pre><code>const { state } = useMcp({ url: 'https://mcp-server.example.com' })

if (state === 'connecting') {
  return &lt;div&gt;Establishing connection...&lt;/div&gt;
}
if (state === 'ready') {
  return &lt;div&gt;Connected and ready!&lt;/div&gt;
}
if (state === 'failed') {
  return &lt;div&gt;Connection failed&lt;/div&gt;
}</code></pre>
            
    <div>
      <h3>Authentication &amp; authorization</h3>
      <a href="#authentication-authorization">
        
      </a>
    </div>
    <p>Many MCP servers require some form of authentication in order to make tool calls. <code>use-mcp</code> supports <a href="https://oauth.net/2.1/"><u>OAuth 2.1</u></a> and handles the entire OAuth flow.  It redirects users to the login page, allows them to grant access, securely stores the access token returned by the OAuth provider, and uses it for all subsequent requests to the server. The library also provides <a href="https://github.com/modelcontextprotocol/use-mcp/tree/main?tab=readme-ov-file#api-reference"><u>methods</u></a> for users to revoke access and clear stored credentials. This gives you a complete authentication system that allows you to securely connect to remote MCP servers, without writing any of the logic. </p>
            <pre><code>const { clearStorage } = useMcp({ url: 'https://mcp-server.example.com' })

// Revoke access and clear stored credentials
const handleLogout = () =&gt; {
  clearStorage() // Removes all stored tokens, client info, and auth state
}</code></pre>
            
    <div>
      <h3>Dynamic tool discovery</h3>
      <a href="#dynamic-tool-discovery">
        
      </a>
    </div>
    <p>When you connect to an MCP server, <code>use-mcp</code> fetches the tools it exposes. If the server adds new capabilities, your app will see them without any code changes. Each tool provides type-safe metadata about its required inputs and functionality, so your client can automatically validate user input and make the right tool calls.</p>
    <div>
      <h3>Debugging &amp; monitoring capabilities</h3>
      <a href="#debugging-monitoring-capabilities">
        
      </a>
    </div>
    <p>To help you troubleshoot MCP integrations, <code>use-mcp </code>exposes a <code>log</code> array containing structured messages at debug, info, warn, and error levels, with timestamps for each one. You can enable detailed logging with the <code>debug</code> option to track tool calls, authentication flows, connection state changes, and errors. This real-time visibility makes it easier to diagnose issues during development and production. </p>
    <div>
      <h3>Future-proofed &amp; backwards compatible</h3>
      <a href="#future-proofed-backwards-compatible">
        
      </a>
    </div>
    <p>MCP is evolving rapidly, with recent updates to transport mechanisms and upcoming changes to authorization. <code>use-mcp</code> supports both Server-Sent Events (SSE) and the newer Streamable HTTP transport, automatically detecting and upgrading to newer protocols, when supported by the MCP server. </p><p>As the MCP specification continues to evolve, we'll keep the library updated with the latest standards, while maintaining backwards compatibility. We are also excited to contribute <code>use-mcp</code> to the <a href="https://github.com/modelcontextprotocol/"><u>MCP project</u></a>, so it can grow with help from the wider community.</p>
    <div>
      <h3>MCP Inspector, built with use-mcp</h3>
      <a href="#mcp-inspector-built-with-use-mcp">
        
      </a>
    </div>
    <p>In use-mcp’s <a href="https://github.com/modelcontextprotocol/use-mcp/tree/main/examples"><u>examples directory</u></a>, you’ll see a minimal <a href="https://inspector.use-mcp.dev/"><u>MCP Inspector</u></a> that was built with the <code>use-mcp</code> hook. . Enter any MCP server URL to test connections, see available tools, and monitor interactions through the debug logs. It's a great starting point for building your own MCP clients or something you can use to debug connections to your MCP server. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6PmPcZicaO39x9SuRqzqSX/b6caa6c7af1d6b03f17c41771598d1b5/image1.png" />
          </figure><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/modelcontextprotocol/use-mcp/tree/main/examples/inspector"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p>
    <div>
      <h2>Open-sourcing the AI Playground </h2>
      <a href="#open-sourcing-the-ai-playground">
        
      </a>
    </div>
    <p>We initially built the <a href="https://playground.ai.cloudflare.com/"><u>AI Playground</u></a> to give users a chat interface for testing different AI models supported by Workers AI. We then added MCP support, so it could be used as a remote MCP client to connect to and test MCP servers. Today, we're open-sourcing the playground, giving you the complete chat interface with the MCP client built in, so you can deploy it yourself and customize it to fit your needs. </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/playground/ai"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>The playground comes with built-in support for the latest MCP standards, including both Streamable HTTP and Server-Sent Events transport methods, OAuth authentication flows that allow users to sign-in and grant permissions, as well as support for bearer token authentication for direct MCP server connections.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5iaUzuxBZafrH1q0VYHTJf/a7585da38f75818111b3521c9a5ef4e3/image2.png" />
          </figure>
    <div>
      <h3>How the AI Playground works</h3>
      <a href="#how-the-ai-playground-works">
        
      </a>
    </div>
    <p>The AI Playground is built on Workers AI, giving you access to a full catalog of large language models (LLMs) running on Cloudflare's network, combined with the Agents SDK and <code>use-mcp</code> library for MCP server connections.</p><p>The AI Playground uses the <code>use-mcp</code> library to manage connections to remote MCP servers. When the playground starts up, it initializes the MCP connection system with <code>const{tools: mcpTools} = useMcp()</code>, which provides access to all tools from connected servers. At first, this list is empty because it’s not connected to any MCP servers, but once a connection to a remote MCP server is established, the tools are automatically discovered and populated into the list. </p><p>Once <a href="https://github.com/cloudflare/ai/blob/af1ce8be87d6a4e6bc10bb83f7959e63b28c1c8e/playground/ai/src/McpServers.tsx#L550"><u>connected</u></a>, the playground immediately has access to any tools that the MCP server exposes. The <code>use-mcp</code> library handles all the protocol communication and tool discovery, and maintains the connection state. If the MCP server requires authentication, the playground handles OAuth flows through a dedicated callback page that uses <code>onMcpAuthorization </code>from <code>use-mcp</code> to complete the authentication process.</p><p>When a user sends a chat message, the playground takes the <code>mcpTools</code> from the <code>use-mcp</code> hook and passes them directly to Workers AI, enabling the model to understand what capabilities are available and invoke them as needed. </p>
            <pre><code>const stream = useChat({
  api: "/api/inference",
  body: {
    model: params.model,
    tools: mcpTools, // Tools from connected MCP servers
    max_tokens: params.max_tokens,
    system_message: params.system_message,
  },
})</code></pre>
            
    <div>
      <h3>Debugging and monitoring</h3>
      <a href="#debugging-and-monitoring">
        
      </a>
    </div>
    <p>To monitor and debug connections to MCP servers, we’ve added a Debug Log interface to the playground. This displays real-time information about the MCP server connections, including connection status, authentication state, and any connection errors. </p><p>During the chat interactions, the debug interface will show the raw message exchanged between the playground and the MCP server, including the tool invocation and its result. This allows you to monitor the JSON payload being sent to the MCP server, the raw response returned, and track whether the tool call succeeded or failed. This is especially helpful for anyone building remote MCP servers, as it allows you to see how your tools are behaving when integrated with different language models. </p>
    <div>
      <h2>Contributing to the MCP ecosystem</h2>
      <a href="#contributing-to-the-mcp-ecosystem">
        
      </a>
    </div>
    <p>One of the reasons why MCP has evolved so quickly is that it's an open source project, powered by the community. We're excited to contribute the <code>use-mcp</code> library to the <a href="https://github.com/modelcontextprotocol"><u>MCP ecosystem</u></a> to enable more developers to build remote MCP clients. </p><p>If you're looking for examples of MCP clients or MCP servers to get started with, check out the<a href="https://github.com/cloudflare/ai"> <u>Cloudflare AI GitHub repository</u></a> for working examples you can deploy and modify. This includes the complete AI Playground <a href="https://github.com/cloudflare/ai/tree/main/playground/ai"><u>source code,</u></a> a number of remote MCP servers that use different authentication &amp; authorization providers, and the <a href="https://github.com/cloudflare/ai/tree/main/demos/use-mcp-inspector"><u>MCP Inspector</u></a>. </p><p>We’re also building the <a href="https://github.com/cloudflare/mcp-server-cloudflare"><u>Cloudflare MCP servers</u></a> in public and welcome contributions to help make them better. </p><p>Whether you're building your first MCP server, integrating MCP into an existing application, or contributing to the broader ecosystem, we'd love to hear from you. If you have any questions, feedback, or ideas for collaboration, you can reach us via email at <a><u>1800-mcp@cloudflare.com</u></a>. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7sYYS9c45orRX6SaUw5qTx/b975c5221ab538cc8f1167b706da375f/image3.png" />
          </figure><p></p> ]]></content:encoded>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Agents]]></category>
            <category><![CDATA[MCP]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Developers]]></category>
            <guid isPermaLink="false">4gk3k2ZiTN6DZoHu3e090r</guid>
            <dc:creator>Dina Kozlov</dc:creator>
            <dc:creator>Glen Maddern</dc:creator>
            <dc:creator>Sunil Pai</dc:creator>
        </item>
        <item>
            <title><![CDATA[Thirteen new MCP servers from Cloudflare you can use today]]></title>
            <link>https://blog.cloudflare.com/thirteen-new-mcp-servers-from-cloudflare/</link>
            <pubDate>Thu, 01 May 2025 13:01:19 GMT</pubDate>
            <description><![CDATA[ You can now connect to Cloudflare's first publicly available remote Model Context Protocol (MCP) servers from any MCP client that supports remote servers.  ]]></description>
            <content:encoded><![CDATA[ <p>You can now connect to Cloudflare's first publicly available <a href="https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/"><u>remote Model Context Protocol (MCP) servers</u></a> from Claude.ai (<a href="http://anthropic.com/news/integrations"><u>now supporting remote MCP connections!</u></a>) and other <a href="https://modelcontextprotocol.io/clients"><u>MCP clients</u></a> like Cursor, Windsurf, or our own <a href="https://playground.ai.cloudflare.com/"><u>AI Playground</u></a>. Unlock Cloudflare tools, resources, and real time information through our new suite of MCP servers including: </p>
<div><table><thead>
  <tr>
    <th><span>Server</span></th>
    <th><span>Description </span></th>
  </tr></thead>
<tbody>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/docs-vectorize"><span>Cloudflare Documentation server</span></a></td>
    <td><span>Get up to date reference information from Cloudflare Developer Documentation</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/workers-bindings"><span>Workers Bindings server </span></a></td>
    <td><span>Build Workers applications with storage, AI, and compute primitives</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/workers-observability"><span>Workers Observability server </span></a></td>
    <td><span>Debug and get insight into your Workers application’s logs and analytics</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/sandbox-container"><span>Container server</span></a></td>
    <td><span>Spin up a sandbox development environment </span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/browser-rendering"><span>Browser rendering server</span></a><span> </span></td>
    <td><span>Fetch web pages, convert them to markdown and take screenshots</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/radar"><span>Radar server </span></a></td>
    <td><span>Get global Internet traffic insights, trends, URL scans, and other utilities</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/logpush"><span>Logpush server </span></a></td>
    <td><span>Get quick summaries for Logpush job health</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/ai-gateway"><span>AI Gateway server </span></a></td>
    <td><span>Search your logs, get details about the prompts and responses</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/autorag"><span>AutoRAG server</span></a></td>
    <td><span>List and search documents on your AutoRAGs</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/auditlogs"><span>Audit Logs server </span></a></td>
    <td><span>Query audit logs and generate reports for review</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/dns-analytics"><span>DNS Analytics server </span></a></td>
    <td><span>Optimize DNS performance and debug issues based on current set up</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/dex-analysis"><span>Digital Experience Monitoring server </span></a></td>
    <td><span>Get quick insight on critical applications for your organization</span></td>
  </tr>
  <tr>
    <td><a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/cloudflare-one-casb"><span>Cloudflare One CASB server </span></a></td>
    <td><span>Quickly identify any security misconfigurations for SaaS applications to safeguard applications, users, and data</span></td>
  </tr>
</tbody></table></div><p>… all through a natural language interface! </p><p>Today, we also <a href="http://blog.cloudflare.com/mcp-demo-day"><u>announced our collaboration with Anthropic</u></a> to bring remote MCP to <a href="https://claude.ai/"><u>Claude</u></a> users, and showcased how other leading companies such as <a href="https://www.atlassian.com/platform/remote-mcp-server"><u>Atlassian</u></a>, <a href="https://developer.paypal.com/tools/mcp-server/"><u>PayPal</u></a>, <a href="https://docs.sentry.io/product/sentry-mcp/"><u>Sentry</u></a>, and <a href="https://mcp.webflow.com"><u>Webflow</u></a> have built remote MCP servers on Cloudflare to extend their service to their users. We’ve also been using the same infrastructure and tooling to build out our own suite of remote servers, and today we’re excited to show customers what’s ready for use and share what we’ve learned along the way. </p>
    <div>
      <h3>Cloudflare’s MCP servers available today: </h3>
      <a href="#cloudflares-mcp-servers-available-today">
        
      </a>
    </div>
    <p>These <a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/">MCP servers</a> allow your <a href="https://modelcontextprotocol.io/clients"><u>MCP Client</u></a> to read configurations from your account, process information, make suggestions based on data, and even make those suggested changes for you. All of these actions can happen across Cloudflare's many services including application development, security, and performance.</p>
    <div>
      <h4><b>Cloudflare Documentation Server: </b>Get up-to-date reference information on Cloudflare </h4>
      <a href="#cloudflare-documentation-server-get-up-to-date-reference-information-on-cloudflare">
        
      </a>
    </div>
    <p>Our <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/docs-vectorize"><u>Cloudflare Documentation server</u></a> enables any MCP Client to access up-to-date <a href="https://developers.cloudflare.com/"><u>documentation</u></a> in real-time, rather than relying on potentially outdated information from the model's training data. If you’re new to building with Cloudflare, this server synthesizes information right from our documentation and exposes it to your MCP Client, so you can get reliable, up-to-date responses to any complex question like “Search Cloudflare for the best way to build an AI Agent”.  </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3vanQPwy6YSwI7bsDTk2md/09cb4763ddbd4858fcd90aca00106bb9/BLOG-2808_2.png" />
          </figure>
    <div>
      <h4><b>Workers Bindings server: </b>Build with developer resources </h4>
      <a href="#workers-bindings-server-build-with-developer-resources">
        
      </a>
    </div>
    <p>Connecting to the <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/workers-bindings"><u>Bindings MCP server</u></a> lets you leverage application development primitives like D1 databases, <a href="https://www.cloudflare.com/developer-platform/products/r2/">R2 object storage</a> and Key Value stores on the fly as you build out a Workers application. If you're leveraging your MCP Client to generate code, the bindings server provides access to read existing resources from your account or create fresh resources to implement in your application. In combination with our <a href="https://developers.cloudflare.com/workers/get-started/prompting/"><u>base prompt</u></a> designed to help you build robust Workers applications, you can add the Bindings MCP server to give your client all it needs to start generating full stack applications from natural language. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6N0Y8BCBz5ULSHbj0JCIkL/3a6a9ef269202a6c05d18444f313ce87/BLOG-2808_3.png" />
          </figure><p>
Full example output using the Workers Bindings MCP server can be found <a href="https://claude.ai/share/273dadf7-b060-422d-b2b6-4f436d537136"><u>here</u></a>.</p>
    <div>
      <h4><b>Workers Observability server: </b>Debug your application </h4>
      <a href="#workers-observability-server-debug-your-application">
        
      </a>
    </div>
    <p>The <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/workers-observability"><u>Workers Observability MCP server</u></a> integrates with <a href="https://developers.cloudflare.com/workers/observability/logs/workers-logs/"><u>Workers Logs</u></a> to browse invocation logs and errors, compute statistics across invocations, and find specific invocations matching specific criteria. By querying logs across all of your Workers, this MCP server can help isolate errors and trends quickly. The telemetry data that the MCP server returns can also be used to create new visualizations and improve <a href="https://www.cloudflare.com/learning/performance/what-is-observability/">observability</a>.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1rydyUALBbwtPrT477xAKM/81547e1fb3cec5ffadd90ee5e68e1a5e/BLOG-2808_4.png" />
          </figure>
    <div>
      <h4><b>Container server:</b> Spin up a development environment</h4>
      <a href="#container-server-spin-up-a-development-environment">
        
      </a>
    </div>
    <p>The <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/sandbox-container"><u>Container MCP server</u></a> provides any MCP client with access to a secure, isolated execution environment running on Cloudflare’s network where it can run and test code if your MCP client does not have a built in development environment (e.g. claude.ai). When building and generating application code, this lets the AI run its own commands and validate its assumptions in real time. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1rXgpQ3znIE01ccY1Qd2cQ/058902719a90af14175b8e838b09b78e/BLOG-2808_5.png" />
          </figure>
    <div>
      <h4><b>Browser Rendering server: </b>Fetch and convert web pages, take screenshots </h4>
      <a href="#browser-rendering-server-fetch-and-convert-web-pages-take-screenshots">
        
      </a>
    </div>
    <p>The <a href="https://developers.cloudflare.com/browser-rendering/"><u>Browser Rendering</u></a> MCP server provides AI friendly tools from our <a href="https://developers.cloudflare.com/browser-rendering/rest-api/"><u>RESTful interface</u></a> for common browser actions such as capturing screenshots, extracting HTML content, and <a href="https://blog.cloudflare.com/markdown-for-agents/">converting pages to Markdown</a>. These are particularly useful when building agents that require interacting with a web browser.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3aQtQxzj1hP6cbtbY4CHXI/27535e9f9a041187c12f6b41ba36afdb/BLOG-2808_6.png" />
          </figure>
    <div>
      <h4><b>Radar server: </b>Ask questions about how we see the Internet and Scan URLs</h4>
      <a href="#radar-server-ask-questions-about-how-we-see-the-internet-and-scan-urls">
        
      </a>
    </div>
    <p>The <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/radar"><u>Cloudflare Radar MCP server</u></a> exposes tools that allow any MCP client to explore our aggregated <a href="https://radar.cloudflare.com/traffic#http-traffic"><u>HTTP traffic data</u></a>, get information on <a href="https://radar.cloudflare.com/traffic/as701"><u>Autonomous Systems</u></a> (AS) and <a href="https://radar.cloudflare.com/ip/72.74.50.251"><u>IP addresses</u></a>, list traffic anomalies from our <a href="https://radar.cloudflare.com/outage-center"><u>Outage Center</u></a>, get <a href="https://radar.cloudflare.com/domains"><u>trending domains</u></a>, and domain rank information. It can even create charts. Here’s a chat where we ask "show me the <a href="https://claude.ai/public/artifacts/34c8a494-abdc-4755-9ca7-cd8e0a8bea41"><u>HTTP traffic from Portugal</u></a> for the last week":</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/9yg9Fnkoz6t6QOwUK1a5r/b11756fd82058f04037740678160cc7c/BLOG-2808_7.png" />
          </figure>
    <div>
      <h4><b>Logpush server: </b>Get quick summaries for Logpush job health </h4>
      <a href="#logpush-server-get-quick-summaries-for-logpush-job-health">
        
      </a>
    </div>
    <p><a href="https://developers.cloudflare.com/logs/about/"><u>Logpush</u></a> jobs deliver comprehensive logs to your destination of choice, allowing near real-time information processing. The Logpush MCP server can help you analyze your Logpush job results and understand your job health at a high level, allowing you to filter and narrow down for jobs or scenarios you care about. For example, you can ask “provide me with a list of recently failed jobs.” Now, you can quickly find out which jobs are failing with which error message and when, summarized in a human-readable format. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4ltuXD2TgEhiblx6aNhm4d/d63b14f151fd3a239b0a3cf0dfb92ebf/BLOG-2808_8.png" />
          </figure>
    <div>
      <h4><b>AI Gateway server: </b>Check out your AI Gateway logs </h4>
      <a href="#ai-gateway-server-check-out-your-ai-gateway-logs">
        
      </a>
    </div>
    <p>Use this <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/ai-gateway"><u>MCP server</u></a> to inspect your <a href="https://www.cloudflare.com/developer-platform/products/ai-gateway/">AI Gateway</a> logs and get details about the data from your prompts and the AI models responses. In this example we ask our agent “What is my average latency for my AI Gateway logs in the <i>Cloudflare Radar</i> account?”</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7dYzkZ0cYcXPjFKlhdqkMp/52f2b7e62fe2bb05c91fc563738ddfc2/BLOG-2808_9.png" />
          </figure>
    <div>
      <h4><b>AutoRAG server:</b> List and search documents on your AutoRAGs</h4>
      <a href="#autorag-server-list-and-search-documents-on-your-autorags">
        
      </a>
    </div>
    <p>Having AutoRAG RAGs available to query as MCP tools greatly expands the typical static one-shot retrieval​ and opens doors to use cases where the agent can dynamically decide if and when to retrieve information from one or more <a href="https://www.cloudflare.com/learning/ai/retrieval-augmented-generation-rag/">RAGs</a>, combine them with other tools and APIs, cross-check information and generate a much more rich and complete final answer.</p><p>Here we have a RAG that has a few blog posts that talk about retrocomputers. If we ask "tell me about restoring an amiga 1000 using the blog-celso autorag" the agent will go into a sequence of <a href="https://claude.ai/share/18f1be31-9936-48c0-9de0-151d64f3534e"><u>reasoning steps</u></a>:</p><ul><li><p>“Now that I have some information about Amiga 1000 restoration from blog-celso, let me search for more specific details.”</p></li><li><p>“Let me get more specific information about hardware upgrades and fixes for the Amiga 1000.”</p></li><li><p>“Let me get more information about the DiagROM and other tools used in the restoration.”</p></li><li><p>“Let me search for information about GBA1000 and other expansions mentioned in the blog.”</p></li><li><p>And finally, “Based on the comprehensive information I've gathered from the blog-celso AutoRAG, I can now provide you with a detailed guide on restoring an Amiga 1000.”</p></li></ul><p>And at the end, it generates a very detailed answer based on all the data from all the queries:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4Z8BJSvd4x233FPZDePeSk/e59b8676a92f828d32feb1d28381a216/BLOG-2808_10.png" />
          </figure>
    <div>
      <h4><b>Audit Logs server: </b>Query audit logs and generate reports for review</h4>
      <a href="#audit-logs-server-query-audit-logs-and-generate-reports-for-review">
        
      </a>
    </div>
    <p>Audit Logs record detailed information about actions and events within a system, providing a transparent history of all activity. However, because these logs can be large and complex, it may take effort to query and reconstruct a clear sequence of events. The <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/auditlogs"><u>Audit Logs MCP server</u></a> helps by allowing you to query audit logs and generate reports. Common queries include if anything notable happened in a Cloudflare account under a user around a particular time of the day, or identifying whether any users used API keys to perform actions on the account. For example, you can ask “Were there any suspicious changes made to my Cloudflare account yesterday around lunchtime?” and obtain the following response: </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/YdV73LhsCmjdQtOK8U7Ii/89f11db15e079190a234665ac4794754/BLOG-2808_11.png" />
          </figure>
    <div>
      <h4><b>DNS Analytics server: </b>Optimize DNS performance and debug issues based on current set up</h4>
      <a href="#dns-analytics-server-optimize-dns-performance-and-debug-issues-based-on-current-set-up">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/application-services/products/analytics/"><u>Cloudflare’s DNS Analytics</u></a> provides detailed insights into DNS traffic, which helps you monitor, analyze, and troubleshoot DNS performance and security across your domains. With Cloudflare’s <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/dns-analytics"><u>DNS Analytics MCP server</u></a>, you can review DNS configurations across all domains in your account, access comprehensive DNS performance reports, and receive recommendations for performance improvements. By leveraging documentation, the MCP server can help identify opportunities for improving performance. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3X7w64xQvvFbv24HaFeLDv/3fefb7ff9e912207c5897200beefd26f/image4.png" />
          </figure>
    <div>
      <h4><b>Digital Experience Monitoring server</b>: Get quick insight on critical applications for your organization </h4>
      <a href="#digital-experience-monitoring-server-get-quick-insight-on-critical-applications-for-your-organization">
        
      </a>
    </div>
    <p>Cloudflare <a href="https://www.cloudflare.com/learning/performance/what-is-digital-experience-monitoring/">Digital Experience Monitoring (DEM)</a> was built to help network professionals understand the performance and availability of their critical applications from self-hosted applications like Jira and Bitbucket to SaaS applications like Figma or Salesforce. The <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/dex-analysis"><u>Digital Experience Monitoring MCP server</u></a> fetches DEM test results to surface performance and availability trends within your Cloudflare One deployment, providing quick insights on users, applications, and the networks they are connected to. You can ask questions like: Which users had the worst experience? What times of the day were applications most and least performant? When do I see the most HTTP status errors? When do I see the shortest, longest, or most instability in the network path? </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7Ctxdt7tw04Rfzl9Ihxnkw/fc9c9ab553daa58f59e024dd66dd3dea/BLOG-2808_12.png" />
          </figure>
    <div>
      <h4><b>CASB server</b>: Insights from SaaS Integrations</h4>
      <a href="#casb-server-insights-from-saas-integrations">
        
      </a>
    </div>
    <p><a href="https://www.cloudflare.com/zero-trust/products/casb/"><u>Cloudflare CASB</u></a> provides the ability to integrate with your organization’s <a href="https://developers.cloudflare.com/cloudflare-one/applications/casb/casb-integrations/"><u>SaaS and cloud applications</u></a> to discover assets and surface any security misconfigurations that may be present. A core task is helping security teams understand information about users, files, and other assets they care about that transcends any one SaaS application. The <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main/apps/cloudflare-one-casb"><u>CASB MCP server</u></a> can explore across users, files, and the many other asset categories to help understand relationships from data that can exist across many different integrations. A common query may include “Tell me about “Frank Meszaros” and what SaaS tools they appear to have accessed”.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3aJOta5YYZ1FqZyHF0wVnx/2c79512fb674eb2762395e5ccaac9700/BLOG-2808_13.png" />
          </figure>
    <div>
      <h3>Get started with our MCP servers </h3>
      <a href="#get-started-with-our-mcp-servers">
        
      </a>
    </div>
    <p>You can start using our Cloudflare MCP servers today! If you’d like to read more about specific tools available in each server, you can find them in our <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main"><u>public GitHub repository</u></a>. Each server is deployed to a server URL, such as</p><p><code>https://observability.mcp.cloudflare.com/sse.</code></p><p>If your MCP client has first class support for remote MCP servers, the client will provide a way to accept the server URL directly within its interface. For example, if you are using <a href="https://claude.ai/settings/profile"><u>claude.ai</u></a>, you can: </p><ol><li><p>Navigate to your <a href="https://claude.ai/settings/profile"><u>settings</u></a> and add a new “Integration” by entering the URL of your MCP server</p></li><li><p>Authenticate with Cloudflare</p></li><li><p>Select the tools you’d like claude.ai to be able to call</p></li></ol>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5zWyWq2gS08CZsCQNB2fFZ/4e2c88abc90e11055159127e2abaf7b2/BLOG-2808_14.png" />
          </figure><p>If your client does not yet support remote MCP servers, you will need to set up its respective configuration file (mcp_config.json) using <a href="https://www.npmjs.com/package/mcp-remote"><u>mcp-remote</u></a> to specify which servers your client can access.</p>
            <pre><code>{
	"mcpServers": {
		"cloudflare-observability": {
			"command": "npx",
			"args": ["mcp-remote", "https://observability.mcp.cloudflare.com/sse"]
		},
		"cloudflare-bindings": {
			"command": "npx",
			"args": ["mcp-remote", "https://bindings.mcp.cloudflare.com/sse"]
		}
	}
}
</code></pre>
            
    <div>
      <h3>Have feedback on our servers?</h3>
      <a href="#have-feedback-on-our-servers">
        
      </a>
    </div>
    <p>While we're launching with these initial 13 MCP servers, we are just getting started! We want to hear your feedback as we shape existing and build out more Cloudflare MCP servers that unlock the most value for your teams leveraging AI in their daily workflows. If you’d like to provide feedback, request a new MCP server, or report bugs, please raise an issue on our <a href="https://github.com/cloudflare/mcp-server-cloudflare/tree/main"><u>GitHub repository. </u></a> </p>
    <div>
      <h3>Building your own MCP server?</h3>
      <a href="#building-your-own-mcp-server">
        
      </a>
    </div>
    <p>If you’re interested in building your own servers, we've discovered valuable best practices that we're excited to share with you as we’ve been building ours. While MCP is really starting to gain momentum and many organizations are just beginning to build their own servers, these principals should help guide you as you start building out MCP servers for your customers. </p><ol><li><p><b>An MCP server is not our entire API schema: </b>Our goal isn't to build a large wrapper around all of Cloudflare’s API schema, but instead focus on optimizing for specific jobs to be done and reliability of the outcome. This means while one tool from our MCP server may map to one API, another tool may map to many. We’ve found that fewer but more powerful tools may be better for the agent with smaller context windows, less costs, a faster output, and likely more valid answers from LLMs. Our MCP servers were created directly by the product teams who are responsible for each of these areas of Cloudflare – application development, security and performance – and are designed with user stories in mind. This is a pattern you will continue to see us use as we build out more Cloudflare servers. </p></li><li><p><b>Specialize permissions with multiple servers:</b> We built out several specialized servers rather than one for a critical reason: security through precise permission scoping. Each MCP server operates with exactly the permissions needed for its specific task – nothing more. By separating capabilities across multiple servers, each with its own authentication scope, we prevent the common security pitfall of over-privileged access. </p></li><li><p><b>Add robust server descriptions within parameters:</b> Tool descriptions were core to providing helpful context to the agent. We’ve found that more detailed descriptions help the agent understand not just the expected data type, but also the parameter's purpose, acceptable value ranges, and impact on server behavior. This context allows agents to make intelligent decisions about parameter values rather than providing arbitrary and potentially problematic inputs, allowing your natural language to go further with the agent. </p></li><li><p><b>Using evals at each iteration:</b> For each server, we implemented evaluation tests or “evals” to assess the model's ability to follow instructions, select appropriate tools, and provide correct arguments to those tools. This gave us a programmatic way to understand if any regressions occurred through each iteration, especially when tweaking tool descriptions. </p></li></ol><p>Ready to start building? Click the button below to deploy your first remote MCP server to production: </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-authless"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>Or check out our documentation to learn more! If you have any questions or feedback for us, you can reach us via email at <a><u>1800-mcp@cloudflare.com</u></a> or join the chatter in the <a href="https://discord.com/channels/595317990191398933/1354548448635912324"><u>Cloudflare Developers Discord</u></a>.</p> ]]></content:encoded>
            <category><![CDATA[Model Context Protocol]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Agents]]></category>
            <category><![CDATA[Open Source]]></category>
            <category><![CDATA[MCP]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">17j3OSuM89oMb5wurF4Tij</guid>
            <dc:creator>Nevi Shah</dc:creator>
            <dc:creator>Maximo Guk </dc:creator>
            <dc:creator>Christian Sparks</dc:creator>
        </item>
        <item>
            <title><![CDATA[MCP Demo Day: How 10 leading AI companies built MCP servers on Cloudflare]]></title>
            <link>https://blog.cloudflare.com/mcp-demo-day/</link>
            <pubDate>Thu, 01 May 2025 13:00:21 GMT</pubDate>
            <description><![CDATA[ We’re teaming up with Anthropic, Asana, Atlassian, Block, Intercom, Linear, PayPal, Sentry, Stripe, and Webflow to launch new remote MCP servers, built on Cloudflare, to enable Claude users to manage ]]></description>
            <content:encoded><![CDATA[ <p>Today, we're excited to collaborate with Anthropic, Asana, Atlassian, Block, Intercom, Linear, PayPal, Sentry, Stripe, and Webflow to bring a whole new set of remote MCP servers, all built on Cloudflare, to enable <a href="https://claude.ai/"><u>Claude</u></a> users to manage projects, generate invoices, query databases, and even deploy full stack applications — without ever leaving the chat interface. </p><p>Since <a href="https://www.anthropic.com/news/model-context-protocol">Anthropic’s</a> introduction of the <a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/">Model Context Protocol</a> (MCP) in November, there’s been more and more excitement about it, and it seems like a new MCP server is being released nearly every day. And for good reason!  MCP has been the missing piece to make <a href="https://www.cloudflare.com/learning/ai/what-is-agentic-ai/">AI agents</a> a reality, and helped define how AI agents interact with tools to take actions and get additional context.</p><p>But to date, end-users have had to install MCP servers on their local machine to use them. Today, with <a href="http://anthropic.com/news/integrations"><u>Anthropic’s announcement</u></a> of Integrations, you can access an MCP server the same way you would a website: type a URL and go.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/5FLvAIrlxVcKPZNRG5Qhwj/f252d4de66f45e1f06bb94d76e1bf4c1/BLOG-2811_2.png" />
          </figure><p>At Cloudflare, we’ve been focused on<a href="https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/"><u> building out the tooling</u></a> that simplifies the development of remote MCP servers, so that our customers’ engineering teams can focus their time on building out the MCP tools for their application, rather than managing the complexities of the protocol. And if you’re wondering just how easy is it to deploy a remote MCP server on Cloudflare, we’re happy to tell you that it only takes one click to get an MCP server — pre-built with support for the latest MCP standards — deployed. </p><p>But you don’t have to take our word for it, see it for yourself! Industry leaders are taking advantage of the ease of use to deliver new AI-powered experiences to their users by building their MCP servers on Cloudflare and now, you can do the same — just click “Deploy to Cloudflare” to get started. </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-authless"><img src="https://deploy.workers.cloudflare.com/button" /></a><p><code></code></p><p>Keep reading to learn more about the new capabilities that these companies are unlocking for their users and how they were able to deliver them. Or, see it in action by joining us for <a href="https://demo-day.mcp.cloudflare.com/"><u>Demo Day</u></a> on May 1 (today) at 10:00 AM PST. </p><p>We’re also making <a href="https://blog.cloudflare.com/thirteen-new-mcp-servers-from-cloudflare"><u>Cloudflare's remote MCP servers</u></a> available to customers today and sharing what we learned from building them out. </p>
    <div>
      <h2>MCP: Powering the next generation of applications</h2>
      <a href="#mcp-powering-the-next-generation-of-applications">
        
      </a>
    </div>
    <p>It wasn’t always the expectation that every service, whether a store, real estate agent, or service would have a website. But as more people gained access to an Internet connection, that quickly became the case.</p><p>We’re in the midst of a similar transition now to every web user having access to AI tools, turning to them for many tasks. If you’re a developer, it’s likely the case that the first place you turn when you go to write code now is to a tool like Claude. It seems reasonable then, that if Claude helped you write the code, it would also help you deploy it.</p><p>Or if you’re not a developer, if Claude helped you come up with a recipe, that it would also help you order the required groceries. </p><p>With remote MCP, all of these scenarios are now possible. And just like the first businesses built on the web had a first mover advantage, the first businesses to be built in an MCP-forward way are likely to reap the benefits. </p><p>The faster a user can experience the value of your product, the more likely they will be to succeed, upgrade, and continue to use your product. By connecting services to agents through MCP, users can simply ask for what they need and the agent will handle the rest, getting them to that “aha” moment faster. </p>
    <div>
      <h2>Making your service AI-first with MCP</h2>
      <a href="#making-your-service-ai-first-with-mcp">
        
      </a>
    </div>
    <p>Businesses that adopt MCP will quickly see the impact: </p>
    <div>
      <h3>Lower the barrier to entry</h3>
      <a href="#lower-the-barrier-to-entry">
        
      </a>
    </div>
    <p>Not every user has the time to learn your dashboard or read through documentation to understand your product. With MCP, they don’t need to. They just describe what they want, and the agent figures out the rest. </p>
    <div>
      <h3>Create personalized experiences</h3>
      <a href="#create-personalized-experiences">
        
      </a>
    </div>
    <p>MCP can keep track of a user’s requests and interactions, so future tool calls can be adapted to their usage patterns and preferences. This makes it easy to deliver more personalized, relevant experiences based on how each person actually uses your product.</p>
    <div>
      <h3>Drive upgrades naturally</h3>
      <a href="#drive-upgrades-naturally">
        
      </a>
    </div>
    <p>Rather than relying on feature comparison tables, the AI agent can explain how a higher-tier plan helps a specific user accomplish <i>their</i> goals. </p>
    <div>
      <h3>Ship new features and integrations</h3>
      <a href="#ship-new-features-and-integrations">
        
      </a>
    </div>
    <p>You don’t need to build every integration or experience in-house. By exposing your tools via MCP, you let users connect your product to the rest of their stack. Agents can combine tools across providers, enabling integrations without requiring you to support every third-party service directly.</p>
    <div>
      <h2>Why build MCP on Cloudflare? </h2>
      <a href="#why-build-mcp-on-cloudflare">
        
      </a>
    </div>
    <p>Since the launch of MCP, we’ve <a href="https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/"><u>shared</u></a> how we’re making it easy for developers to <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>build and deploy remote MCP servers</u></a> — from abstracting away protocol complexity to handling auth and transport, to <a href="https://blog.cloudflare.com/building-ai-agents-with-mcp-authn-authz-and-durable-objects/"><u>supporting fully stateful MCP servers</u></a> (by default) that <a href="https://developers.cloudflare.com/agents/model-context-protocol/mcp-agent-api/#hibernation-support"><u>“sleep”</u></a> when they’re not used to minimize idle costs.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7rTqqs8gSYef4uIiS1aSqz/5147063aff613078af22e5b5b5b55570/BLOG-2811_3.png" />
          </figure><p>We’re continuing to ship updates regularly — <a href="https://blog.cloudflare.com/streamable-http-mcp-servers-python/"><u>adding support</u></a> for the <a href="https://modelcontextprotocol.io/specification/2025-03-26"><u>latest changes</u></a> to the MCP standard and making it even easier to get your server to production:</p><ul><li><p><a href="https://developers.cloudflare.com/agents/model-context-protocol/transport/"><b><u>Supporting the new Streamable HTTP transport</u></b></a><b>:</b> Your MCP servers can now use the latest Streamable HTTP transport alongside SSE, ensuring compatibility with the latest standards. We’ve updated the AI Playground and <a href="https://www.npmjs.com/package/mcp-remote"><u>mcp-remote</u></a> proxy as well, giving you a remote MCP client to easily test the new transport.</p></li><li><p><a href="https://github.com/cloudflare/ai/tree/main/demos/python-workers-mcp"><b><u>Python support for MCP servers</u></b></a><b>: </b>You can now build MCP servers on Cloudflare using Python, not just JavaScript/TypeScript. </p></li><li><p><b>Improved docs, starter templates, and deploy flows:</b> We’ve added <a href="https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-authless"><u>new quickstart templates</u></a>, expanded our <a href="https://developers.cloudflare.com/agents/model-context-protocol/transport/"><u>documentation</u></a> to cover the new transport method, and shared <a href="https://developers.cloudflare.com/agents/model-context-protocol/#best-practices"><u>best practices</u></a> for building MCP servers based on our learnings. </p></li></ul><p>But rather than telling you, we thought it would be better to show you what our customers have built and why they chose Cloudflare for their MCP deployment. </p>
    <div>
      <h2>Remote MCP servers you can connect to today</h2>
      <a href="#remote-mcp-servers-you-can-connect-to-today">
        
      </a>
    </div>
    
    <div>
      <h3>Asana</h3>
      <a href="#asana">
        
      </a>
    </div>
    <p>Today, work lives across many different apps and services. By investing in MCP, Asana can meet users where they are, enabling agent-driven interoperability across tools and workflows. Users can interact with the Asana Work Graph using natural language to get project updates, search for tasks, manage projects, send comments, and update deadlines from an MCP client.</p><p>Users will be able to orchestrate and integrate different pieces of work seamlessly — for example, turning a project plan or meeting notes from another app into a fully assigned set of tasks in Asana, or pulling Asana tasks directly into an MCP-enabled IDE for implementation. This flexibility makes managing work across systems easier, faster, and more natural than ever before.</p><p>To accelerate the launch of our first-party MCP server, Asana built on Cloudflare's tooling, taking advantage of the foundational infrastructure to move quickly and reliably in this fast-evolving space.</p><p><i>"At Asana, we've always focused on helping teams coordinate work effortlessly. MCP connects our Work Graph directly to AI tools like Claude.ai, enabling AI to become a true teammate in work management. Our integration transforms natural language into structured work – creating projects from meeting notes or pulling updates into AI. Building on Cloudflare's infrastructure allowed us to deploy quickly, handling authentication and scaling while we focused on creating the best experience for our users." – Prashant Pandey, Chief Technology Officer, Asana</i></p><p>Learn more about Asana’s MCP server <a href="https://developers.asana.com/docs/using-asanas-model-control-protocol-mcp-server"><u>here</u></a>. </p>
    <div>
      <h3>Atlassian</h3>
      <a href="#atlassian">
        
      </a>
    </div>
    <p>Jira and Confluence Cloud customers can now securely interact with their data directly from Anthropic’s Claude app via the <a href="http://atlassian.com/platform/remote-mcp-server"><u>Atlassian Remote MCP</u></a> Server in beta. Hosted on Cloudflare infrastructure, users can summarize work, create issues or pages, and perform multi-step actions, all while keeping data secure and within permissioned boundaries.</p><p>Users can access information from Jira and Confluence wherever they use Claude to:</p><ul><li><p>Summarize Jira work items or Confluence pages</p></li><li><p>Create Jira work items or Confluence pages directly from Claude</p></li><li><p>Get the model to take multiple actions in one go, like creating issues or pages in bulk</p></li><li><p>Enrich Jira work items with context from many different sources to which Claude has access</p></li><li><p>And so much more!</p></li></ul><p><i>“AI is not one-size-fits-all and we believe that it needs to be embedded within a team’s jobs to be done. That’s why we’re so excited to invest in MCP and meet teams in more places where they already work. Hosting on Cloudflare infrastructure means we can bring this powerful integration to our customers faster and empower them to do more than ever with Jira and Confluence, all while keeping their enterprise data secure. Cloudflare provided everything from OAuth to out-of-the-box remote MCP support so we could quickly build, secure, and scale a fully operational setup.” — Taroon Mandhana, Head of Product Engineering, Atlassian</i></p><p>Learn more about Atlassian’s MCP server <a href="https://www.atlassian.com/blog/announcements/remote-mcp-server"><u>here</u></a>. </p>
    <div>
      <h3>Intercom</h3>
      <a href="#intercom">
        
      </a>
    </div>
    <p>At Intercom, the transformative power of AI is becoming increasingly clear. Fin, Intercom’s AI Agent, is now autonomously resolving over 50% of customer support conversations for leading companies such as Anthropic. With MCP, connecting AI to internal tools and systems is easier than ever, enabling greater business value.</p><p>Customer conversations, for instance, offer valuable insights into how products are being used and the experiences customers are having. However, this data is often locked within the support platform. The Intercom MCP server unlocks this rich source of customer data, making it accessible to anyone in the organization using AI tools. Engineers, for example, can leverage conversation history and user data from Intercom in tools like Cursor or Claude Code to diagnose and resolve issues more efficiently.</p><p><i>“The momentum behind MCP is exciting. It’s making it easier and easier to connect assistants like Claude.ai and agents like Fin to your systems and get real work done. Cloudflare's toolkit is accelerating that movement even faster. Their clear documentation, purpose-built tools, and developer-first platform helped Intercom go from concept to production in under a day, making the Intercom MCP server launch effortless. We’ll be encouraging our customers to leverage Cloudflare to build and deploy their own MCP servers to securely and reliably connect their internal systems to Fin and other clients.” — Jordan Neill, SVP Engineering, Intercom</i></p>
    <div>
      <h3>Linear</h3>
      <a href="#linear">
        
      </a>
    </div>
    <p>The Linear MCP server allows users to bring the context of their issues and product development process directly into AI assistants when it's needed. Whether that is refining a product spec in Claude, collaborating on fixing a bug with Cursor, or creating issues on the fly from an email. </p><p><i>“We're building on Cloudflare to take advantage of their frameworks in this fast-moving space and flexible, fast, compute at the edge. With MCP, we're bringing Linear's issue tracking and product development workflows directly into their AI tools of choice, eliminating context switching for teams. Our goal is simple: let developers and product teams access their work where they already are—whether refining specs in Claude, debugging in Cursor, or creating issues from conversations. This seamless integration helps our customers stay in flow and focused on building great products” — Tom Moor, Head of US Engineering, Linear</i></p><p>Learn more about Linear’s MCP server <a href="https://linear.app/docs/mcp"><u>here</u></a>. </p>
    <div>
      <h3>PayPal</h3>
      <a href="#paypal">
        
      </a>
    </div>
    <p><i>"MCPs represent a new paradigm for software development. With PayPal's remote MCP server on Cloudflare, now developers can delegate to an agent with natural language to seamlessly integrate with PayPal's portfolio of commerce capabilities. Whether it's managing inventory, processing payments, tracking shipping, handling refunds, AI agents via MCP can tap into these capabilities to autonomously execute and optimize commerce workflows. This is a revolutionary development for commerce, and the best part is, developers can begin integrating with our MCP server on Cloudflare today." - Prakhar Mehrotra, SVP of Artificial Intelligence, PayPal</i></p><p>Learn more about PayPal’s MCP server <a href="https://developer.paypal.com/tools/mcp-server/"><u>here</u></a>. </p>
    <div>
      <h3>Sentry</h3>
      <a href="#sentry">
        
      </a>
    </div>
    <p>With the Sentry MCP server, developers are able to query Sentry’s context right from their IDE, or an assistant like Claude, to get errors and issue information across projects or even for individual files.</p><p>Developers can also use the MCP to create projects, capture setup information, and query project and organization information - and use the information to set up their applications for Sentry. As we continue to build out the MCP further, we'll allow teams to bring in root cause analysis and solution information from Seer, our Agent, and also look at simplifying instrumentation for sentry functionality like traces, and exception handling. </p><p>Hosting this on Cloudflare and using Remote MCP, we were able to sidestep a number of the complications of trying to run locally, like scaling or authentication. Remote MCP lets us leverage Sentry’s own OAuth configuration directly. Durable Object support also lets us maintain state within the MCP, which is important when you’re not running locally. </p><p><i>“Sentry’s commitment has always been to the developer, and making it easier to keep production software running stable, and that’s going to be even more true in the AI era. Developers are utilizing tools like MCP to integrate their stack with AI models and data sources. We chose to build our MCP on Cloudflare because we share a vision of making it easier for developers to ship software, and are both invested in ensuring teams can build and safely run the next generation of AI agents. Debugging the complex interactions arising from these integrations is increasingly vital, and Sentry provides the essential visibility needed to rapidly diagnose and resolve issues. MCP integrates this crucial Sentry context directly into the developer workflow, empowering teams to consistently build and deploy reliable applications.” — David Cramer, CPO and Co-Founder, Sentry</i></p><p>Learn more about Sentry’s MCP server <a href="https://docs.sentry.io/product/sentry-mcp/"><u>here</u></a>. </p>
    <div>
      <h3>Block </h3>
      <a href="#block">
        
      </a>
    </div>
    <p>Square's <a href="https://developer.squareup.com/us/en"><u>APIs</u></a> are a comprehensive set of tools that help sellers take payments, create and track orders, manage inventory, organize customers, and more. Now, with a dedicated Square MCP server, sellers can enlist the help of an AI agent to build their business on Square’s entire suite of API resources and endpoints. By integrating with AI agents like Claude and <a href="https://block.github.io/goose/"><u>codename goose</u></a>, sellers can craft sophisticated, customized use cases that fully utilize Square’s capabilities, at a lower technical barrier.</p><p>Learn more about Block’s MCP server <a href="https://developer.squareup.com/docs/mcp"><u>here</u></a>. </p>
    <div>
      <h3>Stripe</h3>
      <a href="#stripe">
        
      </a>
    </div>
    <p><i>“MCP is emerging as a new AI interface. In the near-future, MCP may become the default way, or in some cases the only way, people, businesses, and code discover and interact with services. With </i><a href="https://docs.stripe.com/agents"><i><u>Stripe's agent toolkit</u></i></a><i> and Cloudflare’s Agent SDK, developers can now monetize their MCPs with just a few lines of code.” — Jeff Weinstein, Product Lead at Stripe</i></p>
    <div>
      <h3>Webflow</h3>
      <a href="#webflow">
        
      </a>
    </div>
    <p>The Webflow MCP server supports CMS management, auditing and improving SEO, content localization, site publishing, and more. This enables users to manage and improve their site directly from their AI agent. </p><p><i>"We see MCP as a new way to interact with Webflow that aligns well with our mission of bringing development superpowers to everyone. MCP is not just a different surface over our APIs, instead we’re thinking of it in terms of the actions it supports: publish a website, create a CMS collection, update content, and more. MCP lets us expose those actions in a way that’s discoverable, secure, and deeply contextual. It opens the door to new workflows where AI and humans can work side-by-side, without needing to cobble together solutions or handle low-level API details. Cloudflare supports this aim by offering the reliability, performance, and developer tooling we need to build modern web infrastructure. Their support for remote MCP servers is mature and well-integrated, and their approach to authentication and durability aligns with how we think about the scale and security of these offerings.” — Utkarsh Sengar, VP of Engineering, Webflow</i></p><p>Learn more about Webflow’s MCP server <a href="https://mcp.webflow.com"><u>here</u></a>. </p>
    <div>
      <h2>Start building today </h2>
      <a href="#start-building-today">
        
      </a>
    </div>
    <p>If you’re looking to build a remote MCP server for your service, get started with our documentation, watch the tutorial below, or use the button below to get a starter remote MCP server deployed to production. Once the remote MCP server is deployed, it can be used from <a href="https://claude.ai/"><u>Claude</u></a>, Cloudflare’s <a href="https://playground.ai.cloudflare.com/"><u>AI playground</u></a>, or any remote MCP client. </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-authless"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p><code></code></p><p>In addition, we launched a <a href="https://youtu.be/Pjc8cC8zVRY"><u>new YouTube video</u></a> walking you through building MCP servers, using two of our MCP templates.</p><p>If you have any questions or feedback for us, you can reach us via email at <a><u>1800-mcp@cloudflare.com</u></a>. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6WNNRZBcgfCv5xVM3MNYwI/39ebfda250c4524ebce323511bffc72e/BLOG-2811_4.png" />
          </figure><p></p> ]]></content:encoded>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Agents]]></category>
            <category><![CDATA[MCP]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Developer Platform]]></category>
            <guid isPermaLink="false">6VjjFQfl3i9xgTfebvWEk4</guid>
            <dc:creator>Dina Kozlov</dc:creator>
        </item>
        <item>
            <title><![CDATA[Bringing streamable HTTP transport and Python language support to MCP servers]]></title>
            <link>https://blog.cloudflare.com/streamable-http-mcp-servers-python/</link>
            <pubDate>Wed, 30 Apr 2025 14:00:00 GMT</pubDate>
            <description><![CDATA[ We're continuing to make it easier for developers to bring their services into the AI ecosystem with the Model Context Protocol (MCP) with two new updates. ]]></description>
            <content:encoded><![CDATA[ <p>We’re <a href="https://blog.cloudflare.com/building-ai-agents-with-mcp-authn-authz-and-durable-objects/"><u>continuing</u></a> to make it easier for developers to <a href="https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/"><u>bring their services into the AI ecosystem</u></a> with the <a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/">Model Context Protocol</a> (MCP). Today, we’re announcing two new capabilities:</p><ul><li><p><b>Streamable HTTP Transport</b>: The <a href="https://agents.cloudflare.com/"><u>Agents SDK</u></a> now supports the <a href="https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#streamable-http"><u>new Streamable HTTP transport</u></a>, allowing you to future-proof your MCP server. <a href="https://developers.cloudflare.com/agents/model-context-protocol/transport/"><u>Our implementation</u></a> allows your MCP server to simultaneously handle both the new Streamable HTTP transport and the existing SSE transport, maintaining backward compatibility with all remote MCP clients.</p></li><li><p><b>Deploy MCP servers written in Python</b>: In 2024, we <a href="https://blog.cloudflare.com/python-workers/"><u>introduced first-class Python language support</u></a> in <a href="https://www.cloudflare.com/developer-platform/products/workers/">Cloudflare Workers</a>, and now you can build MCP servers on Cloudflare that are entirely written in Python.</p></li></ul><p>Click “Deploy to Cloudflare” to <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>get started</u></a> with a <a href="https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-authless"><u>remote MCP server</u></a> that supports the new Streamable HTTP transport method, with backwards compatibility with the SSE transport. </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-authless"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p>
    <div>
      <h3>Streamable HTTP: A simpler way for AI agents to communicate with services via MCP</h3>
      <a href="#streamable-http-a-simpler-way-for-ai-agents-to-communicate-with-services-via-mcp">
        
      </a>
    </div>
    <p><a href="https://spec.modelcontextprotocol.io/specification/2025-03-26/"><u>The MCP spec</u></a> was <a href="https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/transports/"><u>updated</u></a> on March 26 to introduce a new transport mechanism for remote MCP, called <a href="https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/transports/#streamable-http"><u>Streamable HTTP</u></a>. The new transport simplifies how <a href="https://www.cloudflare.com/learning/ai/what-is-agentic-ai/">AI agents</a> can interact with services by using a single HTTP endpoint for sending and receiving responses between the client and the server, replacing the need to implement separate endpoints for initializing the connection and for sending messages. </p>
    <div>
      <h4>Upgrading your MCP server to use the new transport method</h4>
      <a href="#upgrading-your-mcp-server-to-use-the-new-transport-method">
        
      </a>
    </div>
    <p>If you've already built a remote MCP server on Cloudflare using the Cloudflare Agents SDK, then <a href="https://developers.cloudflare.com/agents/model-context-protocol/transport/"><u>adding support for Streamable HTTP</u></a> is straightforward. The SDK has been updated to support both the existing Server-Sent Events (SSE) transport and the new Streamable HTTP transport concurrently. </p><p>Here's how you can configure your server to handle both transports:​</p>
            <pre><code>export default {
  fetch(request: Request, env: Env, ctx: ExecutionContext) {
    const { pathname }  = new URL(request.url);
    if (pathname.startsWith('/sse')) {
      return MyMcpAgent.serveSSE('/sse').fetch(request, env, ctx);
    }
    if (pathname.startsWith('/mcp')) {
      return MyMcpAgent.serve('/mcp').fetch(request, env, ctx);
    }
  },
};</code></pre>
            <p>Or, if you’re using Hono:</p>
            <pre><code>const app = new Hono()
app.mount('/sse', MyMCP.serveSSE('/sse').fetch, { replaceRequest: false })
app.mount('/mcp', MyMCP.serve('/mcp').fetch, { replaceRequest: false )
export default app</code></pre>
            <p>Or if your MCP server implements <a href="https://developers.cloudflare.com/agents/model-context-protocol/authorization/"><u>authentication &amp; authorization</u></a> using the Workers <a href="https://github.com/cloudflare/workers-oauth-provider"><u>OAuth Provider Library</u></a>: </p>
            <pre><code>export default new OAuthProvider({
 apiHandlers: {
   '/sse': MyMCP.serveSSE('/sse'),
   '/mcp': MyMCP.serve('/mcp'),
 },
 // ...
})</code></pre>
            <p>The key changes are: </p><ul><li><p>Use <code>MyMcpAgent.serveSSE('/sse')</code> for the existing SSE transport. Previously, this would have been <code>MyMcpAgent.mount('/sse')</code>, which has been kept as an alias.</p></li><li><p>Add a new path with <code>MyMcpAgent.serve('/mcp')</code> to support the new Streamable HTTP transport</p></li></ul><p>That's it! With these few lines of code, your MCP server will support both transport methods, making it compatible with both existing and new clients.</p>
    <div>
      <h4>Using Streamable HTTP from an MCP client</h4>
      <a href="#using-streamable-http-from-an-mcp-client">
        
      </a>
    </div>
    <p>While most MCP clients haven’t yet adopted the new Streamable HTTP transport, you can start testing it today using<a href="https://www.npmjs.com/package/mcp-remote"> mcp-remote</a>, an adapter that lets MCP clients like Claude Desktop that otherwise only support local connections work with remote MCP servers. This tool allows any MCP client to connect to remote MCP servers via either SSE or Streamable HTTP, even if the client doesn't natively support remote connections or the new transport method. </p>
    <div>
      <h4>So, what’s new with Streamable HTTP? </h4>
      <a href="#so-whats-new-with-streamable-http">
        
      </a>
    </div>
    <p>Initially, remote MCP communication between AI agents and services used a single connection but required interactions with two different endpoints: one endpoint (<code>/sse</code>) to establish a persistent Server-Sent Events (SSE) connection that the client keeps open for receiving responses and updates from the server, and another endpoint (<code>/sse/messages</code>) where the client sends requests for tool calls. </p><p>While this works, it's like having a conversation with two phones, one for listening and one for speaking. This adds complexity to the setup, makes it harder to scale, and requires connections to be kept open for long periods of time. This is because SSE operates as a persistent one-way channel where servers push updates to clients. If this connection closes prematurely, clients will miss responses or updates sent from the MCP server during long-running operations. </p><p>The new Streamable HTTP transport addresses these challenges by enabling: </p><ul><li><p><b>Communication through a single endpoint: </b>All MCP interactions now flow through one endpoint, eliminating the need to manage separate endpoints for requests and responses, reducing complexity.</p></li><li><p><b>Bi-directional communication: </b>Servers can send notifications and requests back to clients on the same connection, enabling the server to prompt for additional information or provide real-time updates. </p></li><li><p><b>Automatic connection upgrades: </b>Connections start as standard HTTP requests, but can dynamically upgrade to SSE (Server-Sent Events) to stream responses during long-running tasks.</p></li></ul><p>Now, when an AI agent wants to call a tool on a remote MCP server, it can do so with a single <code>POST</code> request to one endpoint (<code>/mcp</code>). Depending on the tool call, the server will either respond immediately or decide to upgrade the connection to use SSE to stream responses or notifications as they become available — all over the same request.</p><p>Our current implementation of Streamable HTTP provides feature parity with the previous SSE transport. We're actively working to implement the full capabilities defined in the specification, including <a href="https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#resumability-and-redelivery"><u>resumability</u></a>, cancellability, and <a href="https://modelcontextprotocol.io/specification/2025-03-26/basic/transports#session-management"><u>session management</u></a> to enable more complex, reliable, and scalable agent-to-agent interactions. </p>
    <div>
      <h4>What’s coming next? </h4>
      <a href="#whats-coming-next">
        
      </a>
    </div>
    <p>The <a href="https://modelcontextprotocol.io/specification/2025-03-26"><u>MCP specification</u></a> is rapidly evolving, and we're committed to bringing these changes to the Agents SDK to keep your MCP server compatible with all clients. We're actively tracking developments across both transport and authorization, adding support as they land, and maintaining backward compatibility to prevent breaking changes as adoption grows. Our goal is to handle the complexity behind the scenes, so you can stay focused on building great agent experiences.</p><p>On the transport side, here are some of the improvements coming soon to the Agents SDK:</p><ul><li><p><b>Resumability:</b> If a connection drops during a long-running operation, clients will be able to resume exactly where they left off without missing any responses. This eliminates the need to keep connections open continuously, making it ideal for AI agents that run for hours.</p></li><li><p><b>Cancellability</b>: Clients will have explicit mechanisms to cancel operations, enabling cleaner termination of long-running processes.</p></li><li><p><b>Session management</b>: We're implementing secure session handling with unique session IDs that maintain state across multiple connections, helping build more sophisticated agent-to-agent communication patterns.</p></li></ul>
    <div>
      <h3>Deploying Python MCP Servers on Cloudflare</h3>
      <a href="#deploying-python-mcp-servers-on-cloudflare">
        
      </a>
    </div>
    <p>In 2024, we <a href="https://blog.cloudflare.com/python-workers/"><u>introduced Python Workers</u></a>, which lets you write Cloudflare Workers entirely in Python. Now, you can use them to build and deploy remote MCP servers powered by the <a href="https://github.com/modelcontextprotocol/python-sdk"><u>Python MCP SDK</u></a> — a library for defining tools and resources using regular Python functions.</p><p>You can deploy a Python MCP server to your Cloudflare account with the button below, or read the code <a href="https://github.com/cloudflare/ai/tree/main/demos/python-workers-mcp"><u>here</u></a>. </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/python-workers-mcp"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>Here’s how you can define tools and resources in the MCP server:</p>
            <pre><code>class FastMCPServer(DurableObject):
    def __init__(self, ctx, env):
        self.ctx = ctx
        self.env = env
        from mcp.server.fastmcp import FastMCP
        self.mcp = FastMCP("Demo")

        @mcp.tool()
        def calculate_bmi(weight_kg: float, height_m: float) -&gt; float:
            """Calculate BMI given weight in kg and height in meters"""
            return weight_kg / (height_m**2)

        @mcp.resource("greeting://{name}")
        def get_greeting(name: str) -&gt; str:
            """Get a personalized greeting"""
            return f"Hello, {name}!"

        self.app = mcp.sse_app()

    async def call(self, request):
        import asgi
        return await asgi.fetch(self.app, request, self.env, self.ctx)



async def on_fetch(request, env):
    id = env.ns.idFromName("example")
    obj = env.ns.get(id)
    return await obj.call(request)</code></pre>
            <p>If you're already building APIs with<a href="https://fastapi.tiangolo.com/"> <u>FastAPI</u></a>, a popular Python package for quickly building high performance API servers, you can use <a href="https://github.com/cloudflare/ai/tree/main/packages/fastapi-mcp"><u>FastAPI-MCP</u></a> to expose your existing endpoints as MCP tools. It handles the protocol boilerplate for you, making it easy to bring FastAPI-based services into the agent ecosystem.</p><p>With recent updates like <a href="https://blog.cloudflare.com/python-workers/"><u>support for Durable Objects</u></a> and <a href="https://developers.cloudflare.com/changelog/2025-04-22-python-worker-cron-triggers/"><u>Cron Triggers in Python Workers</u></a>, it’s now easier to run stateful logic and scheduled tasks directly in your MCP server. </p>
    <div>
      <h3>Start building a remote MCP server today! </h3>
      <a href="#start-building-a-remote-mcp-server-today">
        
      </a>
    </div>
    <p>On Cloudflare, <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>you can start building today</u></a>. We’re ready for you, and ready to help build with you. Email us at <a><u>1800-mcp@cloudflare.com</u></a>, and we’ll help get you going. There’s lots more to come with MCP, and we’re excited to see what you build.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/77k853sJHhvZ1UQwrQWyy2/22264b8bda63bc40b6568f88ae99804c/image2.png" />
          </figure><p></p> ]]></content:encoded>
            <category><![CDATA[Phython]]></category>
            <category><![CDATA[MCP]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <category><![CDATA[Durable Objects]]></category>
            <guid isPermaLink="false">5BMzZem6hjKhNsSnI5l3BZ</guid>
            <dc:creator>Jeremy Morrell</dc:creator>
            <dc:creator>Dan Lapid</dc:creator>
        </item>
        <item>
            <title><![CDATA[Piecing together the Agent puzzle: MCP, authentication & authorization, and Durable Objects free tier]]></title>
            <link>https://blog.cloudflare.com/building-ai-agents-with-mcp-authn-authz-and-durable-objects/</link>
            <pubDate>Mon, 07 Apr 2025 13:10:00 GMT</pubDate>
            <description><![CDATA[ Cloudflare delivers toolkit for AI agents with new Agents SDK support for MCP (Model Context Protocol) clients, authentication/authorization/hibernation for MCP servers and Durable Objects free tier.  ]]></description>
            <content:encoded><![CDATA[ <p>It’s not a secret that at Cloudflare <a href="https://blog.cloudflare.com/build-ai-agents-on-cloudflare/"><u>we are bullish</u></a> on the future of <a href="https://www.cloudflare.com/learning/ai/what-is-agentic-ai/">agents</a>. We’re excited about a future where AI can not only co-pilot alongside us, but where we can actually start to delegate entire tasks to AI. </p><p>While it hasn’t been too long since we <a href="https://blog.cloudflare.com/build-ai-agents-on-cloudflare/"><u>first announced</u></a> our Agents SDK to make it easier for developers to build agents, building towards an agentic future requires continuous delivery towards this goal. Today, we’re making several announcements to help accelerate agentic development, including:</p><ul><li><p><b>New Agents SDK capabilities:</b> Build remote MCP clients, with transport and authentication built-in, to allow AI agents to connect to external services. </p></li><li><p><a href="https://developers.cloudflare.com/agents/model-context-protocol/authorization/#3-bring-your-own-oauth-provider"><b><u>BYO Auth provider for MCP</u></b></a><b>:</b> Integrations with <a href="https://stytch.com/"><u>Stytch</u></a>, <a href="https://auth0.com/"><u>Auth0</u></a>, and <a href="https://workos.com/"><u>WorkOS</u></a> to add authentication and authorization to your remote MCP server. </p></li><li><p><a href="https://developers.cloudflare.com/agents/model-context-protocol/mcp-agent-api/#hibernation-support"><b><u>Hibernation for McpAgent</u></b></a><b>:</b> Automatically sleep stateful, remote MCP servers when inactive and wake them when needed. This allows you to maintain connections for long-running sessions while ensuring you’re not paying for idle time. </p></li><li><p><a href="https://developers.cloudflare.com/changelog/2025-04-07-durable-objects-free-tier"><b><u>Durable Objects free tier</u></b></a><b>:</b> We view <a href="https://www.cloudflare.com/developer-platform/products/durable-objects/">Durable Objects</a> as a key component for building agents, and if you’re using our Agents SDK, you need access to it. Until today, Durable Objects was only accessible as part of our paid plans, and today we’re excited to include it in our free tier.</p></li><li><p><a href="https://blog.cloudflare.com/workflows-ga-production-ready-durable-execution"><b><u>Workflows GA</u></b></a><b>:</b> Enables you to ship production-ready, long-running, multi-step actions in agents.</p></li><li><p><a href="https://blog.cloudflare.com/introducing-autorag-on-cloudflare"><b><u>AutoRAG</u></b></a><b>:</b> Helps you <a href="https://www.cloudflare.com/learning/ai/how-to-build-rag-pipelines/">integrate context-aware AI</a> into your applications, in just a few clicks</p></li><li><p><a href="https://agents.cloudflare.com"><b><u>agents.cloudflare.com</u></b></a><b>:</b> our new landing page for all things agents.</p></li></ul>
    <div>
      <h2>New MCP capabilities in Agents SDK</h2>
      <a href="#new-mcp-capabilities-in-agents-sdk">
        
      </a>
    </div>
    <p>AI agents can now connect to and interact with external services through MCP (<a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/"><u>Model Context Protocol</u></a>). We’ve updated the Agents SDK to allow you to build a remote MCP client into your AI agent, with all the components — authentication flows, tool discovery, and connection management — built-in for you.</p><p>This allows you to build agents that can:</p><ol><li><p>Prompt the end user to grant access to a 3rd party service (MCP server).</p></li><li><p>Use tools from these external services, acting on behalf of the end user.</p></li><li><p>Call MCP servers from Workflows, scheduled tasks, or any part of your agent.</p></li><li><p>Connect to multiple MCP servers and automatically discover new tools or capabilities presented by the 3rd party service.</p></li></ol>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/X3RvQHewsVwJhq3TVOD0w/bbc5690d2d687f7a390f91474b3eb385/1.png" />
          </figure><p>MCP (Model Context Protocol) — <a href="https://www.anthropic.com/news/model-context-protocol"><u>first introduced by Anthropic</u></a> — is quickly becoming the standard way for AI agents to interact with external services, with providers like OpenAI, Cursor, and Copilot adopting the protocol.</p><p>We <a href="https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/"><u>recently announced</u></a> support for <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>building remote MCP servers</u></a> on Cloudflare, and added an <code>McpAgent</code> class to our Agents SDK that automatically handles the remote aspects of MCP: transport and authentication/authorization. Now, we’re excited to extend the same capabilities to agents acting as MCP clients.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/3nxl3bIRTbfRzpdLhHF720/41bea06c9e48b7d356d11a6f254b76ef/2.png" />
          </figure><p>Want to see it in action? Use the button below to deploy a fully remote MCP client that can be used to connect to remote MCP servers.</p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/mcp-client"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p>
    <div>
      <h2>AI Agents can now act as remote MCP clients, with transport and auth included</h2>
      <a href="#ai-agents-can-now-act-as-remote-mcp-clients-with-transport-and-auth-included">
        
      </a>
    </div>
    <p>AI agents need to connect to external services to access tools, data, and capabilities beyond their built-in knowledge. That means AI agents need to be able to act as remote MCP clients, so they can connect to remote MCP servers that are hosting these tools and capabilities. </p><p>We’ve added a new class, <code>MCPClientManager</code>, into the Agents SDK to give you all the tooling you need to allow your AI agent to make calls to external services via MCP. The <code>MCPClientManager</code> class automatically handles: </p><ul><li><p><b>Transport: </b>Connect to remote MCP servers over SSE and HTTP, with support for <a href="https://spec.modelcontextprotocol.io/specification/2025-03-26/basic/transports/#streamable-http"><u>Streamable HTTP</u></a> coming soon. </p></li><li><p><b>Connection management: </b>The client tracks the state of all connections and automatically reconnects if a connection is lost.</p></li><li><p><b>Capability discovery: </b>Automatically discovers all capabilities, tools, resources, and prompts presented by the MCP server.</p></li><li><p><b>Real-time updates</b>: When a server's tools, resources, or prompts change, the client automatically receives notifications and updates its internal state.</p></li><li><p><b>Namespacing: </b>When connecting to multiple MCP servers, all tools and resources are automatically namespaced to avoid conflicts.</p></li></ul>
    <div>
      <h3>Granting agents access to tools with built-in auth check for MCP Clients</h3>
      <a href="#granting-agents-access-to-tools-with-built-in-auth-check-for-mcp-clients">
        
      </a>
    </div>
    <p>We've integrated the complete OAuth authentication flow directly into the Agents SDK, so your AI agents can securely connect and authenticate to any remote MCP server without you having to build authentication flow from scratch.</p><p>This allows you to give users a secure way to log in and explicitly grant access to allow the agent to act on their behalf by automatically: </p><ul><li><p>Supporting the OAuth 2.1 protocol.</p></li><li><p>Redirecting users to the service’s login page.</p></li><li><p>Generating the code challenge and exchanging an authorization code for an access token.</p></li><li><p>Using the access token to make authenticated requests to the MCP server.</p></li></ul><p>Here is an example of an agent that can securely connect to MCP servers by initializing the client manager, adding the server, and handling the authentication callbacks:</p>
            <pre><code>async onStart(): Promise&lt;void&gt; {
  // initialize MCPClientManager which manages multiple MCP clients with optional auth
  this.mcp = new MCPClientManager("my-agent", "1.0.0", {
    baseCallbackUri: `${serverHost}/agents/${agentNamespace}/${this.name}/callback`,
    storage: this.ctx.storage,
  });
}

async addMcpServer(url: string): Promise&lt;string&gt; {
  // Add one MCP client to our MCPClientManager
  const { id, authUrl } = await this.mcp.connect(url);
  // Return authUrl to redirect the user to if the user is unauthorized
  return authUrl
}

async onRequest(req: Request): Promise&lt;void&gt; {
  // handle the auth callback after being finishing the MCP server auth flow
  if (this.mcp.isCallbackRequest(req)) {
    await this.mcp.handleCallbackRequest(req);
    return new Response("Authorized")
  }
  
  // ...
}</code></pre>
            <p>Connecting to multiple MCP servers and discovering what capabilities they offer</p><p>You can use the Agents SDK to connect an MCP client to multiple MCP servers simultaneously. This is particularly useful when you want your agent to access and interact with tools and resources served by different service providers. </p><p>The <code>MCPClientManager</code> class maintains connections to multiple MCP servers through the <code>mcpConnections</code> object, a dictionary that maps unique server names to their respective <code>MCPClientConnection</code> instances. </p><p>When you register a new server connection using <code>connect()</code>, the manager: </p><ol><li><p>Creates a new connection instance with server-specific authentication.</p></li><li><p>Initializes the connections and registers for server capability notifications.</p></li></ol>
            <pre><code>async onStart(): Promise&lt;void&gt; {
  // Connect to an image generation MCP server
  await this.mcp.connect("https://image-gen.example.com/mcp/sse");
  
  // Connect to a code analysis MCP server
  await this.mcp.connect("https://code-analysis.example.org/sse");
  
  // Now we can access tools with proper namespacing
  const allTools = this.mcp.listTools();
  console.log(`Total tools available: ${allTools.length}`);
}</code></pre>
            <p>Each connection manages its own authentication context, allowing one AI agent to authenticate to multiple servers simultaneously. In addition, <code>MCPClientManager</code> automatically handles namespacing to prevent collisions between tools with identical names from different servers. </p><p>For example, if both an “Image MCP Server” and “Code MCP Server” have a tool named “analyze”, they will both be independently callable without any naming conflicts.</p>
    <div>
      <h2>Use Stytch, Auth0, and WorkOS to bring authentication &amp; authorization to your MCP server </h2>
      <a href="#use-stytch-auth0-and-workos-to-bring-authentication-authorization-to-your-mcp-server">
        
      </a>
    </div>
    <p>With MCP, users will have a new way of interacting with your application, no longer relying on the dashboard or API as the entrypoint. Instead, the service will now be accessed by AI agents that are acting on a user’s behalf. To ensure users and agents can connect to your service securely, you’ll need to extend your existing authentication and authorization system to support these agentic interactions, implementing login flows, permissions scopes, consent forms, and access enforcement for your MCP server. </p><p>We’re adding integrations with <a href="https://stytch.com/"><u>Stytch</u></a>, <a href="https://auth0.com/"><u>Auth0</u></a>, and <a href="https://workos.com/"><u>WorkOS</u></a> to make it easier for anyone building an MCP server to configure authentication &amp; authorization for their MCP server. </p><p>You can leverage our MCP server integration with Stytch, Auth0, and WorkOS to: </p><ul><li><p>Allow users to authenticate to your MCP server through email, social logins, SSO (single sign-on), and MFA (multi-factor authentication).</p></li><li><p>Define scopes and permissions that directly map to your MCP tools.</p></li><li><p>Present users with a consent page corresponding with the requested permissions.</p></li></ul><p>Enforce the permissions so that agents can only invoke permitted tools. </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6oYchjMwoMxwYxsqq4PObk/381937e89c249b87c1930295b407faf6/3.png" />
          </figure><p>Get started with the examples below by using the “Deploy to Cloudflare” button to deploy the demo MCP servers in your Cloudflare account. These demos include pre-configured authentication endpoints, consent flows, and permission models that you can tailor to fit your needs. Once you deploy the demo MCP servers, you can use the <a href="https://playground.ai.cloudflare.com/"><u>Workers AI playground</u></a>, a browser-based remote MCP client, to test out the end-to-end user flow. </p>
    <div>
      <h3>Stytch</h3>
      <a href="#stytch">
        
      </a>
    </div>
    <p><a href="https://stytch.com/docs/guides/connected-apps/mcp-servers"><u>Get started</u></a> with a remote MCP server that uses Stytch to allow users to sign in with email, Google login or enterprise SSO and authorize their AI agent to view and manage their company’s OKRs on their behalf. Stytch will handle restricting the scopes granted to the AI agent based on the user’s role and permissions within their organization. When authorizing the MCP Client, each user will see a consent page that outlines the permissions that the agent is requesting that they are able to grant based on their role.</p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/mcp-stytch-b2b-okr-manager"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>For more consumer use cases, deploy a remote MCP server for a To Do app that uses Stytch for authentication and MCP client authorization. Users can sign in with email and immediately access the To Do lists associated with their account, and grant access to any AI assistant to help them manage their tasks.</p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/mcp-stytch-consumer-todo-list"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>Regardless of use case, Stytch allows you to easily turn your application into an OAuth 2.0 identity provider and make your remote MCP server into a Relying Party so that it can easily inherit identity and permissions from your app. To learn more about how Stytch is enabling secure authentication to remote MCP servers, read their <a href="http://stytch.com/blog/remote-mcp-stytch-cloudflare"><u>blog post</u></a>.</p><blockquote><p><i>“One of the challenges of realizing the promise of AI agents is enabling those agents to securely and reliably access data from other platforms. Stytch Connected Apps is purpose-built for these agentic use cases, making it simple to turn your app into an OAuth 2.0 identity provider to enable secure access to remote MCP servers. By combining Cloudflare Workers with Stytch Connected Apps, we're removing the barriers for developers, enabling them to rapidly transition from AI proofs-of-concept to secure, deployed implementations.” — Julianna Lamb, Co-Founder &amp; CTO, Stytch.</i></p></blockquote>
    <div>
      <h3>Auth0</h3>
      <a href="#auth0">
        
      </a>
    </div>
    <p>Get started with a remote MCP server that uses Auth0 to authenticate users through email, social logins, or enterprise SSO to interact with their todos and personal data through AI agents. The MCP server securely connects to API endpoints on behalf of users, showing exactly which resources the agent will be able to access once it gets consent from the user. In this implementation, access tokens are automatically refreshed during long running interactions.</p><p>To set it up, first deploy the protected API endpoint: </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-auth0/todos-api"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>Then, deploy the MCP server that handles authentication through Auth0 and securely connects AI agents to your API endpoint. </p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-auth0/mcp-auth0-oidc"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><blockquote><p><i>"Cloudflare continues to empower developers building AI products with tools like AI Gateway, Vectorize, and Workers AI. The recent addition of Remote MCP servers further demonstrates that Cloudflare Workers and Durable Objects are a leading platform for deploying serverless AI. We’re very proud that Auth0 can help solve the authentication and authorization needs for these cutting-edge workloads." — Sandrino Di Mattia, Auth0 Sr. Director, Product Architecture.</i></p></blockquote>
    <div>
      <h3>WorkOS</h3>
      <a href="#workos">
        
      </a>
    </div>
    <p>Get started with a remote MCP server that uses WorkOS's AuthKit to authenticate users and manage the permissions granted to AI agents. In this example, the MCP server dynamically exposes tools based on the user's role and access rights. All authenticated users get access to the <code>add</code> tool, but only users who have been assigned the <code>image_generation</code> permission in WorkOS can grant the AI agent access to the image generation tool. This showcases how MCP servers can conditionally expose capabilities to AI agents based on the authenticated user's role and permission.</p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-authkit"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><blockquote><p><i>“MCP is becoming the standard for AI agent integration, but authentication and authorization are still major gaps for enterprise adoption. WorkOS Connect enables any application to become an OAuth 2.0 authorization server, allowing agents and MCP clients to securely obtain tokens for fine-grained permission authorization and resource access. With Cloudflare Workers, developers can rapidly deploy remote MCP servers with built-in OAuth and enterprise-grade access control. Together, WorkOS and Cloudflare make it easy to ship secure, enterprise-ready agent infrastructure.” — Michael Grinich, CEO of WorkOS.</i></p></blockquote>
    <div>
      <h2>Hibernate-able WebSockets: put AI agents to sleep when they’re not in use</h2>
      <a href="#hibernate-able-websockets-put-ai-agents-to-sleep-when-theyre-not-in-use">
        
      </a>
    </div>
    <p>Starting today, a new improvement is landing in the McpAgent class: support for the <a href="https://developers.cloudflare.com/durable-objects/best-practices/websockets/#websocket-hibernation-api"><u>WebSockets Hibernation API</u></a> that allows your MCP server to go to sleep when it’s not receiving requests and instantly wake up when it’s needed. That means that you now only pay for compute when your agent is actually working.</p><p>We <a href="https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/"><u>recently introduced</u></a> the <a href="https://developers.cloudflare.com/agents/model-context-protocol/tools/?cf_history_state=%7B%22guid%22%3A%22C255D9FF78CD46CDA4F76812EA68C350%22%2C%22historyId%22%3A11%2C%22targetId%22%3A%22DF3E523E0077ACCB6730439891CDD7D4%22%7D"><u>McpAgent class</u></a>, which allows developers to build remote MCP servers on Cloudflare by using Durable Objects to maintain stateful connections for every client session. We decided to build McpAgent to be stateful from the start, allowing developers to build servers that can remember context, user preferences, and conversation history. But maintaining client connections means that the session can remain active for a long time, even when it’s not being used. </p>
    <div>
      <h3>MCP Agents are hibernate-able by default</h3>
      <a href="#mcp-agents-are-hibernate-able-by-default">
        
      </a>
    </div>
    <p>You don’t need to change your code to take advantage of hibernation. With our latest SDK update, all McpAgent instances automatically include hibernation support, allowing your stateful MCP servers to sleep during inactive periods and wake up with their state preserved when needed. </p>
    <div>
      <h3>How it works</h3>
      <a href="#how-it-works">
        
      </a>
    </div>
    <p>When a request comes in on the Server-Sent Events endpoint, /sse, the Worker initializes a WebSocket connection to the appropriate Durable Object for the session and returns an SSE stream back to the client. All responses flow over this stream.</p><p>The implementation leverages the WebSocket Hibernation API within Durable Objects. When periods of inactivity occur, the Durable Object can be evicted from memory while keeping the WebSocket connection open. If the WebSocket later receives a message, the runtime recreates the Durable Object and delivers the message to the appropriate handler.</p>
    <div>
      <h2>Durable Objects on free tier</h2>
      <a href="#durable-objects-on-free-tier">
        
      </a>
    </div>
    <p>To help you build AI agents on Cloudflare, we’re making <a href="http://developers.cloudflare.com/durable-objects/what-are-durable-objects/"><u>Durable Objects</u></a> available on the free tier, so you can start with zero commitment. With Agents SDK, your AI agents deploy to Cloudflare running on Durable Objects.</p><p>Durable Objects offer compute alongside durable storage, that when combined with <a href="https://www.cloudflare.com/developer-platform/products/workers/">Workers</a>, unlock stateful, serverless applications. Each Durable Object is a stateful coordinator for handling client real-time interactions, making requests to external services like LLMs, and creating agentic “memory” through state persistence in <a href="https://blog.cloudflare.com/sqlite-in-durable-objects/"><u>zero-latency SQLite storage</u></a> — all tasks required in an AI agent. Durable Objects scale out to millions of agents effortlessly, with each agent created near the user interacting with their agent for fast performance, all managed by Cloudflare. </p><p>Zero-latency SQLite storage in Durable Objects was <a href="https://blog.cloudflare.com/sqlite-in-durable-objects/"><u>introduced in public beta</u></a> September 2024 for Birthday Week. Since then, we’ve focused on missing features and robustness compared to pre-existing key-value storage in Durable Objects. We are excited to make SQLite storage generally available, with a 10 GB SQLite database per Durable Object, and recommend SQLite storage for all new Durable Object classes. Durable Objects free tier can only access SQLite storage.</p><p><a href="https://www.cloudflare.com/plans/free/">Cloudflare’s free tier</a> allows you to build real-world applications. On the free plan, every Worker request can call a Durable Object. For <a href="https://developers.cloudflare.com/durable-objects/platform/pricing/"><u>usage-based pricing</u></a>, Durable Objects incur compute and storage usage with the following free tier limits.</p><div>
    <figure>
        <table>
            <colgroup>
                <col></col>
                <col></col>
                <col></col>
            </colgroup>
            <tbody>
                <tr>
                    <td> </td>
                    <td>
                        <p><span><span><strong>Workers Free</strong></span></span></p>
                    </td>
                    <td>
                        <p><span><span><strong>Workers Paid</strong></span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Compute: Requests</span></span></p>
                    </td>
                    <td>
                        <p><span><span>100,000 / day</span></span></p>
                    </td>
                    <td>
                        <p><span><span>1 million / month included</span></span></p>
                        <p><span><span>+ $0.15 / million</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Compute: Duration</span></span></p>
                    </td>
                    <td>
                        <p><span><span>13,000 GB-s / day</span></span></p>
                    </td>
                    <td>
                        <p><span><span>400,000 GB-s / month  included </span></span></p>
                        <p><span><span>+ $12.50 / million GB-s</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Storage: Rows read</span></span></p>
                    </td>
                    <td>
                        <p><span><span>5 million / day</span></span></p>
                    </td>
                    <td>
                        <p><span><span>25 billion / month included</span></span></p>
                        <p><span><span>+ $0.001 / million </span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Storage: Rows written</span></span></p>
                    </td>
                    <td>
                        <p><span><span>100,000 / day</span></span></p>
                    </td>
                    <td>
                        <p><span><span>50 million / month included</span></span></p>
                        <p><span><span>+ $1.00 / million</span></span></p>
                    </td>
                </tr>
                <tr>
                    <td>
                        <p><span><span>Storage: SQL stored data</span></span></p>
                    </td>
                    <td>
                        <p><span><span>5 GB (total)</span></span></p>
                    </td>
                    <td>
                        <p><span><span>5 GB-month included</span></span></p>
                        <p><span><span>+ $0.20 / GB-month</span></span></p>
                    </td>
                </tr>
            </tbody>
        </table>
    </figure>
</div>
    <div>
      <h3>Find us at agents.cloudflare.com</h3>
      <a href="#find-us-at-agents-cloudflare-com">
        
      </a>
    </div>
    <p>We realize this is a lot of information to take in, but don’t worry. Whether you’re new to agents as a whole, or looking to learn more about how Cloudflare can help you build agents, today we launched a new site to help get you started — <a href="https://agents.cloudflare.com"><u>agents.cloudflare.com</u></a>. </p><p>Let us know what you build!</p> ]]></content:encoded>
            <category><![CDATA[Developer Week]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Agents]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[Model Context Protocol]]></category>
            <category><![CDATA[MCP]]></category>
            <guid isPermaLink="false">6lQQWDqELUkL4c1y13VL0V</guid>
            <dc:creator>Rita Kozlov</dc:creator>
            <dc:creator>Dina Kozlov</dc:creator>
            <dc:creator>Vy Ton</dc:creator>
        </item>
        <item>
            <title><![CDATA[Build and deploy Remote Model Context Protocol (MCP) servers to Cloudflare]]></title>
            <link>https://blog.cloudflare.com/remote-model-context-protocol-servers-mcp/</link>
            <pubDate>Tue, 25 Mar 2025 13:59:00 GMT</pubDate>
            <description><![CDATA[ You can now build and deploy remote MCP servers to Cloudflare, and we handle the hard parts of building remote MCP servers for you. ]]></description>
            <content:encoded><![CDATA[ <p>It feels like almost everyone building AI applications and <a href="https://www.cloudflare.com/learning/ai/what-is-agentic-ai/">agents</a> is talking about the <a href="https://www.cloudflare.com/learning/ai/what-is-model-context-protocol-mcp/">Model Context Protocol</a> (MCP), as well as building MCP servers that you install and run locally on your own computer.</p><p>You can now <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>build and deploy remote MCP servers</u></a> to Cloudflare. We’ve added four things to Cloudflare that handle the hard parts of building remote MCP servers for you:</p><ol><li><p><a href="https://developers.cloudflare.com/agents/model-context-protocol/authorization"><u>workers-oauth-provider</u></a> — an <a href="https://www.cloudflare.com/learning/access-management/what-is-oauth/"><u>OAuth</u></a> Provider that makes authorization easy</p></li><li><p><a href="https://developers.cloudflare.com/agents/model-context-protocol/tools/"><u>McpAgent</u></a> — a class built into the <a href="https://developers.cloudflare.com/agents/"><u>Cloudflare Agents SDK</u></a> that handles remote transport</p></li><li><p><a href="https://developers.cloudflare.com/agents/guides/test-remote-mcp-server/"><u>mcp-remote</u></a> — an adapter that lets MCP clients that otherwise only support local connections work with remote MCP servers</p></li><li><p><a href="https://playground.ai.cloudflare.com/"><u>AI playground as a remote MCP client</u></a> — a chat interface that allows you to connect to remote MCP servers, with the authentication check included</p></li></ol><p>The button below, or the <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>developer docs</u></a>, will get you up and running in production with <a href="https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-server"><u>this example MCP server</u></a> in less than two minutes:</p><a href="https://deploy.workers.cloudflare.com/?url=https://github.com/cloudflare/ai/tree/main/demos/remote-mcp-server"><img src="https://deploy.workers.cloudflare.com/button" /></a>
<p></p><p>Unlike the local MCP servers you may have previously used, remote MCP servers are accessible on the Internet. People simply sign in and grant permissions to MCP clients using familiar authorization flows. We think this is going to be a massive deal — connecting coding agents to MCP servers has blown developers’ minds over the past few months, and remote MCP servers have the same potential to open up similar new ways of working with LLMs and agents to a much wider audience, including more everyday consumer use cases.</p>
    <div>
      <h2>From local to remote — bringing MCP to the masses</h2>
      <a href="#from-local-to-remote-bringing-mcp-to-the-masses">
        
      </a>
    </div>
    <p>MCP is quickly becoming the common protocol that enables LLMs to go beyond <a href="https://www.cloudflare.com/learning/ai/inference-vs-training/"><u>inference</u></a> and <a href="https://developers.cloudflare.com/reference-architecture/diagrams/ai/ai-rag/"><u>RAG</u></a>, and take actions that require access beyond the AI application itself (like sending an email, deploying a code change, publishing blog posts, you name it). It enables AI agents (MCP clients) to access tools and resources from external services (MCP servers).</p><p>To date, MCP has been limited to running locally on your own machine — if you want to access a tool on the web using MCP, it’s up to you to set up the server locally. You haven’t been able to use MCP from web-based interfaces or mobile apps, and there hasn’t been a way to let people authenticate and grant the MCP client permission. Effectively, MCP servers haven’t yet been brought online.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/1EyiTXzB4FvBs2zEfzuNTp/5ce4b55457348e9ab83e6d9cf35d8c3c/image7.png" />
          </figure><p>Support for <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/transports/#streamable-http"><u>remote MCP connections</u></a> changes this. It creates the opportunity to reach a wider audience of Internet users who aren’t going to install and run MCP servers locally for use with desktop apps. Remote MCP support is like the transition from desktop software to web-based software. People expect to continue tasks across devices and to login and have things just work. Local MCP is great for developers, but remote MCP connections are the missing piece to reach everyone on the Internet.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/7bI7rJtLh89jmZaibSgiLl/e426f93616a8210d80b979c47d89dc75/image4.png" />
          </figure>
    <div>
      <h2>Making authentication and authorization just work with MCP</h2>
      <a href="#making-authentication-and-authorization-just-work-with-mcp">
        
      </a>
    </div>
    <p>Beyond just changing the transport layer — from <a href="https://modelcontextprotocol.io/docs/concepts/transports#standard-input%2Foutput-stdio"><u>stdio</u></a> to <a href="https://github.com/modelcontextprotocol/specification/pull/206"><u>streamable HTTP</u></a> — when you build a remote MCP server that uses information from the end user’s account, you need <a href="https://www.cloudflare.com/learning/access-management/authn-vs-authz/"><u>authentication and authorization</u></a>. You need a way to allow users to login and prove who they are (authentication) and a way for users to control what the AI agent will be able to access when using a service (authorization).</p><p>MCP does this with <a href="https://oauth.net/2/"><u>OAuth</u></a>, which has been the standard protocol that allows users to grant applications to access their information or services, without sharing passwords. Here, the MCP Server itself acts as the OAuth Provider. However, OAuth with MCP is hard to implement yourself, so when you build MCP servers on Cloudflare we provide it for you.</p>
    <div>
      <h3>workers-oauth-provider — an OAuth 2.1 Provider library for Cloudflare Workers</h3>
      <a href="#workers-oauth-provider-an-oauth-2-1-provider-library-for-cloudflare-workers">
        
      </a>
    </div>
    <p>When you <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>deploy an MCP Server</u></a> to Cloudflare, your Worker acts as an OAuth Provider, using <a href="https://github.com/cloudflare/workers-oauth-provider"><u>workers-oauth-provider</u></a>, a new TypeScript library that wraps your Worker’s code, adding authorization to API endpoints, including (but not limited to) MCP server API endpoints.</p><p>Your MCP server will receive the already-authenticated user details as a parameter. You don’t need to perform any checks of your own, or directly manage tokens. You can still fully control how you authenticate users: from what UI they see when they log in, to which provider they use to log in. You can choose to bring your own third-party authentication and authorization providers like Google or GitHub, or integrate with your own.</p><p>The complete <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/authorization/"><u>MCP OAuth flow</u></a> looks like this:</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/VTPBfZ4hRPdq2TWE5VOjS/00abc97e4beedf59a4101957612fd503/image5.png" />
          </figure><p>Here, your MCP server acts as both an OAuth client to your upstream service, <i>and</i> as an OAuth server (also referred to as an OAuth “provider”) to MCP clients. You can use any upstream authentication flow you want, but workers-oauth-provider guarantees that your MCP server is <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/authorization"><u>spec-compliant</u></a> and able to work with the full range of client apps &amp; websites. This includes support for Dynamic Client Registration (<a href="https://datatracker.ietf.org/doc/html/rfc7591"><u>RFC 7591</u></a>) and Authorization Server Metadata (<a href="https://datatracker.ietf.org/doc/html/rfc8414"><u>RFC 8414</u></a>).</p>
    <div>
      <h3>A simple, pluggable interface for OAuth</h3>
      <a href="#a-simple-pluggable-interface-for-oauth">
        
      </a>
    </div>
    <p>When you build an MCP server with Cloudflare Workers, you provide an instance of the OAuth Provider paths to your authorization, token, and client registration endpoints, along with <a href="https://developers.cloudflare.com/workers/runtime-apis/handlers/fetch/"><u>handlers</u></a> for your MCP Server, and for auth:</p>
            <pre><code>import OAuthProvider from "@cloudflare/workers-oauth-provider";
import MyMCPServer from "./my-mcp-server";
import MyAuthHandler from "./auth-handler";

export default new OAuthProvider({
  apiRoute: "/sse", // MCP clients connect to your server at this route
  apiHandler: MyMCPServer.mount('/sse'), // Your MCP Server implmentation
  defaultHandler: MyAuthHandler, // Your authentication implementation
  authorizeEndpoint: "/authorize",
  tokenEndpoint: "/token",
  clientRegistrationEndpoint: "/register",
});</code></pre>
            <p>This abstraction lets you easily plug in your own authentication. Take a look at <a href="https://github.com/cloudflare/ai/blob/main/demos/remote-mcp-github-oauth/src/github-handler.ts"><u>this example</u></a> that uses GitHub as the identity provider for an MCP server, in less than 100 lines of code, by implementing /callback and /authorize routes.</p>
    <div>
      <h3>Why do MCP servers issue their own tokens?</h3>
      <a href="#why-do-mcp-servers-issue-their-own-tokens">
        
      </a>
    </div>
    <p>You may have noticed in the authorization diagram above, and in the <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/authorization"><u>authorization section</u></a> of the MCP spec, that the MCP server issues its own token to the MCP client.</p><p>Instead of passing the token it receives from the upstream provider directly to the MCP client, your Worker stores an encrypted access token in <a href="https://developers.cloudflare.com/kv/"><u>Workers KV</u></a>. It then issues its own token to the client. As shown in the <a href="https://github.com/cloudflare/ai/blob/main/demos/remote-mcp-github-oauth/src/github-handler.ts"><u>GitHub example</u></a> above, this is handled on your behalf by the workers-oauth-provider — your code never directly handles writing this token, preventing mistakes. You can see this in the following code snippet from the <a href="https://github.com/cloudflare/ai/blob/main/demos/remote-mcp-github-oauth/src/github-handler.ts"><u>GitHub example</u></a> above:</p>
            <pre><code>  // When you call completeAuthorization, the accessToken you pass to it
  // is encrypted and stored, and never exposed to the MCP client
  // A new, separate token is generated and provided to the client at the /token endpoint
  const { redirectTo } = await c.env.OAUTH_PROVIDER.completeAuthorization({
    request: oauthReqInfo,
    userId: login,
    metadata: { label: name },
    scope: oauthReqInfo.scope,
    props: {
      accessToken,  // Stored encrypted, never sent to MCP client
    },
  })

  return Response.redirect(redirectTo)</code></pre>
            <p>On the surface, this indirection might sound more complicated. Why does it work this way?</p><p>By issuing its own token, MCP Servers can restrict access and enforce more granular controls than the upstream provider. If a token you issue to an MCP client is compromised, the attacker only gets the limited permissions you've explicitly granted through your MCP tools, not the full access of the original token.</p><p>Let’s say your MCP server requests that the user authorize permission to read emails from their Gmail account, using the <a href="https://developers.google.com/identity/protocols/oauth2/scopes#gmail"><u>gmail.readonly scope</u></a>. The tool that the MCP server exposes is more narrow, and allows reading travel booking notifications from a limited set of senders, to handle a question like “What’s the check-out time for my hotel room tomorrow?” You can enforce this constraint in your MCP server, and if the token you issue to the MCP client is compromised, because the token is to your MCP server — and not the raw token to the upstream provider (Google) — an attacker cannot use it to read arbitrary emails. They can only call the tools your MCP server provides. OWASP calls out <a href="https://genai.owasp.org/llmrisk/llm062025-excessive-agency/"><u>“Excessive Agency”</u></a> as one of the top risk factors for building AI applications, and by issuing its own token to the client and enforcing constraints, your MCP server can limit tools access to only what the client needs.</p><p>Or building off the earlier GitHub example, you can enforce that only a specific user is allowed to access a particular tool. In the example below, only users that are part of an allowlist can see or call the generateImage tool, that uses <a href="https://developers.cloudflare.com/workers-ai/"><u>Workers AI</u></a> to generate an image based on a prompt:</p>
            <pre><code>import { McpAgent } from "agents/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

const USER_ALLOWLIST = ["geelen"];

export class MyMCP extends McpAgent&lt;Props, Env&gt; {
  server = new McpServer({
    name: "Github OAuth Proxy Demo",
    version: "1.0.0",
  });

  async init() {
    // Dynamically add tools based on the user's identity
    if (USER_ALLOWLIST.has(this.props.login)) {
      this.server.tool(
        'generateImage',
        'Generate an image using the flux-1-schnell model.',
        {
          prompt: z.string().describe('A text description of the image you want to generate.')
        },
        async ({ prompt }) =&gt; {
          const response = await this.env.AI.run('@cf/black-forest-labs/flux-1-schnell', { 
            prompt, 
            steps: 8 
          })
          return {
            content: [{ type: 'image', data: response.image!, mimeType: 'image/jpeg' }],
          }
        }
      )
    }
  }
}
</code></pre>
            
    <div>
      <h2>Introducing McpAgent: remote transport support that works today, and will work with the revision to the MCP spec</h2>
      <a href="#introducing-mcpagent-remote-transport-support-that-works-today-and-will-work-with-the-revision-to-the-mcp-spec">
        
      </a>
    </div>
    <p>The next step to opening up MCP beyond your local machine is to open up a remote transport layer for communication. MCP servers you run on your local machine just communicate over <a href="https://modelcontextprotocol.io/docs/concepts/transports#standard-input%2Foutput-stdio"><u>stdio</u></a>, but for an MCP server to be callable over the Internet, it must implement <a href="https://spec.modelcontextprotocol.io/specification/draft/basic/transports/#http-with-sse"><u>remote transport</u></a>.</p><p>The <a href="https://github.com/cloudflare/agents/blob/2f82f51784f4e27292249747b5fbeeef94305552/packages/agents/src/mcp.ts"><u>McpAgent</u></a> class we introduced today as part of our <a href="https://github.com/cloudflare/agents"><u>Agents SDK</u></a> handles this for you, using <a href="https://developers.cloudflare.com/durable-objects/"><u>Durable Objects</u></a> behind the scenes to hold a persistent connection open, so that the MCP client can send <a href="https://modelcontextprotocol.io/docs/concepts/transports#server-sent-events-sse"><u>server-sent events (SSE)</u></a> to your MCP server. You don’t have to write code to deal with transport or serialization yourself. A minimal MCP server in 15 lines of code can look like this:</p>
            <pre><code>import { McpAgent } from "agents/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

export class MyMCP extends McpAgent {
  server = new McpServer({
    name: "Demo",
    version: "1.0.0",
  });
  async init() {
    this.server.tool("add", { a: z.number(), b: z.number() }, async ({ a, b }) =&gt; ({
      content: [{ type: "text", text: String(a + b) }],
    }));
  }
}</code></pre>
            <p>After much <a href="https://github.com/modelcontextprotocol/specification/discussions/102"><u>discussion</u></a>, remote transport in the MCP spec is changing, with <a href="https://github.com/modelcontextprotocol/specification/pull/206"><u>Streamable HTTP replacing HTTP+SSE</u></a> This allows for stateless, pure HTTP connections to MCP servers, with an option to upgrade to SSE, and removes the need for the MCP client to send messages to a separate endpoint than the one it first connects to. The McpAgent class will change with it and just work with streamable HTTP, so that you don’t have to start over to support the revision to how transport works.</p><p>This applies to future iterations of transport as well. Today, the vast majority of MCP servers only expose tools, which are simple <a href="https://en.wikipedia.org/wiki/Remote_procedure_call"><u>remote procedure call (RPC)</u></a> methods that can be provided by a stateless transport. But more complex human-in-the-loop and agent-to-agent interactions will need <a href="https://modelcontextprotocol.io/docs/concepts/prompts"><u>prompts</u></a> and <a href="https://modelcontextprotocol.io/docs/concepts/sampling"><u>sampling</u></a>. We expect these types of chatty, two-way interactions will need to be real-time, which will be challenging to do well without a bidirectional transport layer. When that time comes, Cloudflare, the <a href="https://developers.cloudflare.com/agents/"><u>Agents SDK</u></a>, and Durable Objects all natively support <a href="https://developers.cloudflare.com/durable-objects/best-practices/websockets/"><u>WebSockets</u></a>, which enable full-duplex, bidirectional real-time communication. </p>
    <div>
      <h2>Stateful, agentic MCP servers</h2>
      <a href="#stateful-agentic-mcp-servers">
        
      </a>
    </div>
    <p>When you build MCP servers on Cloudflare, each MCP client session is backed by a Durable Object, via the <a href="https://developers.cloudflare.com/agents/"><u>Agents SDK</u></a>. This means each session can manage and persist its own state, <a href="https://developers.cloudflare.com/agents/api-reference/store-and-sync-state/"><u>backed by its own SQL database</u></a>.</p><p>This opens the door to building stateful MCP servers. Rather than just acting as a stateless layer between a client app and an external API, MCP servers on Cloudflare can themselves be stateful applications — games, a shopping cart plus checkout flow, a <a href="https://github.com/modelcontextprotocol/servers/tree/main/src/memory"><u>persistent knowledge graph</u></a>, or anything else you can dream up. When you build on Cloudflare, MCP servers can be much more than a layer in front of your REST API.</p><p>To understand the basics of how this works, let’s look at a minimal example that increments a counter:</p>
            <pre><code>import { McpAgent } from "agents/mcp";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { z } from "zod";

type State = { counter: number }

export class MyMCP extends McpAgent&lt;Env, State, {}&gt; {
  server = new McpServer({
    name: "Demo",
    version: "1.0.0",
  });

  initialState: State = {
    counter: 1,
  }

  async init() {
    this.server.resource(`counter`, `mcp://resource/counter`, (uri) =&gt; {
      return {
        contents: [{ uri: uri.href, text: String(this.state.counter) }],
      }
    })

    this.server.tool('add', 'Add to the counter, stored in the MCP', { a: z.number() }, async ({ a }) =&gt; {
      this.setState({ ...this.state, counter: this.state.counter + a })

      return {
        content: [{ type: 'text', text: String(`Added ${a}, total is now ${this.state.counter}`) }],
      }
    })
  }

  onStateUpdate(state: State) {
    console.log({ stateUpdate: state })
  }

}</code></pre>
            <p>For a given session, the MCP server above will remember the state of the counter across tool calls.</p><p>From within an MCP server, you can use Cloudflare’s whole developer platform, and have your MCP server <a href="https://developers.cloudflare.com/agents/api-reference/browse-the-web/"><u>spin up its own web browser</u></a>, <a href="https://developers.cloudflare.com/agents/api-reference/run-workflows/"><u>trigger a Workflow</u></a>, <a href="https://developers.cloudflare.com/agents/api-reference/using-ai-models/"><u>call AI models</u></a>, and more. We’re excited to see the MCP ecosystem evolve into more advanced use cases.</p>
    <div>
      <h2>Connect to remote MCP servers from MCP clients that today only support local MCP</h2>
      <a href="#connect-to-remote-mcp-servers-from-mcp-clients-that-today-only-support-local-mcp">
        
      </a>
    </div>
    <p>Cloudflare is supporting remote MCP early — before the most prominent MCP client applications support remote, authenticated MCP, and before other platforms support remote MCP. We’re doing this to give you a head start building for where MCP is headed.</p><p>But if you build a remote MCP server today, this presents a challenge — how can people start using your MCP server if there aren’t MCP clients that support remote MCP?</p><p>We have two new tools that allow you to test your remote MCP server and simulate how users will interact with it in the future:</p><p>We updated the <a href="https://playground.ai.cloudflare.com/"><u>Workers AI Playground</u></a> to be a fully remote MCP client that allows you to connect to any remote MCP server with built-in authentication support. This online chat interface lets you immediately test your remote MCP servers without having to install anything on your device. Instead, just enter the remote MCP server’s URL (e.g. https://remote-server.example.com/sse) and click Connect.</p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/4N64nJHJiQygmMdSK7clIs/c0bf8c64f1607674f81be10c3871a64b/image1.png" />
          </figure><p>Once you click Connect, you’ll go through the authentication flow (if you set one up) and after, you will be able to interact with the MCP server tools directly from the chat interface.</p><p>If you prefer to use a client like Claude Desktop or Cursor that already supports MCP but doesn’t yet handle remote connections with authentication, you can use <a href="https://www.npmjs.com/package/mcp-remote"><u>mcp-remote</u></a>. mcp-remote is an adapter that  lets MCP clients that otherwise only support local connections to work with remote MCP servers. This gives you and your users the ability to preview what interactions with your remote MCP server will be like from the tools you’re already using today, without having to wait for the client to support remote MCP natively. </p><p>We’ve <a href="https://developers.cloudflare.com/agents/guides/test-remote-mcp-server/"><u>published a guide</u></a> on how to use mcp-remote with popular MCP clients including Claude Desktop, Cursor, and Windsurf. In Claude Desktop, you add the following to your configuration file:</p>
            <pre><code>{
  "mcpServers": {
    "remote-example": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://remote-server.example.com/sse"
      ]
    }
  }
}</code></pre>
            
    <div>
      <h2>1800-mcp@cloudflare.com — start building remote MCP servers today</h2>
      <a href="#1800-mcp-cloudflare-com-start-building-remote-mcp-servers-today">
        
      </a>
    </div>
    <p>Remote Model Context Protocol (MCP) is coming! When client apps support remote MCP servers, the audience of people who can use them opens up from just us, developers, to the rest of the population — who may never even know what MCP is or stands for. </p><p>Building a remote MCP server is the way to bring your service into the AI assistants and tools that millions of people use. We’re excited to see many of the biggest companies on the Internet are busy building MCP servers right now, and we are curious about the businesses that pop-up in an agent-first, MCP-native way.</p><p>On Cloudflare, <a href="https://developers.cloudflare.com/agents/guides/remote-mcp-server/"><u>you can start building today</u></a>. We’re ready for you, and ready to help build with you. Email us at <a><u>1800-mcp@cloudflare.com</u></a>, and we’ll help get you going. There’s lots more to come with MCP, and we’re excited to see what you build.</p> ]]></content:encoded>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Developers]]></category>
            <category><![CDATA[MCP]]></category>
            <category><![CDATA[Agents]]></category>
            <guid isPermaLink="false">4e3J8mxEIN24iNKfw9ToEH</guid>
            <dc:creator>Brendan Irvine-Broque</dc:creator>
            <dc:creator>Dina Kozlov</dc:creator>
            <dc:creator>Glen Maddern</dc:creator>
        </item>
        <item>
            <title><![CDATA[Hi Claude, build an MCP server on Cloudflare Workers]]></title>
            <link>https://blog.cloudflare.com/model-context-protocol/</link>
            <pubDate>Fri, 20 Dec 2024 14:50:00 GMT</pubDate>
            <description><![CDATA[ Want Claude to interact with your app directly? Build an MCP server on Cloudflare Workers, enabling you to connect your service directly, allowing Claude to understand and run tasks on your behalf. ]]></description>
            <content:encoded><![CDATA[ <p>In late November 2024, Anthropic <a href="https://www.anthropic.com/news/model-context-protocol"><u>announced</u></a> a new way to interact with AI, called Model Context Protocol (MCP). Today, we’re excited to show you how to use MCP in combination with Cloudflare to extend the capabilities of Claude to build applications, generate images and more. You’ll learn how to build an MCP server on Cloudflare to make any service accessible through an AI assistant like Claude with just a few lines of code using Cloudflare Workers. </p>
    <div>
      <h2>A quick primer on the Model Context Protocol (MCP)</h2>
      <a href="#a-quick-primer-on-the-model-context-protocol-mcp">
        
      </a>
    </div>
    <p>MCP is an open standard that provides a universal way for LLMs to interact with services and applications. As the introduction on the <a href="https://modelcontextprotocol.io/introduction"><u>MCP website</u></a> puts it, </p><blockquote><p><i>“Think of MCP like a USB-C port for AI applications. Just as USB-C provides a standardized way to connect your devices to various peripherals and accessories, MCP provides a standardized way to connect AI models to different data sources and tools.”</i> </p></blockquote><p>From an architectural perspective, MCP is comprised of several components:</p><ul><li><p><b>MCP hosts</b>: Programs or tools (like Claude) where AI models operate and interact with different services</p></li><li><p><b>MCP clients</b>: Client within an AI assistant that initiates requests and communicates with MCP servers to perform tasks or access resources</p></li><li><p><b>MCP servers</b>: Lightweight programs that each expose the capabilities of a service</p></li><li><p><b>Local data sources</b>: Files, databases, and services on your computer that MCP servers can securely access</p></li><li><p><b>Remote services</b>: External Internet-connected systems that MCP servers can connect to through APIs</p></li></ul><p>Imagine you ask Claude to send a message in a Slack channel. Before Claude can do this, Slack must communicate which tools are available. It does this by defining tools — such as “list channels”, “post messages”, and “reply to thread” — in the MCP server. Once the MCP client knows what tools it should invoke, it can complete the task. All you have to do is tell it what you need, and it will get it done. </p>
    <div>
      <h2>Allowing AI to not just generate, but deploy applications for you</h2>
      <a href="#allowing-ai-to-not-just-generate-but-deploy-applications-for-you">
        
      </a>
    </div>
    <p>What makes MCP so powerful? As a quick example, by combining it with a platform like Cloudflare Workers, it allows Claude users to deploy a Cloudflare Worker in just one sentence, resulting in a site like <a href="https://joke-site.dinas.workers.dev/"><u>this</u></a>: </p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/6JNebermBM0YNwpxqoMTj2/65224c915a3d12c4f8d11a4228855bf7/image1.png" />
          </figure>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/2KImc4ydvEzg8Rf0I0KRkQ/b87b4cca33df242eeabcae9e237e9fb5/image3.png" />
          </figure><p>But that’s just one example. Today, we’re excited to show you how you can build and deploy your own MCP server to allow your users to interact with your application directly from an LLM like Claude, and how you can do that just by writing a Cloudflare Worker.</p>
    <div>
      <h2>Simplifying your MCP Server deployment with workers-mcp</h2>
      <a href="#simplifying-your-mcp-server-deployment-with-workers-mcp">
        
      </a>
    </div>
    <p>The new <a href="https://github.com/cloudflare/workers-mcp"><u>workers-mcp</u></a> tooling handles the translation between your code and the MCP standard, so that you don’t have to do the maintenance work to get it set up.</p><p>Once you create your Worker and install the MCP tooling, you’ll get a worker-mcp template set up for you. This boilerplate removes the overhead of configuring the MCP server yourself:</p>
            <pre><code>import { WorkerEntrypoint } from 'cloudflare:workers'
import { ProxyToSelf } from 'workers-mcp'
export default class MyWorker extends WorkerEntrypoint&lt;Env&gt; {
  /**
   * A warm, friendly greeting from your new Workers MCP server.
   * @param name {string} the name of the person we are greeting.
   * @return {string} the contents of our greeting.
   */
  sayHello(name: string) {
    return `Hello from an MCP Worker, ${name}!`
  }
  /**
   * @ignore
   **/
  async fetch(request: Request): Promise&lt;Response&gt; {
    return new ProxyToSelf(this).fetch(request)
  }
}</code></pre>
            <p>Let’s unpack what’s happening here. This provides a direct link to MCP. The ProxyToSelf logic ensures that your Worker is wired up to respond as an MCP server, without any complex routing or schema definitions. </p><p>It also provides tool definition with <a href="https://jsdoc.app/"><u>JSDoc</u></a>. You’ll notice that the `sayHello` method is annotated with JSDoc comments describing what it does, what arguments it takes, and what it returns. These comments aren’t just for human readers, but they’re also used to generate documentation that your AI assistant (Claude) can understand. </p>
    <div>
      <h2>Adding image generation to Claude</h2>
      <a href="#adding-image-generation-to-claude">
        
      </a>
    </div>
    <p>When you build an MCP server using Workers, adding custom functionality to an LLM is easy. Instead of setting up the server infrastructure, defining request schemas, all you have to do is write the code. Above, all we did was generate a “hello world”, but now let’s power up Claude to generate an image, using Workers AI:</p>
            <pre><code>import { WorkerEntrypoint } from 'cloudflare:workers'
import { ProxyToSelf } from 'workers-mcp'

export default class ClaudeImagegen extends WorkerEntrypoint&lt;Env&gt; {
 /**
   * Generate an image using the flux-1-schnell model.
   * @param prompt {string} A text description of the image you want to generate.
   * @param steps {number} The number of diffusion steps; higher values can improve quality but take longer.
   */
  async generateImage(prompt: string, steps: number): Promise&lt;string&gt; {
    const response = await this.env.AI.run('@cf/black-forest-labs/flux-1-schnell', {
      prompt,
      steps,
    });
        // Convert from base64 string
        const binaryString = atob(response.image);
        // Create byte representation
        const img = Uint8Array.from(binaryString, (m) =&gt; m.codePointAt(0)!);
        
        return new Response(img, {
          headers: {
            'Content-Type': 'image/jpeg',
          },
        });
      }
  /**
   * @ignore
   */
  async fetch(request: Request): Promise&lt;Response&gt; {
    return new ProxyToSelf(this).fetch(request)
  }
}</code></pre>
            <p>Once you update the code and redeploy the Worker, Claude will now be able to use the new image generation tool. All you have to say is: <i>“Hey! Can you create an image of a lava lamp wall that lives in San Francisco?”</i></p>
          <figure>
          <img src="https://cf-assets.www.cloudflare.com/zkvhlag99gkb/Izb6iVs8xPNSOnATJfK9D/9942ddc7b8787cfb1c2f7f3b9959be0b/image2.png" />
          </figure><p>If you’re looking for some inspiration, here are a few examples of what you can build with MCP and Workers: </p><ul><li><p>Let Claude send follow-up emails on your behalf using <a href="https://developers.cloudflare.com/email-routing/"><u>Email Routing</u></a></p></li><li><p>Ask Claude to capture and share website previews via <a href="https://developers.cloudflare.com/browser-rendering/"><u>Browser Automation</u></a></p></li><li><p>Store and manage sessions, user data, or other persistent information with <a href="https://developers.cloudflare.com/durable-objects/"><u>Durable Objects</u></a></p></li><li><p>Query and update data from your <a href="https://developers.cloudflare.com/d1/"><u>D1</u></a> database </p></li><li><p>…or call any of your existing Workers directly!</p></li></ul>
    <div>
      <h2>Why use Workers for building your MCP server?</h2>
      <a href="#why-use-workers-for-building-your-mcp-server">
        
      </a>
    </div>
    <p>To build out an MCP server without access to Cloudflare’s tooling, you would have to: initialize an instance of the server, define your APIs by creating explicit schemas for every interaction, handle request routing, ensure that the responses are formatted correctly, write handlers for every action, configure how the server will communicate, and more… As shown above, we do all of this for you.</p><p>For reference, an <a href="https://github.com/modelcontextprotocol/typescript-sdk?tab=readme-ov-file#creating-a-server"><u>implementation</u></a> may look something like this:</p>
            <pre><code>import { Server } from "@modelcontextprotocol/sdk/server/index.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";

const server = new Server({ name: "example-server", version: "1.0.0" }, {
  capabilities: { resources: {} }
});

server.setRequestHandler(ListResourcesRequestSchema, async () =&gt; {
  return {
    resources: [{ uri: "file:///example.txt", name: "Example Resource" }]
  };
});

server.setRequestHandler(ReadResourceRequestSchema, async (request) =&gt; {
  if (request.params.uri === "file:///example.txt") {
    return {
      contents: [{
        uri: "file:///example.txt",
        mimeType: "text/plain",
        text: "This is the content of the example resource."
      }]
    };
  }
  throw new Error("Resource not found");
});

const transport = new StdioServerTransport();
await server.connect(transport);</code></pre>
            <p>While this works, it requires quite a bit of code just to get started. Not only do you need to be familiar with the MCP protocol, but you need to complete a fair amount of set up work (e.g. defining schemas) for every action. Doing it through Workers removes all these barriers, allowing you to spin up an MCP server without the complexity.</p><p>We’re always looking for ways to simplify developer workflows, and we’re excited about this new standard to open up more possibilities for interacting with LLMs, and building agents.</p><div>
  
</div><p>If you’re interested in setting this up, check out this <a href="https://www.youtube.com/watch?v=cbeOWKANtj8&amp;feature=youtu.be"><u>tutorial</u></a> which walks you through these examples. We’re excited to see what you build. Be sure to share your MCP server creations with us on <a href="https://discord.com/invite/cloudflaredev"><u>Discord</u></a>, <a href="https://x.com/CloudflareDev"><u>X</u></a>, or <a href="https://bsky.app/profile/cloudflare.social"><u>Bluesky</u></a>!</p> ]]></content:encoded>
            <category><![CDATA[MCP]]></category>
            <category><![CDATA[AI]]></category>
            <category><![CDATA[Cloudflare Workers]]></category>
            <guid isPermaLink="false">aWV4m3ZRWKcTPXMFuhumH</guid>
            <dc:creator>Dina Kozlov</dc:creator>
            <dc:creator>Glen Maddern</dc:creator>
        </item>
    </channel>
</rss>