bunny.net CDN and Shield

io.github.fullfatthings由 GitHub 账号 fullfatthings 发布v1.0.1更新于 Nov 5, 2026

Debug bunny.net CDN pull zones and manage bunny Shield: WAF, rate limits, bot detection, event logs

发布方自己的服务:Bunny

概览

AI 生成的概览

非官方 MCP 服务器,用于排查 bunny.net CDN 拉取区域,并管理 bunny Shield 的 WAF、速率限制、机器人检测与事件日志。

可以做什么
  • 列出并查看拉取区域,含可读的边缘规则及缓存、源站与安全设置
  • 读取 CDN 统计数据和源站错误日志以排查问题
  • 修改拉取区域设置、清除缓存,并创建、启停或删除边缘规则
  • 查看 Shield WAF 设置、自定义规则、速率限制与机器人检测,并附说明提示规则实际效果
  • 按规则、IP 或指纹分组查看最近 72 小时的 WAF 事件日志
  • 创建、更新和删除 WAF 规则与速率限制,并调整机器人检测模式
适用场景
适合运维 bunny.net CDN 站点时使用:让助手诊断 502/504 源站错误、查看缓存命中率、调整边缘规则,或在不打开控制台的情况下配置和测试 WAF 规则与速率限制。
运行要求
通过 npx 在本地运行,需要 Node.js 20 或更高版本。需要在 BUNNY_API_KEY 环境变量中提供 bunny.net 账户 API 密钥。可选设置 BUNNY_READONLY=1 仅注册只读工具。需要访问 bunny.net API 的网络连接。
安装前请注意
该 API 密钥拥有账户的完全访问权限,应视为高价值机密。写入类工具会修改线上 CDN 与 WAF 配置、清除缓存,并永久删除边缘规则、WAF 规则和速率限制;可设置 BUNNY_READONLY=1 规避。更新工具还可能改动你未请求的设置。该项目为非官方项目,与 bunny.net 无关联。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

bunny-mcp

An MCP server for debugging bunny.net CDN sites and managing bunny Shield, the bunny.net web application firewall (WAF).

This is an unofficial project. It is not affiliated with or endorsed by bunny.net.

It covers pull zones (CDN sites), edge rules, cache purges, CDN statistics, origin error logs, and Shield: WAF settings, custom WAF rules, rate limits, bot detection and WAF event logs. It does not cover DNS, storage, Stream or edge scripts. For those, see anvme/bunnycdn-mcp or Digitizers/bunny-mcp.

What it does differently

  • Explains what rules will really do. get_shield_zone returns notes that warn, for example, when Block rules only log because the zone's WAF execution mode is Log.
  • Reads WAF event logs. shield_event_logs shows what the WAF blocked, challenged or logged in the last 72 hours, grouped by rule, IP, JA4 fingerprint and more.
  • Reports what changed. Update tools return a before-and-after diff. update_pull_zone also lists settings bunny.net changed that you did not ask for.
  • Keeps responses small. Pull zones, edge rules, origin errors and event logs are summarised. Pass detail: true for the raw response.
  • Hides credentials. Token authentication keys, AWS signing keys, TLS certificates and private keys, log forwarding tokens, and cookie or Authorization values in edge rule triggers are replaced with <hidden>, also in raw responses.

Requirements

  • Node.js 20 or later
  • A bunny.net account API key, from Account settings > API key in the bunny.net dashboard. This key gives full access to the account.

Install

Claude Code:

sh
claude mcp add bunny --env BUNNY_API_KEY=your-key -- npx -y @fullfatthings/bunny-mcp

Other MCP clients (for example Claude Desktop):

json
{  "mcpServers": {    "bunny": {      "command": "npx",      "args": ["-y", "@fullfatthings/bunny-mcp"],      "env": { "BUNNY_API_KEY": "your-key" }    }  }}

Configuration

VariableMeaning
BUNNY_API_KEYRequired. Your bunny.net account API key.
BUNNY_READONLYSet to 1 to register only the read tools. Write tools are then absent from the tool list, so the assistant cannot call them.

Tools

Read tools:

