Cloudflare MCP server
✓ VerifiedLets an AI assistant manage Cloudflare Workers, KV, R2, DNS, and cache purging directly from an IDE.
Also known as ofershap/mcp-server-cloudflare, mcp-server-cloudflare, mcp-server-cloudflare-dns
- Stars
- 4
- Tools
- 13
- Downloads, 30 days
- —
- Latest version
- 1.0.2
- Last commit
- Aug 9, 2026
- License
- MIT
What is Cloudflare MCP?
Cloudflare lets an AI assistant manage Cloudflare Workers, KV, R2, DNS, and cache purging directly from an IDE. It exposes 13 tools, such as cf_zones, cf_dns_list, cf_dns_create.
Summary generated from the project's README
About Cloudflare MCP server
Managing Cloudflare infrastructure from your development environment is possible with this MCP server. It allows AI assistants to interact with your Cloudflare account to handle DNS records, Workers scripts, KV namespaces, R2 buckets, and cache purging. Developers can use these tools through clients like Claude Desktop, Cursor, or VS Code Copilot to perform administrative tasks without leaving their IDE.
To set up the connection, you must provide a CLOUDFLARE_API_TOKEN and a CLOUDFLARE_ACCOUNT_ID as environment variables in your client configuration. The server uses specific tools such as cf_dns_create for managing records, cf_workers_list to view scripts, and cf_kv_put to write data to KV storage. It also supports cf_cache_purge for clearing specific URLs or entire zones.
This integration brings Cloudflare management to the same level as other hosting platforms that offer MCP support. By using the mcp-server-cloudflare-dns package via npx, you can automate complex workflows like listing zones with cf_zones or managing R2 storage buckets.
What you can do with it
- 1Manage DNS recordsAsk your AI to create or delete specific DNS entries for your domains.
- 2Control Workers and KV storageRequest a list of your active Workers scripts or manage keys within a KV namespace.
- 3Clear website cacheInstruct the assistant to purge the cache for a specific URL to reflect recent changes.
- 4Inspect R2 storageHave the AI assistant list your available R2 storage buckets.
Written from the project's README. Every use case is checked against a quote from it.
How to install Cloudflare MCP
Formats verified 10 Nov 2026Add to CursorAdd to GooseInstall Cloudflare MCP in Claude Code
$ claude mcp add mcp-server-cloudflare -- npx -y mcp-server-cloudflare-dnsInstall Cloudflare MCP in Cursor
~/.cursor/mcp.json
{
"mcpServers": {
"mcp-server-cloudflare": {
"command": "npx",
"args": [
"-y",
"mcp-server-cloudflare-dns"
]
}
}
}Install Cloudflare MCP in VS Code
.vscode/mcp.json
{
"servers": {
"mcp-server-cloudflare": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-server-cloudflare-dns"
]
}
}
}Install Cloudflare MCP in VS Code CLI
$ code --add-mcp '{"name":"mcp-server-cloudflare","type":"stdio","command":"npx","args":["-y","mcp-server-cloudflare-dns"]}'Install Cloudflare MCP in Claude Desktop
claude_desktop_config.json
{
"mcpServers": {
"mcp-server-cloudflare": {
"command": "npx",
"args": [
"-y",
"mcp-server-cloudflare-dns"
]
}
}
}Install Cloudflare MCP in Codex
$ codex mcp add mcp-server-cloudflare -- npx -y mcp-server-cloudflare-dnsInstall Cloudflare MCP in Codex config.toml
~/.codex/config.toml
[mcp_servers.mcp-server-cloudflare] command = "npx" args = ["-y", "mcp-server-cloudflare-dns"]
Install Cloudflare MCP in Gemini CLI
$ gemini mcp add -s user mcp-server-cloudflare npx -- -y mcp-server-cloudflare-dnsInstall Cloudflare MCP in Gemini settings.json
~/.gemini/settings.json
{
"mcpServers": {
"mcp-server-cloudflare": {
"command": "npx",
"args": [
"-y",
"mcp-server-cloudflare-dns"
]
}
}
}Cloudflare MCP tools 13
Detected from the READMEcf_zonescf_dns_listcf_dns_createcf_dns_deletecf_workers_listcf_worker_deletecf_kv_namespacescf_kv_keyscf_kv_getcf_kv_putcf_kv_deletecf_r2_buckets
| cf_zones | — | |
| cf_dns_list | — | |
| cf_dns_create | — | |
| cf_dns_delete | — | |
| cf_workers_list | — | |
| cf_worker_delete | — | |
| cf_kv_namespaces | — | |
| cf_kv_keys | — | |
| cf_kv_get | — | |
| cf_kv_put | — | |
| cf_kv_delete | — | |
| cf_r2_buckets | — |
Show all 13 toolsShow fewer tools
cf_cache_purge
| cf_cache_purge | — |
Configuration
CLOUDFLARE_ACCOUNT_IDCLOUDFLARE_API_TOKEN
| Name | Description | |
|---|---|---|
| CLOUDFLARE_ACCOUNT_ID | — | |
| CLOUDFLARE_API_TOKEN | — |
Automated checks
Ran Nov 14, 2026Full report →Passed our automated checks. That is not a security audit: read the code and give the server the narrowest access it needs. How checks work
- Source repository linked and reachableofershap/mcp-server-cloudflare is public and reachablegithub.com/ofershap/mcp-server-cloudflare ↗Pass
- Package names this repository as its sourcemcp-server-cloudflare-dns names ofershap/mcp-server-cloudflare as sourcenpmjs.com/package/mcp-server-cloudflare-dns ↗Pass
- Build provenance (Sigstore attestation)No build attestation published for this releaseNot checked
- Open source license (OSI)MITspdx.org/licenses/MIT.html ↗Pass
- Commit or release in the last yearLast commit or release 2026-08-09github.com/ofershap/mcp-server-cloudflare ↗Pass
- OpenSSF ScorecardNot checked
- Package name not close to a popular packageNo popular package one edit away from mcp-server-cloudflare-dnsPass
- No critical advisory in the package or its dependencies99 resolved dependencies checked; no critical advisoryosv.dev ↗Pass
- No hidden instructions to the model13 tool descriptions and the README read; no override phrases, credential paths or hidden charactersPass
- Destructive tools are labelledNo tool named like delete, drop or execPass
- Remote endpoint answers the MCP handshakeNot checked
README
View on GitHubMCP 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.com
Works with Claude Desktop, Cursor, and VS Code Copilot.

