BunkerWeb

v0.8.0
io.github.bunkerity/bunkerweb-mcp Checked 9 hours ago Published 1 day ago

Operate BunkerWeb, the open-source WAF, through its API: services, bans, configs, jobs.

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

create_api_token Create API token

Create a BunkerWeb API token (Biscuit) for use outside this server; returns only the token, a live credential to keep secret. Give username and password, or omit both to use the server's credentials. Needs an API user; lifetime is BunkerWeb's API_BISCUIT_TTL_SECONDS. Redaction may mask it.

ParameterTypeDescription
passwordPassword of that API user
payloadExtra JSON fields for the /auth body; a username or password in it overrides the parameters
usernameAPI user name; give it with password, or omit both to use the server's credentials

ping_api Ping API

Check that the BunkerWeb API answers (GET /ping, returns pong); needs no credentials. The fastest liveness probe. Use diagnose_bunkerweb to also check authentication, version and instances, ping_instances to reach the instances themselves.

diagnose_bunkerweb Diagnose BunkerWeb

Read-only report on the connected BunkerWeb: API reachability, authentication, version, MULTISITE and instance counts; service (a service ID) adds its existence, draft state and setting owners. A failed check shows as FAIL or null, not an error. Use ping_api for a bare probe.

ParameterTypeDescription
serviceOptional service ID (its first SERVER_NAME) to also check existence, draft state and setting owners

list_instances List instances

List every registered BunkerWeb instance (hostname, name, port, method, status, last_seen). Cached up to 60 s. This is registration data, not a live check: use ping_instances for reachability, get_instance for one host.

ping_instances Ping instances

Ping one instance (hostname) or every registered instance (hostname omitted) and return each answer; BunkerWeb replies 502 if any ping fails. Read-only. Use list_instances for registration data without pinging.

ParameterTypeDescription
hostnameHostname of one instance, as returned by list_instances; omit to ping every instance

stop_instances Stop instances

Stop one instance (hostname) or every registered instance (all=true), never both; stopped instances serve no traffic until restarted outside this API. 502 if a stop is not acknowledged. Use reload_instances to apply config instead. Acts on the instances immediately.

ParameterTypeDescription
allbooleanAct on every registered instance; give it or hostname, not both
hostnameHostname of one instance, as returned by list_instances; give it or all=true, not both

get_instance Get instance

Fetch one registered instance by hostname (name, ports, server_name, method, status, last_seen); 404 if unknown. Cached up to 60 s. Use list_instances to find hostnames, ping_instances to test reachability.

ParameterTypeDescription
hostname *stringInstance hostname

create_instance Create instance

