Edgeport

io.github.CloudCorpRecords由 GitHub 账号 CloudCorpRecords 发布v0.1.0更新于 Nov 1, 2026

Zones, DNS, cache purge, Workers, KV, and R2 through the Cloudflare API.

概览

AI 生成的概览

本地 MCP 服务器,让助手访问 Cloudflare 账户:区域、DNS 记录、缓存清除、Workers、KV 与 R2。

可以做什么
  • 列出账户与区域,并查看单个区域的详情
  • 列出、创建、更新和删除区域内的 DNS 记录
  • 按文件、标签、主机或全部清除区域缓存
  • 列出 Worker 脚本,并读取脚本的元数据与结构而不含正文
  • 列出账户中的 Workers KV 命名空间与 R2 存储桶
适用场景
适合让助手在运维或排障时查看和修改 Cloudflare DNS、清除区域缓存,或盘点 Workers、KV 与 R2 资源。它只是 Cloudflare API 的核心子集,不能替代完整 API。
运行要求
通过 npx 或 Docker 镜像以 stdio 在本地运行。需要把 Cloudflare API 令牌放在 CLOUDFLARE_API_TOKEN 环境变量中;账户级工具在未提供 account_id 参数时回退到 CLOUDFLARE_ACCOUNT_ID。需要访问 Cloudflare API 的网络。
安装前请注意
令牌以 Bearer 方式发送,其权限决定助手能触及的范围。DNS 的创建、更新、删除以及缓存清除会改动线上配置,误操作可能导致站点不可用或记录被改。建议使用权限最小的令牌,并在执行写操作前确认。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

edgeport

edgeport is a small doorway into a Cloudflare account. From one bin an agent can see which accounts and zones a token can reach, read and change DNS records, purge cached content, and inventory the account's Worker scripts, KV namespaces, and R2 buckets. It runs from the command line or as an MCP server for agents.

A Cloudflare API token is required. Put it in the CLOUDFLARE_API_TOKEN environment variable; it is sent to the API as a Bearer token and never appears in output. Account-scoped tools (Worker scripts, KV, R2) take an account_id argument, and when that is omitted they fall back to CLOUDFLARE_ACCOUNT_ID. When a required variable is missing, the call fails with an error that names it.

This is a core subset of the Cloudflare API, not the whole surface: Workers bindings deep configuration, observability and Logpush, rulesets and firewall rules, Pages and deployments, Stream and Images, AI and Vectorize, and the hosted documentation search tool are out of scope.

Install

bash
npx @reneturcios/edgeport list-zones

Or run the container image:

bash
docker run -i -e CLOUDFLARE_API_TOKEN ghcr.io/cloudcorprecords/edgeport

The container defaults to the MCP server (see below). Pass CLI arguments to use it as a CLI instead.

CLI

bash
export CLOUDFLARE_API_TOKEN="your api token"export CLOUDFLARE_ACCOUNT_ID="your account id"   # optional fallback
edgeport list-accountsedgeport list-zones --name example.comedgeport get-zone --zone-id <zone id>edgeport list-dns --zone-id <zone id> --type Aedgeport purge-cache --zone-id <zone id> --everythingedgeport list-workersedgeport list-kvedgeport list-r2
edgeport --version

Exit codes: 0 on success, 1 when an API call fails (including a missing CLOUDFLARE_API_TOKEN or a success: false envelope), 2 for usage errors.

MCP server

One bin serves both faces. The mcp subcommand starts a stdio MCP server:

bash
npx -y @reneturcios/edgeport mcp

MCP client configuration:

json
{  "mcpServers": {    "edgeport": {      "command": "npx",      "args": ["-y", "@reneturcios/edgeport", "mcp"],      "env": { "CLOUDFLARE_API_TOKEN": "your api token" }    }  }}

Tools

ToolInputWhat it returns
list_accountsper_page (integer, optional)Accounts the token can access, from the envelope's result.
list_zonesaccount_id, name, per_page (all optional)Zones, optionally filtered by account or name.
get_zonezone_id (required)One zone's details.
list_dns_recordszone_id (required), type, name, per_page (optional)DNS records in the zone.
create_dns_recordzone_id, type, name, content (required), ttl, proxied, comment (optional)The created record.
update_dns_recordzone_id, record_id (required), any record field (optional)The updated record; only the fields given are sent.
delete_dns_recordzone_id, record_id (required)The delete result.
purge_cachezone_id (required), purge_everything, files, tags, hosts (optional)The purge result for the zone.
list_workers_scriptsaccount_id (optional)Worker scripts in the account.
get_worker_scriptscript_name (required), account_id (optional)A shape summary only: content type, byte size, body present. The script body is never returned.
list_kv_namespacesaccount_id (optional)Workers KV namespaces in the account.
list_r2_bucketsaccount_id (optional)R2 buckets in the account.

Every JSON response is unwrapped from Cloudflare's {success, errors, result} envelope. A success: false envelope is reported as a tool error carrying the API's own error entries.

Development

bash
npm installnpm run build   # tsc -> dist/npm test        # node test runner over test/*.test.ts, no network (fake fetch fixtures)npm run dev     # run the CLI from source via tsx

License

MIT — see LICENSE.

来源:README.md,提交 a3c8b4b

工具

12

list_accounts

List Cloudflare accounts accessible with the API token.

输入参数per_page

list_zones

List zones, optionally filtered by account or name.

输入参数nameper_pageaccount_id

get_zone

Get one zone by its id.

输入参数zone_id必填

list_dns_records

List DNS records in a zone, optionally filtered by type or name.

输入参数nametypezone_id必填per_page

create_dns_record

Create a DNS record in a zone.

输入参数ttlname必填type必填commentcontent必填proxiedzone_id必填

update_dns_record

Update a DNS record in a zone.

输入参数ttlnametypecommentcontentproxiedzone_id必填record_id必填

delete_dns_record

Delete a DNS record from a zone.

输入参数zone_id必填record_id必填

purge_cache

Purge cached content for a zone, by file, tag, host, or everything.

输入参数tagsfileshostszone_id必填purge_everything

list_workers_scripts

List Worker scripts in an account.

输入参数account_id

get_worker_script

Get a Worker script's metadata and shape only, without its body.

输入参数account_idscript_name必填

list_kv_namespaces

List Workers KV namespaces in an account.

输入参数account_id

list_r2_buckets

List R2 buckets in an account.

输入参数account_id

版本历史

1
  1. v0.1.0最新Nov 1, 2026

评分

已满足适用检查项的 90%

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

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分