MCP Server Cloudflare — Workers, KV, R2, DNS & Cache for AI Assistants
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
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.
> 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:
With Cursor
Add to your .cursor/mcp.json:
Authentication
1. Go to Cloudflare Dashboard > API Tokens
2. 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
3. Set CLOUDFLARE_API_TOKEN environment variable
4. Set CLOUDFLARE_ACCOUNT_ID for 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.