Register an instance (hostname may carry a scheme and port, https://host:5443). Name defaults to 'manual instance', method to api; fails if it exists. Use update_instance to change one. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
hostname *stringHostname or IP the scheduler uses to reach the instance API
https_portInstance API HTTPS port
listen_httpsWhether the instance API is reached over HTTPS
methodSource method tag recorded on the instance
nameFriendly instance name
portInstance API HTTP port (API_HTTP_PORT)
server_nameHost header sent to the instance API (API_SERVER_NAME)

update_instance Update instance

Change a registered instance's name, ports, HTTPS flag, server_name or method; omitted fields keep their value. Unknown or read-only instances are rejected. Use create_instance for a new host. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
hostname *stringHostname of the registered instance to update
https_portNew instance API HTTPS port; omit to keep
listen_httpsReach the instance API over HTTPS; omit to keep
methodNew source method tag; omit to keep
nameNew friendly name; omit to keep
portNew instance API HTTP port; omit to keep
server_nameNew Host header for the instance API; omit to keep

delete_instances Delete instances

Unregister instances by hostname; use list_instances to find them. Hosts keep running (stop_instances halts them). Only UI/API-registered ones go; others come back as skipped, 404 if none can. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
instances *arrayHostnames to unregister, as list_instances returns them

reload_instances Reload instances

Reload configuration on one instance (hostname) or every registered instance (all=true), never both. test=true (default) checks the config first, then reloads; test=false reloads without the check. Returns only success or a 502 error. Use stop_instances to halt. Acts on the instances immediately.

ParameterTypeDescription
allbooleanAct on every registered instance; give it or hostname, not both
hostnameHostname of one instance, as returned by list_instances; give it or all=true, not both
testbooleanTest the configuration first and reload only if the test passes; this still reloads, it is not a dry run.

list_bans List bans

List active bans as each instance reports them (ip, scope, service, kind, incl. CrowdSec entries), grouped per instance. Cached up to 30 s. Use it to check whether an IP is banned, or for the exact ip and service that unban_ips when writes are enabled needs.

ParameterTypeDescription
limitMaximum items to return, 1 to 1000; default 100
offsetintegerItems to skip; pass next_offset from the previous page to read the next one

ban_ips Ban IPs

Ban IPs on every instance: bans is a list of {ip, exp, reason, service}, exp in seconds (0 = permanent), service omitted for global. All IPs are validated before any is banned. Use unban_ips to lift a ban. Acts on the instances immediately.

ParameterTypeDescription
bans *arrayList of ban requests

unban_ips Unban IPs

Lift bans for IPs on every instance, globally or per service; match the scope list_bans shows. An IP also blocked by CrowdSec may be refused (409). Use list_bans first to find them. Acts on the instances immediately.

ParameterTypeDescription
bans *arrayList of unban requests

list_services List services

List services (id, method, is_draft, template, security mode, dates); with_drafts=false hides drafts. Cached up to 5 min. Use get_service for one service's settings, get_global_config for global ones.

ParameterTypeDescription
limitMaximum items to return, 1 to 1000; default 100
offsetintegerItems to skip; pass next_offset from the previous page to read the next one
with_draftsbooleanInclude draft services

get_service Get service

Read one service's settings by ID (its first SERVER_NAME), with the method that set each; full=true adds defaults, with_drafts=false hides drafts. 404 if unknown. Cached up to 5 min. Use list_services to find IDs, get_global_config for global ones.

ParameterTypeDescription
service *stringService ID (its first SERVER_NAME), as list_services returns it
fullbooleanInclude derived defaults
methodsbooleanInclude method metadata
with_draftsbooleanInclude draft services

create_service Create service

Create a service named by SERVER_NAME (first word becomes its ID) with optional unprefixed settings and a draft flag. Fails if the name or a server name is taken. Use update_service to change one. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
server_name *stringServer name; its first word becomes the service ID
is_draftbooleanCreate as an unpublished draft
variablesUnprefixed per-service setting names and values, e.g. {"USE_MODSECURITY": "yes"}

update_service Update service

Change a service's settings, rename it or set is_draft; needs MULTISITE=yes. Unknown or externally owned keys are skipped, and a receipt reads back the stored values. Use update_global_config for global. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
service *stringExisting service identifier
is_draftTrue makes the service an unpublished draft, false publishes it
server_nameRename the service
variablesUnprefixed per-service setting names and values; unknown or externally owned names are skipped and reported.

delete_service Delete service

Delete a service and all its settings, not reversible; wizard-managed services are refused. Use update_service with is_draft=true to take one offline instead. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
service *stringService ID (its first SERVER_NAME) to delete, with all its settings

get_global_config Get global config

Read global settings; full=true adds defaults, methods=true adds the method that set each. Cached up to 10 min. Use get_service for one service's settings.

ParameterTypeDescription
fullbooleanInclude defaulted settings
methodsbooleanInclude method metadata

update_global_config Update global config

Set global settings from key-value pairs; settings you omit are kept, values are stored as strings. Use update_service for one service's settings. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
config *objectGlobal setting names and values, e.g. {"USE_ANTIBOT": "no"}; stored as strings

list_configs List configs

List custom config snippets (service, type, name, draft flag), optionally with content, across every scope unless filtered. Use get_config to read one snippet in full.

ParameterTypeDescription
serviceFilter by service ID; omit or 'global' to list every scope, global included
typeFilter by type. Custom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after
with_databooleanInclude each snippet's content; false returns metadata only
with_draftsbooleanInclude snippets of draft services

get_config Get config

Read one custom config snippet with its content, by service, type and name; 404 if unknown. Use list_configs to find snippets.

ParameterTypeDescription
name *stringSnippet name: letters, digits, _ or -, no extension
type *stringCustom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after
serviceService ID that owns the snippet; omit or 'global' for global

create_config Create config

Create one custom config snippet from text (method api); fails if the name exists or the service is unknown. Use create_configs_from_files to upload files. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
data *stringSnippet content as UTF-8 text, e.g. nginx or ModSecurity directives
name *stringSnippet name: letters, digits, _ or -, no extension
type *stringCustom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after
is_draftbooleanCreate as draft
serviceService ID that owns the snippet; omit or 'global' for global

update_config Update config

Edit, rename or move a snippet from text; omitted fields keep their value. UI/API-managed or template-derived only; templates cannot be renamed. A no-op is rejected. Use update_config_from_file for files. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
name *stringSnippet name: letters, digits, _ or -, no extension
type *stringCustom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after
dataNew snippet content; omit to keep
is_draftSet the draft flag; omit to keep
new_nameRename the snippet; omit to keep
new_serviceMove to this service; omit to keep
new_typeChange the type; omit to keep
serviceService ID that owns the snippet; omit or 'global' for global

delete_configs Delete configs

Delete config snippets: configs is a list of {service, type, name}, service 'global' for global ones. Only UI/API-managed ones go; others come back as skipped, 404 if none. Use list_configs to find them. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
configs *arraySnippets to delete, each by service, type and name

create_configs_from_files Create configs from files

Create snippets from base64 files ({filename, content_base64}) sharing one type and service; each is named after its sanitized file stem and bad files are reported, not fatal. Use create_config for text. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
config_type *stringType for every uploaded file. Custom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after
files *arrayFiles to create, one snippet per file, named after the sanitized file stem
is_draftbooleanCreate as draft
serviceService ID for every file; omit or 'global' for global

update_config_from_file Update config from file

Replace a snippet from a base64 file ({filename, content_base64}); without new_name the stem renames it. UI/API-managed or template-derived only; templates cannot be renamed. Use update_config for text. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
file *File whose content replaces the snippet's
name *stringSnippet name: letters, digits, _ or -, no extension
type *stringCustom config type, e.g. http, server-http, default-server-http, stream, server-stream, modsec, modsec-crs, crs-plugins-before, crs-plugins-after
new_is_draftSet the draft flag; omit to keep
new_nameNew name; if omitted the file stem renames the snippet, so pass the current name to keep it
new_serviceMove to this service; omit to keep
new_typeChange the type; omit to keep
serviceService ID that owns the snippet; omit or 'global' for global

list_plugins List plugins

List installed plugins, filtered by type (all, external, ui, pro). type=ui lists the IDs accepted by uninstall_plugin when writes are enabled. Use list_jobs for jobs.

ParameterTypeDescription
typestringPlugin type filter: all, external, ui or pro
with_databooleanInclude each plugin's archive data

install_plugins Install plugins

Install UI plugins from base64 archives ({filename, content_base64}; .zip, .tar.gz, .tar.xz with plugin.json). An existing plugin ID is refused; bad archives are reported. Uninstall first to replace. Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
files *arrayPlugin archives (.zip, .tar.gz or .tar.xz), base64 encoded
methodstringInstallation method; the API supports only ui

uninstall_plugin Uninstall plugin

Uninstall one UI-installed plugin by plugin_id; external and pro plugins are refused, 404 if absent. Use list_plugins type=ui to find IDs, install_plugins to add one (uninstall first to replace). Saved to the database; the scheduler applies it later; this tool cannot confirm it is live.

ParameterTypeDescription
plugin_id *stringID of a UI plugin, as returned by list_plugins type=ui

list_cache_files List cache files

List files that scheduler jobs cached (service, plugin, job, file name, checksum, last_update). with_data inlines text only; binary files show a placeholder, so read them with get_cache_file download=true. Use get_cache_file to read one.

ParameterTypeDescription
job_nameFilter by job name
limitMaximum items to return, 1 to 1000; default 100; 10 with with_data
offsetintegerItems to skip; pass next_offset from the previous page to read the next one
pluginFilter by plugin ID, e.g. letsencrypt
serviceFilter by service ID; omit or 'global' to list every scope, global included
with_databooleanInclude text file contents inline; false returns metadata only

delete_cache_files Delete cache files

Delete job cache files: files is a list of {service, plugin, job_name, file_name} service omitted for global. Use list_cache_files to find the keys. Missing files are reported per file; run_jobs regenerates them. Queued for the scheduler; this tool cannot confirm it ran.

ParameterTypeDescription
files *arrayCache files to delete, each keyed as in list_cache_files

get_cache_file Get cache file

Read one job cache file by service, plugin, job_name and file_name as list_cache_files shows. Returns printable text; download=true returns base64 bytes instead. 404 if missing; sensitive files are refused when secret redaction is on. Use list_cache_files to find files.

ParameterTypeDescription
file_name *stringFile name, as listed by list_cache_files
job_name *stringJob that wrote the file, as listed by list_cache_files
plugin *stringPlugin ID that owns the file, as listed by list_cache_files
downloadbooleanTrue returns the raw bytes as data_base64; false returns JSON with printable text only
serviceService ID that owns the file; omit for global

list_jobs List jobs

List scheduler jobs with their run history and cache metadata. Use list_cache_files for the files they wrote, and run_jobs when writes are enabled to trigger them.

ParameterTypeDescription
limitMaximum items to return, 1 to 1000; default 20
offsetintegerItems to skip; pass next_offset from the previous page to read the next one

run_jobs Run jobs

Trigger every job of the listed plugins (jobs: {plugin, name}; name is informational, all of a plugin's jobs run), e.g. after delete_cache_files. Returns only 'Jobs scheduled'; use list_jobs to check results. Queued for the scheduler; this tool cannot confirm it ran.

ParameterTypeDescription
jobs *arrayJobs to trigger, as list_jobs shows; each plugin's jobs all run

search_bunkerweb_docs Search BunkerWeb docs

Search the official BunkerWeb documentation by meaning, in any language. Returns up to limit sections with title, URL, category, relevance and content, one per document. Use it for how-to and setting questions; use the API tools to read live state. Lower min_score if nothing matches.

ParameterTypeDescription
query *stringQuestion or topic in natural language, any language
categoryOptional docs section filter, e.g. api, plugins, features
limitintegerMaximum results to return, 1 to 50
max_content_lengthintegerCharacters of content per result; 0 returns full sections
min_scorenumberRelevance threshold from 0 to 1; lower it when nothing matches