ToolPurpose
list_pull_zonesList pull zones with IDs, origins and hostnames.
get_pull_zoneOne pull zone: hostnames, readable edge rules, and caching, origin and security settings.
cdn_statisticsBandwidth, requests, cache hit rate and error responses.
origin_errorsFailed requests from bunny.net to your origin on one day, with counts by error.
get_shield_zoneWAF settings, custom rules, rate limits and bot detection, with notes.
shield_event_logsRequests the WAF blocked, challenged or logged in the last 72 hours.

Write tools (not registered when BUNNY_READONLY=1):

ToolPurpose
update_pull_zoneChange pull zone settings.
purge_cachePurge one URL or a whole pull zone.
save_edge_ruleCreate or update an edge rule.
set_edge_rule_enabledSwitch an edge rule on or off.
delete_edge_ruleDelete an edge rule.
update_shield_zoneChange WAF settings, including adding or removing single rule IDs from lists.
update_bot_detectionChange bot detection mode and sensitivity.
save_waf_ruleCreate or update a custom WAF rule.
save_rate_limitCreate or update a rate limit.
delete_shield_ruleDelete a custom WAF rule or rate limit.

To test a new WAF rule safely, save it with action Log, check shield_event_logs, then save it again with action Block.

Development

sh
npm installnpm test

To release, run npm version patch (or minor or major). It updates package.json and server.json, commits, tags and pushes; the tag starts a GitHub Action that publishes to npm and the MCP registry.

Licence

MIT. See LICENSE.

来源:README.md,提交 d68283b

工具

16

list_pull_zones

List bunny.net pull zones (CDN sites) with their IDs, origins and hostnames.

输入参数pagesearchperPage

get_pull_zone

One pull zone: hostnames, edge rules as readable one-line summaries (Guid first) and the caching, origin and security settings that matter when debugging. Credentials (ZoneSecurityKey, AWS signing keys, cookie and Authorization trigger values) are left out. For other settings, pass `fields` with the raw names; `detail: true` returns the full raw object (about 10,000 tokens) with the same credentials hidden.

输入参数detailfieldspull_zone_id必填

cdn_statistics

CDN statistics: bandwidth, requests, cache hit rate and, with load_errors, non-2xx responses. Defaults to the last 30 days across all pull zones.

输入参数hourlydate_todate_fromload_errorspull_zone_id

update_pull_zone

Change pull zone settings and return what changed. Send only the fields to change, using the raw names (e.g. CacheControlMaxAgeOverride, UseStaleWhileOffline); read current values with get_pull_zone and `fields`. `alsoChanged` lists settings Bunny changed that were not requested. Edit edge rules with save_edge_rule, not here.

输入参数fields必填pull_zone_id必填

purge_cache

Purge the CDN cache for one URL (wildcard * allowed at the end), or for a whole pull zone.

输入参数urlcache_tagpull_zone_id

save_edge_rule

Create an edge rule, or update one by including its Guid (from get_pull_zone). Send the whole rule, not only changed fields; to switch a rule on or off use set_edge_rule_enabled. Fields: ActionType, ActionParameter1-3, Triggers [{Type, PatternMatches[], PatternMatchingType, Parameter1}], TriggerMatchingType, Description, Enabled, OrderIndex, ExtraActions [{ActionType, ActionParameter1-3}]. ActionType: 0 Force SSL, 1 Redirect, 2 Origin URL, 3 Override Cache Time, 4 Block Request, 5 Set Response Header, 6 Set Request Header, 7 Force Download, 8 Disable Token Authentication, 9 Enable Token Authentication, 10 Override Cache Time Public, 11 Ignore Query String, 12 Disable Optimizer, 13 Force Compression, 14 Set Status Code, 15 Bypass Perma-Cache, 16 Override Browser Cache Time, 17 Origin Storage, 18 Set Network Rate Limit, 19 Set Connection Limit, 20 Set Requests Per Second Limit, 21 Run Edge Script, 22 Origin Magic Containers, 23 Disable WAF, 24 Retry Origin, 25 Override Browser Cache Response Header, 26 Remove Browser Cache Response Header, 27 Disable Shield Challenge, 28 Disable Shield, 29 Disable Shield Bot Detection, 30 Bypass AWS S3 Authentication, 31 Disable Shield Access Lists, 32 Disable Shield Rate Limiting, 33 Enable Request Coalescing, 34 Disable Request Coalescing, 35 Use Load Balancer, 36 Force Load Balancer Sticky Session Mode, 37 Strip Cookies (Client to Origin). Trigger Type: 0 URL, 1 Request Header, 2 Response Header, 3 URL Extension, 4 Country Code, 5 Remote IP, 6 URL Query String, 7 Random Chance, 8 Status Code, 9 Request Method, 10 Cookie Value, 11 Country State Code, 12 Origin Retry Attempt Count, 13 Origin Connection Error. PatternMatchingType and TriggerMatchingType: 0 Match Any, 1 Match All, 2 Match None. Edge rules change CDN behaviour and log nothing; to block abusive traffic use a WAF rule (save_waf_rule), which can log first and records every match in shield_event_logs.

