bunny.net CDN and Shield

v1.0.1
io.github.fullfatthings/bunny-mcp Checked 18 hours ago Published 27 days ago

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

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

list_pull_zones

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

ParameterTypeDescription
pageinteger
perPageinteger
searchstringFilter by name or hostname

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.

ParameterTypeDescription
pull_zone_id *integerPull zone ID from list_pull_zones
detailbooleanReturn the full raw object. Default false
fieldsarrayRaw field names to return, e.g. ["OptimizerEnabled"]

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.

ParameterTypeDescription
date_fromstringISO 8601 date
date_tostringISO 8601 date
hourlyboolean
load_errorsboolean
pull_zone_idintegerPull zone ID from list_pull_zones

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.

ParameterTypeDescription
fields *object
pull_zone_id *integerPull zone ID from list_pull_zones

purge_cache

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

ParameterTypeDescription
cache_tagstringWith pull_zone_id: purge only this cache tag
pull_zone_idintegerPull zone ID from list_pull_zones
urlstring

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 Authen…

ParameterTypeDescription
pull_zone_id *integerPull zone ID from list_pull_zones
rule *object

set_edge_rule_enabled

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

ParameterTypeDescription
enabled *boolean
guid *stringEdge rule Guid from get_pull_zone
pull_zone_id *integerPull zone ID from list_pull_zones

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.

ParameterTypeDescription
date *stringDay to read, as YYYY-MM-DD (UTC)
pull_zone_id *integerPull zone ID from list_pull_zones
detailbooleanReturn the raw entries, including request headers (very large). Default false

delete_edge_rule

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

ParameterTypeDescription
guid *stringEdge rule Guid from get_pull_zone
pull_zone_id *integerPull zone ID from list_pull_zones

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.

ParameterTypeDescription
pull_zone_id *integerPull zone ID from list_pull_zones

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.

ParameterTypeDescription
from *stringISO 8601 date-time, within the last 72 hours
pull_zone_id *integerPull zone ID from list_pull_zones
detailbooleanInclude each group's full context object (large). Default false
group_byarray
pageintegerZero-based
page_sizeintegerDefault 50
querystringFree text across IP, ruleId, URL, User-Agent and rule name
tostringISO 8601 date-time; defaults to now

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"]}.

ParameterTypeDescription
pull_zone_id *integerPull zone ID from list_pull_zones
addobjectItems to add to list fields
fieldsobject
removeobjectItems to remove from list fields

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.

ParameterTypeDescription
pull_zone_id *integerPull zone ID from list_pull_zones
browserFingerprintobject
executionModenumber0 LogOnly, 1 Challenge
ipAddressobject
requestIntegrityobject

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.

ParameterTypeDescription
pull_zone_id *integerPull zone ID from list_pull_zones
ruleConfiguration *object
ruleName *string
ruleDescriptionstring
rule_idinteger

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.

ParameterTypeDescription
pull_zone_id *integerPull zone ID from list_pull_zones
ruleConfiguration *object
ruleName *string
ruleDescriptionstring
rule_idinteger

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.

ParameterTypeDescription
kind *string
rule_id *integer