1. Conduid
  2. Browser
  3. Caddy
MCP server · Browser

Caddy

MCP server for managing Caddy web servers via the admin API

64Good

Scored just now · breakdown

About Caddy

Caddy is an MCP server published by YawLabs in the Browser category: mCP server for managing Caddy web servers via the admin API. Conduid read 18 tools from its source: caddy_adapt, caddy_add_route, caddy_config_by_id, caddy_config_delete, caddy_config_get, caddy_config_set and 12 more. It is published to npm as @yawlabs/caddy-mcp and starts with npx.

The repository has 15 stars and 2 forks, and its last commit was on 30 Nov 2026. Conduid has no tagged release on record for it. It passes all 1 static checks Conduid ran on the repository. Its topics include caddy, reverse-proxy, web-server and devtools.

Install

Claude Code
claude mcp add caddy -- npx -y @yawlabs/caddy-mcp
npx
npx -y @yawlabs/caddy-mcp
From source
git clone https://github.com/YawLabs/caddy-mcp

Tools (18)

caddy_adaptConvert a config in any registered adapter format to Caddy JSON without loading it. Useful for previewing what a Caddyfile produces, or for porting from nginx/yaml configs when Caddy is built with the matching adapter module ('caddyfile' is built-in; 'nginx', 'yaml', etc. require their adapter modules to be compiled into the Caddy binary). Returns the adapted JSON and any warnings separately. One exception to 'without loading it': on Caddy <= 2.11.4 a Caddyfile 'order' global option is not preview-only. It mutates that Caddy process's directive order, so it carries into every later Caddyfile adapt or load there, and an 'order' line that FAILS (unknown target, bad positional, extra arg) still removes the directive it names -- later Caddyfiles using that directive then fail with "directive 'X' is not an ordered HTTP handler" until another 'order' line re-places it or Caddy restarts. Fixed upstream in caddyserver/caddy#7995, released in v2.11.6.
ParameterTypeDescription
adapterstringConfig format adapter. Must match an adapter Caddy was built with. Built-in: 'caddyfile' (default). Common external adapters: 'nginx' (caddy-nginx-adapter), 'yaml' (caddy-yaml).
config *stringThe raw config text (e.g., Caddyfile contents, nginx.conf, yaml)
caddy_add_routeAdd a route with full control over match conditions and handlers. Supports any Caddy handler (reverse_proxy, file_server, static_response, redirect, encode, headers, etc.).
ParameterTypeDescription
handle *arrayArray of handler objects (e.g., [{ handler: 'file_server', root: '/var/www' }])
match *arrayArray of match objects (e.g., [{ host: ['example.com'], path: ['/api/*'] }])
serverstringCaddy server name (default: srv0)
terminalbooleanStop processing further routes after this one matches
caddy_config_by_idAccess config by @id tag. Any config object with an '@id' field can be read, updated, or deleted by its ID instead of needing its full path. This is the recommended way to manage individual routes and config objects. The 'delete' action requires confirm=true. Every 'set' and 'delete' first asks Caddy where `id` resolves, and refuses an id that does not resolve inside the config tree (including an unknown one). If Caddy resolves `id` to the config ROOT -- normally because it is the config's own top-level '@id', string or number -- it names the ENTIRE config: 'set' and 'delete' with no subpath (or a lone '...') then act on the whole configuration exactly as caddy_config_set and caddy_config_delete do at the config root -- 'set' replaces it and 'delete' unloads it, the 'admin' block included, so Caddy's admin endpoint can move and CADDY_ADMIN_URL stop reaching it. Both then require confirm=true, snapshot the prior config first so caddy_revert can restore it, and report where the admin endpoint went. A subpath inside it (e.g. 'apps/http') is an ordinary write.
ParameterTypeDescription
actionstringAction to perform
confirmbooleanMust be true to actually delete, and to 'set' when Caddy resolves `id` to the config root (that replaces the ENTIRE config). Ignored for every other 'set'.
id *stringThe @id value of the config object
modestringFor 'set' action: 'overwrite' = PATCH (replace the identified object, or the value at subpath; default). 'append' = POST and 'insert' = PUT behave as in caddy_config_set at the resolved path: with a subpath into an array, POST appends and PUT inserts at the index; PUT also strictly creates an object key (409 if it exists). With NO subpath: for an array element (a route) neither replaces it — POST adds the value as a new element at the end of that array, PUT inserts it just before the identified one, and both are rejected with 'duplicate ID' if the value carries the same @id; for an object held under a key (a server) POST REPLACES it wholesale and PUT fails with 409. Use 'overwrite' to replace in place.
subpathstringOptional sub-path within the identified object
valueanyNew value (required for 'set' action)
caddy_config_deleteDelete config at a JSON path. Removes the config node at the specified path. Deleting a parent node also deletes every descendant -- e.g. deleting 'apps/http/servers/srv0' removes that server and all of its routes. Requires confirm=true. Any path that addresses the config ROOT ('', '/', 'config', '/config/', slash-only variants of those, or any of those followed by a lone '...' segment) addresses the ENTIRE config and unloads it: every app and server goes, and so does the 'admin' block, after which Caddy re-binds its admin endpoint to its default address (localhost:2019, or $CADDY_ADMIN in Caddy's environment). If CADDY_ADMIN_URL points anywhere else, neither this server nor caddy_revert can reach Caddy afterwards. A root delete is snapshotted first, so caddy_revert can restore it while Caddy is still reachable; no other path is snapshotted. To REPLACE the config rather than unload it, use caddy_load.
ParameterTypeDescription
confirmbooleanMust be true to actually delete the config node (safety)
path *stringConfig path to delete (e.g., 'apps/http/servers/srv0/routes/0')
caddy_config_getRead Caddy config at any JSON path. Returns the full config when path is empty, or a subtree at a specific path (e.g., 'apps/http/servers/srv0/routes').
ParameterTypeDescription
pathstringConfig path (e.g., 'apps/http/servers/srv0')
caddy_config_setWrite config at a JSON path. Mode 'overwrite' (default) replaces the value at the path (PATCH) — idempotent, but it replaces the WHOLE subtree there: writing [] to '.../routes' drops every route. Mode 'append' (POST) adds to an array — NOT idempotent: calling twice with the same route duplicates it — but on a non-array key it REPLACES whatever is there, and it cannot create missing parent objects. Mode 'insert' (PUT) inserts at an array index (useful for route ordering), or strictly creates an object key together with any missing parents and fails with 409 if the key already exists — the safe way to create a server or app, including on an instance with no config at all. Any path that addresses the config ROOT ('', '/', 'config', '/config/', a slash-only variant, or any of those followed by a lone '...' segment) addresses the ENTIRE config and requires confirm=true: 'overwrite' and 'append' there REPLACE the whole configuration with `value` — Caddy runs it exactly as caddy_load would — so every app, server and route not in `value` is discarded, and so is the 'admin' block unless `value` carries one. Caddy then re-binds its admin endpoint to the new config's admin.listen, or to its default address (localhost:2019, or $CADDY_ADMIN in Caddy's environment) when it sets none, or to no address at all when it sets admin.disabled; if CADDY_ADMIN_URL points anywhere else, neither this server nor caddy_revert can reach Caddy afterwards. A root write is snapshotted first, so caddy_revert can restore it while Caddy is still reachable; no other path is snapshotted. 'insert' at the root only succeeds after a root caddy_config_delete (Caddy answers 409 on any other instance, including one started with no config), and 'overwrite' is the reverse: after a root caddy_config_delete it answers 404 until 'append', 'insert' or caddy_load re-creates the config. To replace the whole config deliberately, caddy_load does the same thing behind the same gate and also accepts a Caddyfile.
ParameterTypeDescription
confirmbooleanMust be true when `path` addresses the config root ('', '/', 'config', '/config/', slash-only variants, or a lone '...' segment): that write replaces the ENTIRE config (safety). Ignored for every other path.
modestring'overwrite' = PATCH (replace existing, default, idempotent; 404 if the key does not exist), 'append' = POST (appends to arrays, NOT idempotent; REPLACES an existing non-array key; cannot create missing parents), 'insert' = PUT (inserts at an array index, or strictly creates an object key and any missing parents; 409 if the key exists)
path *stringConfig path to write to (e.g., 'apps/http/servers/srv0/routes')
value *anyThe JSON value to set at the path
caddy_list_routesList all routes on a Caddy HTTP server with a human-readable summary of matchers and handlers, followed by the raw route JSON. Both halves are capped on large servers: the summary at 500 routes, the JSON at 20000 characters (truncated on whole-route boundaries, so it always parses). When either cap trims output, a note says how many routes were omitted -- read the rest with caddy_config_get at 'apps/http/servers/<server>/routes'.
ParameterTypeDescription
serverstringCaddy server name (default: srv0)
caddy_list_serversList all configured HTTP servers with their names, listen addresses, route counts, and TLS status. Use this to discover server names before calling route tools. The TLS label assumes Caddy's default http_port 80 and https_port 443: on a config that sets a custom apps/http http_port or https_port it can be wrong, so use caddy_status, which reads them, for an accurate label.
caddy_loadReplace the entire Caddy configuration atomically. Accepts a JSON config object, or a Caddyfile string with format='caddyfile'. This is the safest way to make large config changes. Runs on CADDY_LOAD_TIMEOUT (55 s by default), like every config change; a load that times out is not retried and may still apply, so re-read the config before loading again. Requires confirm=true: this DISCARDS the entire running config, including servers and routes not present in the supplied config. The prior config is snapshotted first and can be restored with caddy_revert.
ParameterTypeDescription
config *anyFull config — JSON object or Caddyfile text string
confirmbooleanMust be true to replace the running configuration (safety)
formatstringConfig format: 'json' (default) or 'caddyfile'
caddy_metricsGet Prometheus metrics from Caddy. Shows request counts, durations, TLS handshake stats, active connections, and more. Output can be megabytes on busy servers -- use `filter` to keep only metrics whose name contains a substring (e.g. 'http_requests' or 'tls'); HELP/TYPE comment lines for retained metrics are kept. Filter-mode drops blank lines and free-form '# comment' lines, keeping only '# HELP'/'# TYPE' lines for matching metrics; the '# EOF' end-of-file marker is always preserved. Use `max_lines` to cap the response (default 500); a trailing comment reports how many lines were dropped.
ParameterTypeDescription
filterstringSubstring to match against metric names. Keeps sample lines whose metric name contains this substring, plus their `# HELP` and `# TYPE` comment lines. Empty/absent = no filtering. Label values are NOT matched -- use a Prometheus-aware client for label filtering.
max_linesnumberMaximum number of output lines (default 500). Excess lines are dropped and a summary is appended.
caddy_pkiGet PKI certificate authority info or the CA certificate chain.
ParameterTypeDescription
castringCA ID (default: 'local')
certificatesbooleanIf true, return the full CA certificate chain
caddy_remove_routeRemove a route. Target by @id (preferred — stable across reorderings) or by array index on a specific server. Index-based removal is a two-step read-then-delete and can race against concurrent edits; prefer @id when possible. Only the @id mode is idempotent: a repeat call cannot remove a different route, it just reports the id as gone. The index mode is NOT — Caddy re-packs the routes array after a removal, so calling with index 2 twice removes TWO DIFFERENT routes. @ids are config-global in Caddy (NOT route-scoped): if `id` resolves to a non-route object (TLS issuer, server, etc.) the call refuses rather than deleting it.
ParameterTypeDescription
confirmbooleanMust be true to actually remove the route (safety)
idstringThe @id of the route to remove (preferred — stable even if routes get reordered)
indexnumberZero-based index of the route in the server's routes array (only used if id is not provided)
serverstringCaddy server name when using index (default: srv0). Ignored when id is provided.
caddy_reverse_proxyAdd a reverse proxy route. The most common operation — just specify where traffic comes from and where it goes. Example: from='api.local' to=['localhost:3000']. When `id` is OMITTED the route is appended to the server's routes array — calling the tool twice with the same args produces TWO duplicate routes (non-idempotent). When `id` is SUPPLIED the route is written via PATCH under that @id, so repeat calls REPLACE in place (idempotent). Strongly recommended: supply a stable `id` for any route managed from automation or production tooling. Note: @ids are config-global in Caddy (NOT route-scoped). If `id` collides with an @id used by a non-route object (TLS issuer, server, etc.) the call refuses with an error rather than clobbering it. Once an @id is registered to a route under one server, subsequent calls update that route in place regardless of the `server` argument. Upstream scheme is honored: an `https://` upstream gets a TLS transport and defaults to port 443, anything else is dialed in the clear. A `to` list that MIXES https:// and non-https entries is refused — the TLS transport applies to the whole handler, not per-upstream — so split those into two routes or use caddy_add_route.
ParameterTypeDescription
from *stringDomain, path, or domain/path to match (e.g., 'api.local', '/api/*', 'app.local/ws')
idstringOptional stable @id for the route. When set, repeat calls REPLACE the route in place (idempotent). When omitted, the route is APPENDED — calling twice with identical args creates a duplicate route. @ids are config-global in Caddy: if this id is already used by a non-route object the call refuses rather than clobbering it.
serverstringCaddy server name (default: srv0)
to *arrayUpstream addresses, at least one (e.g., ['localhost:3000', 'localhost:3001']). An 'https://' prefix dials the upstream over TLS (port 443 unless one is given); http:// and bare addresses are dialed in the clear. Do not mix https:// and non-https entries in one call. An http(s):// entry with a path, query or fragment is refused: a dial is host and port only, so rewrite the path with a separate handler instead.
caddy_revertManage config snapshots for rollback. Snapshots are auto-captured before caddy_load, and before a caddy_config_delete or caddy_config_set at the config root (any path that addresses the whole config), and before a caddy_config_by_id set or delete whose @id resolves to the root with no subpath (or a lone '...'); no other delete or set is snapshotted. Last 10. By default they live in memory only and are LOST when this server restarts -- set CADDY_MCP_SNAPSHOT_DIR to a writable directory to persist them across restarts (they contain full Caddy configs, so pick the location deliberately). Actions: 'list' shows snapshots with timestamps, 'save' manually captures the current config, 'apply' restores a snapshot (requires confirm=true).
ParameterTypeDescription
action *stringAction to perform
confirmbooleanMust be true to actually apply a snapshot (safety)
indexnumberSnapshot index for 'apply' (0 = most recent, default)
caddy_statusCheck Caddy connectivity and get a config summary: servers, routes, listen addresses, and TLS status.
caddy_stopGracefully shut down the Caddy server. Requires confirm=true to prevent accidental shutdown.
ParameterTypeDescription
confirm *booleanMust be true to confirm shutdown
caddy_tlsGet or configure TLS/HTTPS settings. Actions: 'status' shows current TLS config, 'set_email' sets the ACME email, 'set_acme_ca' sets the ACME CA URL, 'set_acme_profile' sets the ACME profile (Caddy 2.10+), 'ech_status' reads the Encrypted ClientHello config at apps/tls/encrypted_client_hello (Caddy 2.10+, read-only here). Works on both fresh and existing Caddy instances, including one with no config at all: the set_* actions create apps/tls, and any missing parents, when it is not set. Writes target policies[0].issuers[0] only. When that issuer already carries the field, it is overwritten in place, whatever the issuer's module; when it does not, the field is merged in only if that issuer's module is 'acme', and refused otherwise. On a multi-policy TLS config, or one whose first issuer is 'internal' (Caddy's local CA), edit the intended issuer with caddy_config_set instead.
ParameterTypeDescription
action *stringAction to perform
castringACME CA URL (for 'set_acme_ca' action)
emailstringACME email address (for 'set_email' action)
profilestringACME profile name (for 'set_acme_profile'). Requires Caddy 2.10+ and a CA that offers profiles; Let's Encrypt uses 'shortlived' for 6-day certificates. Valid names are defined by the CA, not by Caddy. EXPERIMENTAL upstream (the ACME profiles spec is still a draft; Caddy marks the field 'subject to change' and may rename or drop it). Caddy accepts any name on load, so a success here does not mean the CA offers it: if this issuer's CA does not advertise the name, every order from this issuer fails at issuance time, reported only in Caddy's own logs. Caddy then either falls through to the next issuer in the policy, which issues WITHOUT the profile, or -- when this is the policy's only issuer, which is the shape this tool creates -- keeps retrying and issues no certificate at all.
caddy_upstreamsCaddy's /reverse_proxy/upstreams array (address, num_requests, fails), returned verbatim. On Caddy 2.11.2+ it is not the configured upstream list. Dynamic-upstream backends stay listed about 1 h (up to ~65 min) after the dynamic source last returned them, even after a config change removes them, so an address may appear that no current config references. A backend with requests in flight can appear twice when its resolved address differs from the entry's text (dynamic upstreams, tcp/ or unix// dials, placeholder dials). That extra copy always shows fails 0 and repeats num_requests, so do not sum num_requests across entries.

Security checks

  • ✓README presentThe repository's README runs to about 1.5K words.

5 checks have not been run yet.

README

The repository's README runs to about 1.5K words. The original in the repository is authoritative.

Read full README
Questions

About Caddy

How do I install Caddy?

In Claude Code, run claude mcp add caddy -- npx -y @yawlabs/caddy-mcp. Other MCP clients take the command after "--" in their server configuration.

Is Caddy safe to use with an AI agent?

Its trust score is 64 out of 100 (good). It passes all 1 static checks Conduid ran on the repository. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Caddy still maintained?

Yes — the last commit was 2 days ago. The repository has 15 stars and 2 forks.

What tools does Caddy provide?

Conduid read 18 tools from the source: caddy_adapt, caddy_add_route, caddy_config_by_id, caddy_config_delete, caddy_config_get, caddy_config_set, caddy_list_routes, caddy_list_servers and 10 more. 15 of them publish their parameters, listed under Tools above.