Cloudflare

io.github.ofershap由 GitHub 账号 ofershap 发布v1.0.2更新于 Oct 24, 2026

MCP server to manage Cloudflare Workers, KV, R2, Pages, DNS, and cache from your IDE

发布方自己的服务:Cloudflare

概览

AI 生成的概览

一个本地 MCP 服务器,让 AI 助手在 IDE 中管理 Cloudflare 的域名区域、DNS 记录、Workers、KV、R2 存储桶和缓存清除。

可以做什么
列出 Cloudflare 域名区域及其 DNS 记录,并为区域创建或删除 DNS 记录。列出 Workers 脚本并删除 Workers 脚本。列出 KV 命名空间、列出键、读取、写入和删除 KV 值。列出 R2 存储桶。清除区域缓存,可全部清除或仅清除指定 URL。
适用场景
适合在与助手对话中查看或修改 Cloudflare 的 DNS、Workers、KV 或缓存设置,而不必打开 Cloudflare 控制台,例如排查问题时查询记录或清除某个 URL 的缓存。
运行要求
通过 npx 从 npm 包 mcp-server-cloudflare-dns 在本地运行,需要 Node.js。需要在 CLOUDFLARE_API_TOKEN 中提供 Cloudflare API 令牌,Workers、KV 和 R2 操作还需要 CLOUDFLARE_ACCOUNT_ID。令牌需具备相应权限,例如 Zone:Read、Zone:Edit、Workers Scripts:Edit、Workers KV Storage:Edit 和 Zone:Cache Purge。
安装前请注意
该令牌可实际控制你的 Cloudflare 账户,应只授予所需权限。多个工具会修改或删除线上数据:创建和删除 DNS 记录、删除 Workers 脚本、写入和删除 KV 键以及清除缓存。误操作可能导致网站或 Worker 无法访问。凭据以环境变量形式写入客户端配置。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Cloudflare,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

MCP Server Cloudflare — Workers, KV, R2, DNS & Cache for AI Assistants

[npm version] [npm downloads] [CI] [License: MIT] [Agent Plugins]

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.

[MCP server Cloudflare demo — listing Workers and purging cache from Claude Desktop]

Tools

ToolWhat it does
cf_zonesList your Cloudflare zones (domains)
cf_dns_listList DNS records for a zone
cf_dns_createCreate a DNS record
cf_dns_deleteDelete a DNS record
cf_workers_listList Workers scripts
cf_worker_deleteDelete a Workers script
cf_kv_namespacesList KV namespaces
cf_kv_keysList keys in a KV namespace
cf_kv_getGet a value from KV
cf_kv_putWrite a value to KV
cf_kv_deleteDelete a KV key
cf_r2_bucketsList R2 storage buckets
cf_cache_purgePurge cache (all or specific URLs)

Quick Start

With Claude Desktop

Add to your claude_desktop_config.json:

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:

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

  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.

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

bash
npm installnpm testnpm run build

Author

[Made by ofershap]

[LinkedIn] [GitHub]


README built with README Builder

License

MIT © Ofer Shapira

来源:README.md,提交 d9e1ea3

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Cloudflare 集成