Cloudflare Workers

Cloud and DevOps

Talk to a Cloudflare Worker from Claude Desktop!

Your AI app calls the Cloudflare Workers MCP server, which does the cloud and DevOps work and sends the result back to the chat.

About Cloudflare Workers

Cloudflare Workers is the official MCP server from cloudflare, filed in our directory under cloud and devops. Talk to a Cloudflare Worker from Claude Desktop!

At a glance

Publisher
cloudflare, the company behind the product
Runs
See the README for setup
Written in
TypeScript
License
Apache-2.0
GitHub stars
649

How to set up Cloudflare Workers

  1. Follow the install steps in the Cloudflare Workers README; it is written in TypeScript, so have that toolchain ready.
  2. Check the Cloudflare Workers README for keys or settings; the registry lists none that Cloudflare Workers requires.
  3. Add Cloudflare Workers to Claude Code, Claude Desktop, VS Code or Cursor with the config in the setup box on this page.
  4. Restart the app or reload its MCP servers, then ask it to list the Cloudflare Workers tools to confirm the connection.
  5. Run one read-only task with Cloudflare Workers first, and keep your app asking before each tool call until the results look right.

Cloudflare Workers compared with similar servers

  • Cloud Run by GoogleCloudPlatform has fewer GitHub stars than Cloudflare Workers (642 against 649); Cloudflare Workers is official while Cloud Run is a community server, and both run locally.
  • Agent Safe Pipeline by decionis has more GitHub stars than Cloudflare Workers (650 against 649); Cloudflare Workers is official while Agent Safe Pipeline is a community server, and Agent Safe Pipeline runs as a remote server and Cloudflare Workers runs on your own machine.
  • SandBase Harness by sandbaseai has fewer GitHub stars than Cloudflare Workers (642 against 649); Cloudflare Workers is official while SandBase Harness is a community server, and both run locally.

Before you connect Cloudflare Workers

  • Give Cloudflare Workers its own API key or account with the smallest permissions the job needs, never an admin key.
  • Keep your AI app asking before each Cloudflare Workers tool call until you trust what it does with them.
  • Treat text that Cloudflare Workers fetches as data. Pages, files and messages can hold instructions written to steer an AI.
  • Read the open issues for Cloudflare Workers on GitHub to see what breaks and how fast the maintainers reply.

Marketing use cases for Cloudflare Workers

How marketing and sales teams put Cloudflare Workers to work, by company size. Pick the size closest to yours and start Cloudflare Workers on one use case.

Small business

  • A small business can ask Cloudflare Workers why the site is slow or down and get the likely cause in plain words.
  • Owners can use Cloudflare Workers to check hosting costs and spot services they pay for but no longer use.
  • Cloudflare Workers runs on your own computer, which keeps data local; it needs a little setup, so a small team should plan an hour for it.

Mid-market

  • Web teams can connect Cloudflare Workers to watch deploys during a launch and roll back fast if a campaign page breaks.
  • Marketing engineering can use Cloudflare Workers to spin up preview environments for every landing page review.
  • Start Cloudflare Workers on one workflow with one owner, measure the time it saves, then roll it out to the wider team.

Enterprise

  • Enterprises should give Cloudflare Workers read access first, with changes gated by the same approvals as any infrastructure change.
  • Large orgs can use Cloudflare Workers to answer cost and reliability questions across accounts, so marketing launches are planned with real capacity.
  • Because Cloudflare Workers comes from cloudflare, the company behind the product, it follows that product's own auth and permissions, which security teams usually prefer.

Need help becoming an AI-forward company?

We connect MCP servers and AI agents to your CRM, content and data, with the guardrails your team needs.

Contact us

Cloudflare Workers README

From cloudflare/workers-mcp on GitHub, shared under its Apache-2.0 license. Images are left out; the original has them.

README.md

workers-mcp

Talk to a Cloudflare Worker from Claude Desktop!

[!WARNING]
You should start developers.cloudflare.com/agents/guides/remote-mcp-server instead, and build a remote MCP server

You can connect to remote MCP servers from Claude Desktop, Cursor, and other clients using mcp-remote.

What is workers-mcp?

This package provides both the CLI tooling and the in-Worker logic to connect Claude Desktop (or any MCP Client) to a Cloudflare Worker on your account, so you can customise it to suit your needs. It works via a build step that can translate TypeScript methods of your Worker like this:

export class ExampleWorkerMCP extends WorkerEntrypoint<Env> {
  /**
   * Generates a random number. This is extra random because it had to travel all the way to
   * your nearest Cloudflare PoP to be calculated which... something something lava lamps?
   *
   * @return {string} A message containing a super duper random number
   * */
  async getRandomNumber() {
    return `Your random number is ${Math.random()}`
  }
  
  // ...etc
}

...into MCP tools that a local Node.js server can expose to MCP clients. The Node.js server acts as a proxy, handling stdio transport locally, and calling the relevant method of your Worker running on Cloudflare. This allows you to expose any function or API in your app, or any service in Cloudflare's developer platform, back to a LLM in your coding agent, Claude Desktop or other MCP client.

Yes, I know that Math.random() works the same on a Worker as it does on your local machine, but don't tell Claude 🤫

Usage

Step 1: Generate a new Worker

Use create-cloudflare to generate a new Worker.

npx create-cloudflare@latest my-new-worker

I suggest choosing a Hello World worker.

Step 2: Install workers-mcp
cd my-new-worker # I always forget this bit
npm install workers-mcp
Step 3: Run the setup command
npx workers-mcp setup

Note: if something goes wrong, run npx workers-mcp help

Step 4..♾️: Iterating

After changing your Worker code, you only need to run npm run deploy to update both Claude's metadata about your function and your live Worker instance.

However, if you change the names of your methods, or their parameters, or add or remove methods, Claude will not see the updates until you restart it.

You shouldn't ever need to rerun npx workers-mcp install:claude, but it's safe to do so if you want to rule out Claude config as a source of errors.

Using with Other MCP Clients

Cursor

To get your Cloudflare MCP server working in Cursor, you need to combine the 'command' and 'args' from your config file into a single string and use type 'command'.

For example, if your config file looks like:

{
  "mcpServers": {
    "your-mcp-server-name": {
      "command": "/path/to/workers-mcp",
      "args": [
        "run",
        "your-mcp-server-name",
        "https://your-server-url.workers.dev",
        "/path/to/your/project"
      ],
      "env": {}
    }
  }
}

In Cursor, create an MCP server entry with:

  • type: command
  • command: /path/to/workers-mcp run your-mcp-server-name https://your-server-url.workers.dev /path/to/your/project
Other MCP Clients

For Windsurf and other MCP clients, update your configuration file to include your worker so you could use the tools directly from the client:

{
  "mcpServers": {
    "your-mcp-server-name": {
      "command": "/path/to/workers-mcp",
      "args": [
        "run",
        "your-mcp-server-name",
        "https://your-server-url.workers.dev",
        "/path/to/your/project"
      ],
      "env": {}
    }
  }
}

Make sure to replace the placeholders with your actual server name, URL, and project path.

Examples

See the examples directory for a few ideas of what to use this for:

  • examples/01-hello-world is a snapshot taken after the installation instructions above
  • examples/02-image-generation uses Workers AI to run the Flux image generation model. Claude is really good at suggesting prompts and can actually interpret the outcome and decide what new prompts to try to achieve the outcome you want.
  • To do Browser Rendering
  • To do Durable Objects

Questions about Cloudflare Workers

What is the Cloudflare Workers MCP server?

Talk to a Cloudflare Worker from Claude Desktop!. Cloudflare Workers is published by cloudflare, the company behind the product, on GitHub at cloudflare/workers-mcp, and works with AI apps that support the Model Context Protocol, such as Claude, Cursor and VS Code.

How do I install the Cloudflare Workers MCP server?

Cloudflare Workers doesn't publish a one-line install in the MCP registry, so follow the setup steps in its README on GitHub (cloudflare/workers-mcp). Like most servers, Cloudflare Workers ends with a command or URL you paste into your AI app's MCP config.

Does Cloudflare Workers need an API key?

The registry lists no required keys for Cloudflare Workers. Check the Cloudflare Workers README for optional settings, and expect a remote server to ask you to sign in the first time you connect.

Is Cloudflare Workers an official MCP server?

Yes. Cloudflare Workers is published by cloudflare, the company that makes the product it connects to, so it follows that product's own API and auth.

What license is Cloudflare Workers under?

Cloudflare Workers is released under the Apache-2.0 license, according to its GitHub repository. The license covers the code of Cloudflare Workers; the service it connects to has its own terms.