Tools
| Tool | What it does |
|---|---|
cf_zones |
List your Cloudflare zones (domains) |
cf_dns_list |
List DNS records for a zone |
cf_dns_create |
Create a DNS record |
cf_dns_delete |
Delete a DNS record |
cf_workers_list |
List Workers scripts |
cf_worker_delete |
Delete a Workers script |
cf_kv_namespaces |
List KV namespaces |
cf_kv_keys |
List keys in a KV namespace |
cf_kv_get |
Get a value from KV |
cf_kv_put |
Write a value to KV |
cf_kv_delete |
Delete a KV key |
cf_r2_buckets |
List R2 storage buckets |
cf_cache_purge |
Purge cache (all or specific URLs) |
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
- Go to Cloudflare Dashboard > API Tokens
- 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 variable - Set
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 build
Author
README built with README Builder
License
Cloudflare MCP questions
How do I add Cloudflare MCP to Claude Code?
Run claude mcp add mcp-server-cloudflare -- npx -y mcp-server-cloudflare-dns in your terminal. Add --scope user to make it available in every project.
How do I add Cloudflare MCP to Cursor?
Open ~/.cursor/mcp.json and add the server under mcpServers, using the Cursor config shown in the install section above.
What tools does Cloudflare MCP provide?
It exposes 13 tools, including cf_zones, cf_dns_list, cf_dns_create, cf_dns_delete, cf_workers_list.
What npm package do I install?
You should use the package mcp-server-cloudflare-dns via npx -y mcp-server-cloudflare-dns.
Which environment variables are required?
You need CLOUDFLARE_API_TOKEN for all API calls and CLOUDFLARE_ACCOUNT_ID for Workers, KV, and R2 tools.
What can this MCP manage?
It can manage DNS and zones, Workers scripts, KV namespaces, R2 bucket listing, and cache purging.
Can I install it as an Agent Plugin in Cursor?
Yes, you can install it via ~/.cursor/plugins/local/mcp-server-cloudflare and configure the necessary environment variables in Cursor.