Skip to main content
Glama
archawat

@archawat/mcp-cloudflare

by archawat

@archawat/mcp-cloudflare

模型上下文协议 (MCP) 服务器,用于通过单个 API 令牌管理多个区域(域名)的 Cloudflare DNS。专为批量工作流构建——可在多条记录间开启/关闭代理、审计跨区域的 DNS 以及批量更新记录。

功能

  • 单令牌多区域 — 传入域名(如 "example.com"),服务器会自动为您解析区域。同时也支持区域 ID。

  • 批量操作bulk_toggle_proxybulk_update_dns_recordbulk_list_dns_records 可并发运行,并共享单次调用的区域 ID 缓存,因此重复的区域不会产生额外的查询成本。

  • 安全默认值 — 新创建的 A/CNAME 记录默认 proxied: false(仅 DNS,灰色云朵)。代理需手动开启。

  • 自动分页list_dns_records 会并行获取所有页面,除非您指定了特定页面。

Related MCP server: Cloudflare API MCP

安装

无需本地安装 — 使用 npxbunx 即可按需运行。

Claude Code / Claude Desktop (.mcp.json)

通过 npx (Node):

{
  "mcpServers": {
    "cloudflare": {
      "command": "npx",
      "args": ["-y", "@archawat/mcp-cloudflare"],
      "env": { "CLOUDFLARE_API_TOKEN": "cf-token-here" }
    }
  }
}

通过 bunx (Bun):

{
  "mcpServers": {
    "cloudflare": {
      "command": "bunx",
      "args": ["-y", "@archawat/mcp-cloudflare"],
      "env": { "CLOUDFLARE_API_TOKEN": "cf-token-here" }
    }
  }
}

Claude Code CLI

claude mcp add cloudflare -s user \
  -e CLOUDFLARE_API_TOKEN="cf-token-here" \
  -- npx -y @archawat/mcp-cloudflare

全局安装(冷启动最快)

npm install -g @archawat/mcp-cloudflare
# or: bun add -g @archawat/mcp-cloudflare

全局二进制文件名为 mcp-cloudflare(无作用域),因此:

{
  "mcpServers": {
    "cloudflare": {
      "command": "mcp-cloudflare",
      "env": { "CLOUDFLARE_API_TOKEN": "cf-token-here" }
    }
  }
}

API 令牌

https://dash.cloudflare.com/profile/api-tokens 创建 Cloudflare 令牌,并赋予以下权限:

  • Zone:Read

  • Zone:DNS:Edit

将令牌范围限定为您要管理的区域,或授予“所有区域”权限。

工具

工具

用途

list_zones

查看令牌可管理的域名。

list_dns_records

列出区域中的记录;除非设置了 page,否则会自动跨所有页面分页。

bulk_list_dns_records

在一次调用中列出多个区域的记录。每个区域并发执行。

create_a_record

创建 A 记录。proxied 默认为 false

create_cname_record

创建 CNAME 记录。proxied 默认为 false

toggle_proxy

通过记录 ID 或名称(+ 可选类型)切换代理开关。

bulk_toggle_proxy

在一次调用中为多条记录切换代理(共享 proxied 值)。

update_dns_record

修补记录的 contentttlproxiedcomment

bulk_update_dns_record

在一次调用中修补多条记录,支持每项单独设置字段。

delete_dns_record

通过 ID 删除记录。此操作具有破坏性。

所有工具均接受域名("example.com")或 32 位字符的区域 ID 作为 zone 参数。

批量结果格式

批量工具返回每项的结果;单项失败不会中止整个批次:

{
  "succeeded": 10,
  "failed": 1,
  "results": [
    { "zone": "example.com", "ok": true,  "record": { "id": "…", "proxied": true } },
    { "zone": "other.com",   "ok": false, "error": "No proxyable record found for 'www.other.com'." }
  ]
}

当任何一项失败时,工具响应中会设置 isError: true,同时仍会返回所有结果。

开发

需要 Bun(推荐)或 Node 18+。

bun install
bun run dev         # run src/index.ts with --watch
bun run start       # run src/index.ts once
bun run typecheck   # tsc --noEmit
bun run build       # emit dist/ for publishing

要运行开发副本作为 MCP 服务器而不是已发布的包,请将 .mcp.json 指向您的本地构建:

{
  "mcpServers": {
    "cloudflare": {
      "command": "bun",
      "args": ["/abs/path/to/mcp-cloudflare/src/index.ts"],
      "env": { "CLOUDFLARE_API_TOKEN": "cf-token-here" }
    }
  }
}

服务器使用 stdio 通信 — 您的 MCP 客户端会启动该进程并通过 stdin/stdout 进行通信。

许可证

MIT

A
license - permissive license
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.

  • MCP server for Blockscout

  • MCP server for interacting with the Supabase platform

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/archawat/mcp-cloudflare'

If you have feedback or need assistance with the MCP directory API, please join our Discord server