Back to Skill Directory

MCP Server

Cloud InfrastructureEdge ComputingServerlessApache 2.0

Cloudflare MCP Server

by Cloudflare / Anthropic · anthropic/mcp-cloudflare

Cloudflare MCP Server puts the entire Cloudflare platform at your AI assistant's fingertips. Deploy Workers to the edge, manage Pages projects, store data in KV and R2, run SQL on D1 databases, configure DNS records, and monitor performance metrics — all through natural language commands from Claude Code or any MCP-compatible client, without ever opening the Cloudflare dashboard.

Managing cloud infrastructure typically requires context-switching between dashboards, CLI tools, and configuration files. Cloudflare MCP collapses this workflow into a single conversational interface. Ask your agent to "deploy this Worker script with a KV binding and set up a custom domain" and it handles the multi-step orchestration — creating the Worker, binding the KV namespace, configuring the route, and verifying the deployment — in one coherent flow.

7+
Services
Workers, Pages, KV, R2, D1...
<3min
Setup
npm install + API token
25+
Tools Exposed
deploy, query, configure...
Apache 2.0
License
open source

Quick Install

claude mcp add cloudflare -- npx @anthropic/mcp-cloudflare

Key Features

Workers Deployment

Create, update, and deploy Cloudflare Workers directly from your IDE. The agent handles script upload, environment variable configuration, KV and R2 bindings, cron trigger setup, and custom domain routing — turning multi-step deployment workflows into single conversational requests.

Pages Project Management

Create Pages projects, trigger deployments, configure build settings, set environment variables, and manage custom domains. Review deployment history, roll back to previous versions, and inspect build logs for failed deployments without leaving your coding environment.

KV & R2 Storage Operations

Manage key-value data in KV namespaces and object storage in R2 buckets. Create namespaces and buckets, read and write data, list contents with prefix filtering, configure access policies, and set up CORS rules for public bucket access.

D1 Database Queries

Create and manage D1 SQLite databases at the edge. Run SQL queries, execute schema migrations, inspect table structures, and export data. Perfect for managing application state, user data, and configuration stored in Cloudflare&apos;s globally distributed database service.

DNS Record Management

Create, update, and delete DNS records across all your Cloudflare zones. Configure A, AAAA, CNAME, MX, TXT, and SRV records with proxied or DNS-only mode, set TTL values, and verify propagation — essential for domain setup and service migration workflows.

Performance Monitoring

Query Workers analytics, check request counts, error rates, CPU time usage, and response latency metrics. Monitor deployment health in real time and identify performance regressions immediately after deploying new Worker versions to the edge network.

Execution Brief

Use this page as a rollout checklist, not just reference text.

Suggest update

Tool Mapping Lens

Organize Tools by Workflow Phase

Catalog-oriented pages work best when users can map discovery, evaluation, and rollout in a clear path instead of reading an undifferentiated list.

  • Define the job-to-be-done first
  • Group tools by stage
  • Prioritize by adoption friction

Actionable Utility Module

Skill Implementation Board

Use this board for Cloudflare MCP Server before rollout. Capture inputs, apply one decision rule, execute the checklist, and log outcome.

Input: Objective

Deliver one measurable improvement with cloudflare mcp server claude code workers pages kv r2 d1 dns edge computing serverless deployment

Input: Baseline Window

20-30 minutes

Input: Fallback Window

8-12 minutes

Decision TriggerActionExpected Output
Input: one workflow objective and release owner are definedRun preview execution with fixed acceptance criteria.Go or hold decision backed by repeatable evidence.
Input: output quality below baseline or retries increaseLimit scope, isolate root issue, and rerun controlled test.One confirmed correction path before wider rollout.
Input: checks pass for two consecutive replay windowsPromote to broader traffic with fallback path active.Stable rollout with low operational surprise.

Execution Steps

  1. Record objective, owner, and stop condition.
  2. Execute one controlled preview run.
  3. Measure quality, latency, and correction burden.
  4. Promote only when pass criteria are stable.

Output Template

tool=cloudflare mcp server claude code workers pages kv r2 d1 dns edge computing serverless deployment
objective=
preview_result=pass|fail
primary_metric=
next_step=rollout|patch|hold

What Is Cloudflare MCP Server?

Cloudflare MCP Server is a Model Context Protocol integration that exposes Cloudflare&apos;s platform services — Workers, Pages, KV, R2, D1, DNS, and analytics — as tool calls accessible from AI coding assistants. Instead of switching between the Cloudflare dashboard, Wrangler CLI, and API documentation, developers can manage their entire edge infrastructure through natural language commands in their IDE.

Edge computing and serverless architectures have become the default for modern web applications, but managing them involves juggling multiple tools and interfaces. Cloudflare MCP simplifies this by letting the agent orchestrate complex multi-service workflows. Saying "create a Worker that reads from KV and stores uploads in R2, then set up a custom domain" triggers a coordinated sequence of API calls that would otherwise require dozens of manual steps.

The server authenticates using Cloudflare API tokens with granular permission scoping. You control exactly which services and operations the agent can access — read-only analytics access for monitoring, write access for deployments, or full admin access for infrastructure provisioning. Token permissions follow the principle of least privilege, ensuring the agent only has the access level required for the current task.

Cloudflare MCP works seamlessly alongside other MCP servers in your toolkit. Filesystem MCP reads local Worker scripts and Wrangler configuration files before deployment. GitHub MCP triggers Pages deployments from repository pushes. Postgres MCP handles data migration between traditional databases and Cloudflare D1. Together they create an end-to-end infrastructure-as-conversation workflow.

How to Calculate Better Results with cloudflare mcp server claude code workers pages kv r2 d1 dns edge computing serverless deployment

