mcp-server-cloudflare
This MCP server lets AI assistants manage Cloudflare resources:
Zones: List Cloudflare zones (domains).
DNS: List, create, and delete DNS records for a zone.
Workers: List and delete Workers scripts.
KV Storage: List KV namespaces, list keys in a namespace, get, write, and delete KV values.
R2 Storage: List R2 storage buckets.
Cache: Purge Cloudflare cache (all or specific URLs).
Provides tools for managing Cloudflare services, including listing zones, managing DNS records, performing KV namespace operations, listing R2 buckets, and purging caches.
Allows listing and deleting Cloudflare Workers scripts through an AI assistant.
MCP Server Cloudflare — Workers, KV, R2, DNS & Cache for AI Assistants
An MCP server that lets your AI assistant manage Cloudflare Workers, KV, R2, DNS, and cache purging. Vercel, Railway, and Netlify all have MCP servers — now Cloudflare does too.
You: "List my Workers and purge cache for example.com"
AI: Found 3 Workers: api-gateway, auth-worker, image-resizer
✅ Cache purged for https://example.comWorks with Claude Desktop, Cursor, and VS Code Copilot.

Tools
Tool | What it does |
| List your Cloudflare zones (domains) |
| List DNS records for a zone |
| Create a DNS record |
| Delete a DNS record |
| List Workers scripts |
| Delete a Workers script |
| List KV namespaces |
| List keys in a KV namespace |
| Get a value from KV |
| Write a value to KV |
| Delete a KV key |
| List R2 storage buckets |
| Purge cache (all or specific URLs) |
Related MCP server: Cloudflare MCP Server
Quick Start
With Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["-y", "mcp-server-cloudflare-dns"],
"env": {
"CLOUDFLARE_API_TOKEN": "your_api_token",
"CLOUDFLARE_ACCOUNT_ID": "your_account_id"
}
}
}
}With Cursor
Add to your .cursor/mcp.json:
{
"mcpServers": {
"cloudflare": {
"command": "npx",
"args": ["-y", "mcp-server-cloudflare-dns"],
"env": {
"CLOUDFLARE_API_TOKEN": "your_api_token",
"CLOUDFLARE_ACCOUNT_ID": "your_account_id"
}
}
}
}Authentication
Create a token with the permissions you need:
Zone:Read — for listing zones and DNS
Zone:Edit — for creating/deleting DNS records
Workers Scripts:Edit — for managing Workers
Workers KV Storage:Edit — for KV operations
Zone:Cache Purge — for cache purging
Set
CLOUDFLARE_API_TOKENenvironment variableSet
CLOUDFLARE_ACCOUNT_IDfor Workers, KV, and R2 operations
Examples
Ask your AI assistant:
"List my Cloudflare zones"
"Show DNS records for zone xyz"
"Create an A record pointing to 1.2.3.4"
"List my Workers"
"Show KV keys in namespace abc"
"Purge the cache for https://example.com/page"
"List my R2 buckets"
Agent Plugins
This repo is an Agent Plugins 1.0.0 package: plugin.json, portable mcp.json, and skills/ ship together with the MCP server.
For Cursor, clone the repo and copy or symlink it to ~/.cursor/plugins/local/mcp-server-cloudflare, then reload the window. Skills and MCP show up under Customize > Plugins.
Agent Plugins v1 does not ship OAuth. Set CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID in your MCP client env (see Quick Start). One-click install is not offered because credentials stay in env.
Install and run via npm package mcp-server-cloudflare-dns (not the unrelated mcp-server-cloudflare stub on npm).
FAQ
What npm package do I install?
Use npx -y mcp-server-cloudflare-dns. The repo is named mcp-server-cloudflare on GitHub; npm publishes as mcp-server-cloudflare-dns.
Which env vars are required?
CLOUDFLARE_API_TOKEN for all API calls. CLOUDFLARE_ACCOUNT_ID for Workers, KV, and R2 tools.
Can I install it as an Agent Plugin in Cursor?
Yes, via ~/.cursor/plugins/local/mcp-server-cloudflare. Configure the same env vars in Cursor MCP settings.
What can this MCP manage?
Zones and DNS, Workers scripts, KV namespaces, R2 bucket listing, and cache purge for a zone.
Why no one-click Cursor button?
API token and account id cannot be embedded in a portable install link. Use the JSON under Quick Start.
Development
npm install
npm test
npm run buildAuthor
README built with README Builder
License
MIT © Ofer Shapira
Available Tools
13 toolscf_cache_purgeB
Purge Cloudflare cache (all or specific URLs)
Inputs: zoneId (required), purgeAll, urls.
cf_dns_createC
Create a DNS record
Inputs: zoneId (required), type (required), name (required), content (required), +2 more.
cf_dns_deleteC
Delete a DNS record
Inputs: zoneId (required), recordId (required).
cf_dns_listC
List DNS records for a zone
Inputs: zoneId (required), page, perPage.
cf_kv_deleteC
Delete a key from KV
Inputs: namespaceId (required), key (required), accountId.
cf_kv_getC
Get a value from KV
Inputs: namespaceId (required), key (required), accountId.
cf_kv_keysC
List keys in a KV namespace
Inputs: namespaceId (required), prefix, limit, accountId.
cf_kv_namespacesC
List KV namespaces
Inputs: accountId.
cf_kv_putC
Write a value to KV
Inputs: namespaceId (required), key (required), value (required), accountId.
cf_r2_bucketsC
List R2 buckets
Inputs: accountId.
cf_worker_deleteB
Delete a Workers script
Inputs: scriptName (required), accountId.
cf_workers_listC
List Workers scripts
Inputs: accountId.
cf_zonesC
List Cloudflare zones (domains)
Inputs: page, perPage.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 13 tools
Every tool has a clearly distinct purpose targeting specific Cloudflare resources and actions, with no overlap or ambiguity. For example, cf_dns_create, cf_dns_delete, and cf_dns_list are distinct operations on DNS records, while cf_kv_get, cf_kv_put, and cf_kv_delete handle different KV operations.
All tools follow a consistent cf_resource_action naming pattern using snake_case throughout, such as cf_dns_create, cf_kv_get, and cf_worker_delete. This predictable structure makes it easy to understand each tool's domain and function at a glance.
With 13 tools, the server is well-scoped for managing Cloudflare services like DNS, KV, Workers, R2, and zones. Each tool earns its place by covering essential operations without being excessive or sparse for the domain.
The tool set provides strong coverage for core Cloudflare operations, including CRUD for DNS and KV, and listing for zones, Workers, and R2. Minor gaps exist, such as missing create/update for Workers or R2 buckets, but agents can work around these with the available tools.
Maintenance
Related MCP Connectors
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
Cloudflare Workers MCP server: ai-gateway
Cloudflare Workers MCP server: ai-agent-scratchpad
Cloudflare Workers MCP server: ai-cost-optimizer
Related MCP Servers
- AlicenseNot gradedqualityNot gradedmaintenanceA lightweight MCP server for managing DNS records, purging cache, and interacting with the Cloudflare API through natural language commands.24-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that allows using natural language to manage Cloudflare resources (Workers, KV, R2, D1) through Claude Desktop, VSCode, and other MCP clients.18 npm10Apache 2.0
- AlicenseNot gradedqualityDmaintenanceEnables creation and deployment of MCP servers on Cloudflare Workers, with local testing and one-command deployment.11 npm5MIT
- AlicenseNot gradedqualityCmaintenanceMCP server for managing Cloudflare Workers via Cloudflare Artifacts. Enables editing, committing, and deploying worker scripts directly.8MIT