输入参数rule必填pull_zone_id必填

set_edge_rule_enabled

Switch an edge rule on or off without resending the whole rule.

输入参数guid必填enabled必填pull_zone_id必填

origin_errors

Bunny's log of failed requests to a pull zone's origin on one day: why each failed (e.g. http_timeout, http_request_failure, dns_lookup, network_socket_exception). Use it to confirm 502 or 504 errors from Bunny's side. Origin responses with an error status, such as a PHP-FPM 502, may not appear here. Returns counts and samples for one page of up to 200 entries. Which part of the day that page covers varies between calls, so check from and to; hasMoreData means other entries exist that this tool does not fetch.

输入参数date必填detailpull_zone_id必填

delete_edge_rule

Permanently delete an edge rule. To switch one off but keep it, save it with Enabled: false instead.

输入参数guid必填pull_zone_id必填

get_shield_zone

WAF (bunny Shield) state for a pull zone: zone settings (wafEnabled, wafExecutionMode, wafDisabledRules, wafLogOnlyRules, learningMode), custom WAF rules, rate limits and bot detection. Read `notes` first: it explains coded settings and warns when settings stop rules from acting.

输入参数pull_zone_id必填

shield_event_logs

Requests the WAF blocked, challenged or logged for a pull zone. Only the last 72 hours are available. Use group_by to summarise, e.g. ["ruleId"], ["ja4"] or ["ip"]. Events can take a minute to appear, so wait at least a minute after a change before judging it.

输入参数tofrom必填pagequerydetailgroup_bypage_sizepull_zone_id必填

update_shield_zone

Change WAF settings for a pull zone and return what changed. Fields use the names get_shield_zone returns: wafEnabled, wafExecutionMode (0 Log (no rule blocks, including custom Block rules), 1 Block), learningMode, wafDisabledRules, wafLogOnlyRules, dDoSShieldSensitivity and others. A list in `fields` replaces the whole list; to change part of a list use `add` or `remove`, e.g. add: {"wafDisabledRules": ["942100"]}.

输入参数addfieldsremovepull_zone_id必填

update_bot_detection

Change bot detection for a pull zone and return what changed. executionMode: 0 LogOnly, 1 Challenge. requestIntegrity, ipAddress and browserFingerprint each take {sensitivity: 0 Off, 1 Low, 2 Medium, 3 High}; browserFingerprint also takes aggression and complexEnabled. Read the current values with get_shield_zone.

输入参数ipAddresspull_zone_id必填executionModerequestIntegritybrowserFingerprint

save_waf_rule

Create a custom WAF rule (no rule_id) or update one (with rule_id; send the whole rule). To test a rule, save it with actionType 2 (Log), check shield_event_logs, then save it again with 1 (Block). Returns warnings when zone settings would stop the rule from acting.

输入参数rule_idruleName必填pull_zone_id必填ruleDescriptionruleConfiguration必填

save_rate_limit

Create a rate limit (no rule_id) or update one (with rule_id). Fields: ruleName and ruleDescription (letters, numbers and spaces only) and ruleConfiguration. Copy the ruleConfiguration shape from an existing rate limit in get_shield_zone.

输入参数rule_idruleName必填pull_zone_id必填ruleDescriptionruleConfiguration必填

delete_shield_rule

Permanently delete a custom WAF rule or a rate limit by its ID from get_shield_zone. To keep a WAF rule but stop it acting, save it with actionType 2 (Log) instead.

输入参数kind必填rule_id必填

版本历史

1
  1. v1.0.1最新Nov 4, 2026

评分

已满足适用检查项的 90%

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

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

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

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

其他 Bunny 集成