Install the Cloudflare MCP server package via npm. The package has minimal dependencies and does not require Wrangler or any other Cloudflare tooling to be installed separately. All communication with Cloudflare services goes through the REST API, so the server works in any environment with network access.

Create a Cloudflare API token in the Cloudflare dashboard under My Profile, then API Tokens, then Create Token. Select the permissions your workflows need — Workers Scripts for deployments, Zone DNS for domain management, R2 Admin for storage, and so on. Pass the token to the MCP server through the CLOUDFLARE_API_TOKEN environment variable. Never hardcode tokens in configuration files.

Register the MCP server with your AI client using the quick install command. For Claude Code, this adds the server to your MCP configuration and makes all Cloudflare tools available in your next session. You can also set the CLOUDFLARE_ACCOUNT_ID environment variable to skip the account selection step when you have multiple accounts.

Verify the setup by asking your agent to list your existing Workers or Pages projects. If the agent returns your project list correctly, the authentication and API connectivity are working. Try a simple operation like reading a KV key or listing R2 bucket contents to confirm data access permissions are configured correctly.

Treat this page as a decision map. Build a shortlist fast, then run a focused second pass for security, ownership, and operational fit.

When a team keeps one shared selection rubric, tool adoption speeds up because evaluators stop debating criteria every time a new option appears.

Worked Examples

Deploy a full-stack application to Cloudflare

  1. You have a Next.js application that needs a Worker for API routes, a KV namespace for session storage, an R2 bucket for user uploads, and a custom domain — all on Cloudflare
  2. Ask the agent to create a KV namespace called "sessions" and an R2 bucket called "uploads" using Cloudflare MCP, which provisions both storage services in seconds
  3. The agent reads your Worker script from the local filesystem via Filesystem MCP, then deploys it to Cloudflare with KV and R2 bindings automatically configured
  4. Next, the agent creates a Pages project for the frontend, configures build settings for Next.js, sets environment variables for the Worker API endpoint, and triggers the initial deployment
  5. The agent adds a CNAME DNS record pointing your custom domain to the Pages project and configures SSL certificate provisioning
  6. Finally, the agent verifies the deployment by checking that the Worker responds correctly, the Pages site loads, KV reads and writes succeed, and the custom domain resolves with a valid SSL certificate

Outcome: A complete full-stack application deployed to Cloudflare&apos;s edge network with storage, compute, DNS, and SSL configured — all orchestrated through natural language without touching the dashboard.

Incident response and rollback workflow

  1. Your monitoring alerts show elevated error rates on a recently deployed Worker, and you need to diagnose and fix the issue quickly
  2. Ask the agent to pull Workers analytics for the last hour using Cloudflare MCP, showing request counts, error rates, and P99 latency broken down by route
  3. The agent identifies that errors spiked immediately after the latest deployment and queries the Worker&apos;s tail logs to find the specific error messages — a missing KV key causing null reference exceptions
  4. The agent rolls back the Worker to the previous known-good version using Cloudflare MCP&apos;s deployment history, immediately restoring service for all users
  5. With the production issue resolved, the agent reads the current Worker script via Filesystem MCP, adds the missing KV key with a default value, and prepares a fixed version
  6. The agent deploys the patched Worker to a staging route first, runs validation requests against it, confirms no errors, then promotes it to the production route and verifies error rates return to baseline

Outcome: A structured incident response workflow — from detection through diagnosis, rollback, fix, and verified redeployment — completed entirely from the IDE in minutes rather than hours.

Frequently Asked Questions

What is the Cloudflare MCP Server?

Cloudflare MCP Server is a Model Context Protocol integration that gives AI coding assistants direct access to Cloudflare&apos;s platform APIs. It exposes operations for managing Workers, Pages, KV namespaces, R2 storage buckets, D1 databases, DNS records, and routing rules as MCP tools. This allows agents to deploy code, configure infrastructure, and troubleshoot production issues without switching to the Cloudflare dashboard.

How do I authenticate the Cloudflare MCP Server?

The server authenticates using a Cloudflare API token passed through the CLOUDFLARE_API_TOKEN environment variable. Create a token in the Cloudflare dashboard with the specific permissions your workflows require — for example, Workers write access for deployments, DNS edit for domain management, or R2 admin for storage operations. The server never stores credentials on disk and reads the token only from the environment.

Can the Cloudflare MCP Server deploy Workers?

Yes. The server can create new Workers, update existing Worker scripts, configure environment variables and secrets, set up cron triggers, bind KV namespaces and R2 buckets, and manage routing rules. Your agent can write a Worker script, deploy it to production, configure a custom domain, and verify it is responding — all in a single conversational flow.

Does it support Cloudflare Pages deployments?

Yes. The MCP server can create Pages projects, trigger deployments, manage build configurations, set environment variables, and configure custom domains. It can also list deployment history, roll back to previous deployments, and check build logs for failed deployments. This makes it straightforward to manage static sites and full-stack Next.js applications hosted on Pages.

Can I manage DNS records through the MCP Server?

Absolutely. The server supports creating, reading, updating, and deleting DNS records for any zone in your Cloudflare account. Your agent can add A, AAAA, CNAME, MX, TXT, and SRV records, configure proxied versus DNS-only mode, set TTL values, and verify record propagation. This is especially useful when setting up new domains or migrating services.

What storage services can I manage?

The MCP server provides full access to Cloudflare KV (key-value store), R2 (S3-compatible object storage), and D1 (SQLite-at-the-edge database). For KV, you can create namespaces, read and write key-value pairs, list keys with prefix filtering, and delete entries. For R2, you can create buckets, upload and download objects, list bucket contents, and configure CORS policies. For D1, you can create databases, run SQL queries, and manage schema migrations.

Missing a better tool match?

Send the exact workflow you are solving and we will prioritize a new comparison or rollout guide.