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 分