Cloudflare Workers let you run code at the edge without managing servers. The official Cloudflare MCP server takes this further by letting Claude deploy, update, and manage your Workers directly from a conversation. No wrangler CLI commands to memorize, no context switching — just tell Claude what you want deployed.

What is Cloudflare?

Cloudflare is a global network platform that provides CDN, DDoS protection, DNS management, and edge computing services. Its Workers platform lets you run JavaScript, TypeScript, and WebAssembly at the edge across hundreds of data centers worldwide — with no cold starts and sub-millisecond response times. Beyond Workers, Cloudflare offers KV for distributed key-value storage, R2 for S3-compatible object storage, D1 for SQLite-based edge databases, and a full DNS management layer. If you have a domain or a serverless workload, Cloudflare is probably part of your stack.

What the Cloudflare MCP Server Does

The Cloudflare MCP server bridges Claude and the Cloudflare REST API. Once installed, Claude can invoke tools autonomously during your conversations. The core capabilities include:

  • Deploy and update Workers — push a new Worker script or update an existing one by name.
  • List deployed Workers — see all Workers in your account with their last modified timestamps.
  • Read and write KV namespace entries — get, set, and delete key-value pairs in any KV namespace.
  • Manage D1 databases — run SQL queries against your D1 edge databases directly from Claude.
  • Configure DNS records — add, update, or delete A, CNAME, TXT, and MX records for your zones.
  • Check analytics — query request counts, error rates, and bandwidth usage for your Workers and zones.

Claude decides which tool to call based on your natural-language request, passes the correct parameters, and formats the response readably. For context on how Claude selects tools, see our MCP security and trust levels guide.

Prerequisites

Before installing the Cloudflare MCP server, make sure you have the following:

  • Cloudflare account — any plan works, including the free tier.
  • Cloudflare API token — go to dash.cloudflare.com/profile/api-tokens and create a token with Workers Scripts:Edit permission. For DNS management, also add DNS:Edit for the relevant zone.
  • Account ID — found on the right sidebar of your Cloudflare dashboard homepage, or under any zone's overview page.
  • Node.js 18 or higher — check with node --version in your terminal. Download from nodejs.org if needed.
  • Claude Desktop — the MCP server connects via Claude Desktop's MCP integration.

How to Install the Cloudflare MCP Server

  1. Create an API token in Cloudflare dashboard. Navigate to dash.cloudflare.com/profile/api-tokens, click Create Token, and use the Edit Cloudflare Workers template. Scope it to your account and the specific zone if you want DNS access. Copy the token — it is only shown once.
  2. Find your Account ID. Log into the Cloudflare dashboard and look at the right-hand sidebar on the homepage. Your Account ID is a 32-character hex string. Copy it.
  3. Open your Claude Desktop config file. This is claude_desktop_config.json. On macOS it lives at ~/Library/Application Support/Claude/claude_desktop_config.json; on Windows at %APPDATA%\Claude\claude_desktop_config.json. See our full claude_desktop_config.json guide for details.
  4. Add the Cloudflare server block using the config below, paste in your API token and Account ID, save the file, and restart Claude Desktop. The Cloudflare server will appear in Claude's tool list within seconds.

The Config JSON

Add this block to your claude_desktop_config.json. The npx command pulls the latest server version automatically — no manual installation required.

{
  "mcpServers": {
    "cloudflare": {
      "command": "npx",
      "args": ["-y", "@cloudflare/mcp-server-cloudflare"],
      "env": {
        "CLOUDFLARE_API_TOKEN": "your_api_token_here",
        "CLOUDFLARE_ACCOUNT_ID": "your_account_id_here"
      }
    }
  }
}
Full claude_desktop_config.json entry for the Cloudflare MCP server. Replace both placeholder values with your actual Cloudflare API token and Account ID.

If you are new to storing credentials in config files, read our MCP security and trust levels guide first. The credentials live only in your local config and are passed to the local server process — they do not travel to Anthropic's servers. Also see our guide on local vs remote MCP servers for context on how this architecture works.

Real Use Cases

Once the server is connected, these are the kinds of requests Claude can handle immediately:

  1. "Deploy this JavaScript Worker code to my Cloudflare account." Claude takes the script you paste into the conversation, calls the Workers deploy API, and confirms the deployment with the Worker name and route.
  2. "List all my deployed Workers and their last modified dates." Claude queries your account's Workers list and returns a formatted table with names, routes, and timestamps.
  3. "Read the current value of the 'config' key in my KV namespace." Claude identifies the KV namespace by name, fetches the key, and returns its value — useful for inspecting cached configuration without opening the dashboard.
  4. "Set the DNS A record for api.example.com to 192.0.2.1." Claude creates or updates the DNS A record in your zone with the specified IP address and confirms the change.
  5. "How many requests did my Workers handle yesterday?" Claude queries the Workers analytics API for the previous calendar day and returns total requests, error counts, and average response times.

Pros

  • Official Cloudflare-maintained server — unlike community packages, this one is kept in sync with the Cloudflare API by the company itself.
  • Full Workers deploy capability — you can ship code to the edge from a conversation, which is genuinely useful for rapid iteration.
  • KV read/write support — inspecting and updating edge configuration stored in KV is much faster through Claude than via the dashboard.
  • Great for serverless developers — if your workflow already lives in Claude, keeping deployments there too reduces context switching significantly.

Cons / Limitations

  • API token needs correct permissions — it is easy to create a token that is too narrow (deployment fails) or too broad (security risk). Take time to scope it correctly.
  • Irreversible actions require confirmation — deleting Workers or KV namespaces via Claude is permanent. Always confirm with Claude before it executes destructive operations.
  • Not suitable for production CI/CD — this server is ideal for individual developer workflows and ad-hoc deployments. Production pipelines should use Wrangler with proper CI/CD gating, not conversational AI.

Frequently Asked Questions

Yes — the @cloudflare/mcp-server-cloudflare package is published and maintained by Cloudflare. It is an officially supported first-party integration, which means it stays up to date with the Cloudflare API and is unlikely to be abandoned. Always install from the official npm package to ensure you have the genuine version.

Yes. The Cloudflare MCP server uses the Cloudflare REST API directly, so you do not need Wrangler installed on your machine. Claude sends your Worker script code to the API and handles the deployment. That said, Wrangler is still useful for local development and testing before deploying via Claude.

The primary focus of the Cloudflare MCP server is Workers, KV, D1, and DNS. Cloudflare Pages support may be limited or unavailable depending on the server version. Check the package README for the current list of supported resources. Pages deployments are still best handled via Git integration or the Wrangler CLI.

At minimum you need Workers Scripts:Edit, Workers KV Storage:Edit, and DNS:Edit permissions for the relevant zone. If you also want D1 database access, add D1:Edit. Create the token at dash.cloudflare.com/profile/api-tokens using the Edit Cloudflare Workers template as a starting point, then trim permissions you do not need.