caddy_config_get
Read 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').
path
io.github.YawLabsPublished by GitHub account YawLabsv2.6.3Updated Nov 16, 2026
MCP server for managing Caddy web servers via the admin API
Manages a Caddy web server through its admin API: read and write config, add reverse proxy routes, adjust TLS, and read metrics.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Follow the launch instructions in the repository.
One click adds this to your local Yaw MCP config so it's available in every Yaw Terminal session. Or install manually below.
[npm version] [License: MIT] [GitHub stars]
Manage Caddy web servers from Claude Code, Cursor, and any MCP client. 18 tools + 4 resources covering every endpoint in Caddy's admin API reference — config, routes, reverse proxies, TLS, PKI, metrics, snapshots.
Built and maintained by Yaw Labs.
Other Caddy MCP servers wrap half the admin API and silently swallow errors. This one doesn't.
/load, /config/*, /id/*, /stop, /adapt, /pki/ca/*, /reverse_proxy/upstreams, /metrics. No placeholder tools that 404. Caddy's Go runtime debug endpoints (/debug/pprof/*, /debug/vars) are deliberately not wrapped — for leak trends use caddy_metrics with filter: "go_goroutines" or "go_memstats", which come from the same admin registry; for stack dumps, CPU profiles and traces, curl the admin endpoint directly (Caddy profiling docs).If-Match) so your changes never silently overwrite someone else's. Surfaces HTTP 412 Precondition Failed as a clear message, not a cryptic error.caddy_config_set defaults to idempotent overwrite (PATCH), not append (POST). Calling twice doesn't duplicate your route. A write to the config root — which replaces the entire config, admin endpoint included — is refused without confirm=true and snapshotted first, like caddy_load.caddy_list_routes never crashes on malformed config, even if routes are null, handlers are strings, or matchers are non-arrays. Regression-tested.CADDY_ADMIN_URL contains a token in the path/query, the connect-failed message shows only the origin.readOnlyHint, destructiveHint, and idempotentHint, so MCP clients can skip confirmations for safe ops.node_modules install.@id values, server names, and CA ids are all regex-validated with length caps. Blocks CRLF header injection and ReDoS.1. Enable the Caddy admin API
Caddy ships with the admin API enabled on localhost:2019 by default. If you're running Caddy in Docker or on a remote host, expose it via CADDY_ADMIN_URL.
2. Create .mcp.json in your project root
macOS / Linux / WSL:
Windows:
Why the extra step on Windows? Since Node 20,
child_process.spawncannot directly execute.cmdfiles (that's whatnpxis on Windows). Wrapping withcmd /cis the standard workaround. This file is safe to commit — it contains no secrets.
3. Restart and approve
Restart Claude Code (or your MCP client) and approve the Caddy MCP server when prompted.
That's it. Now ask your AI assistant:
"Proxy api.local to localhost:3000"
"What routes are configured on srv0?"
"Show me the Prometheus metrics"
Unix socket admin endpoints:
Caddy's recommended hardening is to move the admin API off a loopback port and onto a unix socket, where access is governed by filesystem permissions:
Point CADDY_ADMIN_URL at the same path (unix:///var/run/caddy-admin.sock)
and requests are sent over the socket instead of TCP. The process running
caddy-mcp needs read/write permission on the socket file. Leave
CADDY_API_TOKEN unset here unless an authenticating proxy actually listens on
that socket: over a unix path caddy-mcp is usually talking to Caddy's own
socket, where the token does nothing — and, before Caddy 2.11.3, is logged in
clear.
Runtime (oam or Node):
The caddy-mcp command prefers oam when it finds a usable
one and otherwise runs on Node. It never serves on an oam older than 0.20.2.
An outdated oam is fixed with oam self-update. Under Yaw MCP, which runs servers
on oam by default, yaw-mcp set <namespace> runtime=node switches this server to
Node.
Alternate MCP clients:
Use the same JSON block shown above in any of these.
overwrite (PATCH, default, idempotent; the key must exist, and the whole subtree at the path is replaced), append (POST: appends to an array, but replaces an existing non-array key and cannot create missing parents), insert (PUT: inserts at an array position, or strictly creates a key along with any missing parents and fails with 409 if it exists — the way to create a server or app, even on an instance with no config). append at a path ending in /... (e.g. apps/http/servers/srv0/routes/...) with an array value appends every element in one request — all or nothing, one reload; without the /..., an array value is added as a single element and Caddy rejects the load for typed arrays like routes or listen. A 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, exactly as caddy_load would, including the admin block unless value carries one — after which Caddy re-binds its admin endpoint to the new config's admin.listen, to its default address when it sets none, or to no address at all when it sets admin.disabled, and a CADDY_ADMIN_URL pointing anywhere else stops working. A root write auto-snapshots the prior config first (when it can be read) so caddy_revert can restore it; no other path is snapshotted. insert at the root only succeeds after a root caddy_config_delete (409 otherwise), and overwrite is the reverse: after a root delete it answers 404 until append, insert or caddy_load re-creates the config.confirm=true (deleting a parent path also removes every descendant). A 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: it unloads every app and server plus 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 caddy-mcp nor caddy_revert can reach Caddy afterwards. A root delete auto-snapshots the prior config first (when it can be read), 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.@id tag — much easier than navigating deep paths. The delete action requires confirm=true. Every set and delete first asks Caddy where the id resolves, and refuses one that does not resolve inside the config tree. If it resolves 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 replace or unload the whole configuration, exactly as a root caddy_config_set / caddy_config_delete does — both require confirm=true, snapshot the prior config first, and report where the admin endpoint went. A subpath inside it is an ordinary write.CADDY_LOAD_TIMEOUT (55 seconds by default), like every config change. Auto-snapshots the prior config, and keeps that snapshot when the load times out with its outcome unknown. Lists the Caddyfile adapter's warnings, and reports a load that failed as an error even when Caddy answered HTTP 200 — which Caddy 2.11.4 does for a Caddyfile that adapted with warnings (caddyserver/caddy#7246). format is json (default) or caddyfile; stock Caddy registers only the caddyfile adapter, so for any other adapter compiled into a custom build, adapt first with caddy_adapt and load the JSON (the Atomic deploy example below).list, save, apply (confirm-gated). In-memory, last 10. Auto-captured before caddy_load, and before a caddy_config_delete, caddy_config_set or caddy_config_by_id that addresses the config root. An apply that times out with its outcome unknown keeps the pre-revert config as snapshot [0], which shifts every older snapshot down one index; the error says where the target now sits.from='api.local' to=['localhost:3000']. Pass an optional id for idempotent writes — repeat calls replace the route in place instead of duplicating.@id (preferred) or by index. Requires confirm=true.status, set_email (ACME email), set_acme_ca (ACME CA URL), set_acme_profile (ACME profile, Caddy 2.10+ — experimental upstream: the ACME profiles spec is still a draft and Caddy marks the field subject to change. Caddy accepts any profile name on load, so a name the CA does not advertise fails only at issuance, in Caddy's own logs), and the read-only ech_status (the Encrypted ClientHello config at apps/tls/encrypted_client_hello, Caddy 2.10+). The set actions PATCH first; when apps/tls is not set they PUT a minimal config, which also creates any missing parents, so they work on an instance with no config at all. On an existing config they deep-merge into the issuer path and PATCH the result back, preserving siblings (custom certs, on_demand, additional policies). Refuses with a shape-specific error if the existing structure is unexpected — never clobbers.caddyfile (built-in, default) plus any adapter module compiled into your Caddy binary — e.g., nginx (caddy-nginx-adapter), yaml (caddy-yaml). Great for previewing or porting from existing configs. One caveat on Caddy 2.11.4 and earlier: a Caddyfile order global option is not preview-only. It mutates that Caddy process's directive order, so it carries into later Caddyfile adapts and loads in the same process, and an order line that fails still removes the directive it names (caddyserver/caddy#7995, fixed upstream but unreleased as of 2.11.4).enabled, enabled (no listener gets TLS: all are on the HTTP port), auto (HTTPS), auto (HTTPS: host matchers on a non-HTTP port), mixed (TLS on non-HTTP listeners only), off (HTTP only), off (no host matchers), off (automatic HTTPS disabled) or off (empty tls_connection_policies). The two qualified enabled readings come from Caddy deciding TLS per socket rather than per server (app.go:535): connection policies are ignored on the HTTP-port listener, so a server that binds only that port is configured for TLS and serves none of it.caddy_status, but this tool reads only apps/http/servers and so assumes the default http_port 80 / https_port 443 — on an instance with custom ports, caddy_status is the one that gets the label right./reverse_proxy/upstreams array returned verbatim. On Caddy 2.11.2+ this is not the configured upstream list: dynamic upstreams stay listed about 1 h after the dynamic source last returned them (so an address can outlive the config that referenced it), and a backend with requests in flight can appear twice when its resolved address differs from the entry's dial text. The extra copy always shows fails 0 and repeats num_requests — do not sum num_requests across entries.filter (substring match on metric name, keeps # HELP / # TYPE lines for retained metrics) and max_lines (default 500) keep responses compact on busy servers.local).confirm=true to prevent accidents.Browsable read-only data — MCP clients can fetch these directly without a tool call:
caddy://config — Current full Caddy JSON configuration.caddy://servers — Summary of all configured HTTP servers.caddy://upstreams — Reverse proxy upstream health status, verbatim. Same 2.11.2+ caveat as caddy_upstreams: lingering dynamic upstreams and duplicate in-flight entries; do not sum num_requests.caddy://metrics — Prometheus metrics (text exposition format). Capped at the first 500 lines to keep client context bounded; use the caddy_metrics tool with filter / max_lines for filtered or larger output."Cannot connect to Caddy admin API"
caddy run or systemctl status caddy.http://localhost:2019. If Caddy is in Docker, use the container hostname.CADDY_ADMIN_URL in your MCP config env to match.ssh -L 2019:localhost:2019 <host>) and leave CADDY_ADMIN_URL at its default. Caddy checks the Host header against its own listen address, so a tunnel on a different local port answers 403 host not allowed: localhost:<port>.host:port to the remote Caddy's admin.origins. Caddy checks both Host and Origin, and setting admin.origins replaces the default localhost / 127.0.0.1 / ::1 entries, so list localhost:2019 too if local tools still need access. A non-loopback or wildcard admin.listen — the Docker http://caddy:2019 above, for instance — does not allow an arbitrary Host either, so it needs admin.origins set as well.CADDY_ADMIN_URL at Caddy's native remote admin listener (admin.remote, default :2021) fails before any HTTP is exchanged, because that listener requires a TLS client certificate and caddy-mcp does not present one. It surfaces as this message even though Caddy is running and accepted the connection."HTTP 412 Precondition Failed"
"HTTP 401" or "HTTP 403" on any request
{"error":...} body. If you got one, it is Caddy: the admin.listen / admin.origins allowlists (host not allowed: ..., client is not allowed to access from origin ..., required Origin header is missing or invalid — see the tunnel and proxy bullets above), or, on admin.remote, its mTLS identity and permission checks.CADDY_API_TOKEN applies there and only there, so a missing or wrong token is one cause and the proxy's other access rules are another.CADDY_API_TOKEN will not clear a 401/403 that carries a Caddy error body."directive 'X' is not an ordered HTTP handler" from caddy_adapt, or from caddy_load with format: "caddyfile"
order global option, or wrap it in a route block.order in this same Caddy process removed that directive from the process-wide directive order. Restarting Caddy restores the default order (caddyserver/caddy#7995, unreleased).SIGUSR1 / systemctl reload caddy stops reloading the Caddyfile
SIGUSR1 reloads
from the file on disk only if the config has never been changed through the
admin API. The first write from caddy-mcp (or any other API client) makes
Caddy consider the running config API-owned, and SIGUSR1 becomes a no-op.caddy_status, caddy_list_routes, caddy_adapt)
and reload from the file. If caddy-mcp owns the config, apply changes with
caddy_load instead of SIGUSR1.caddy_adapt is read-only with
respect to the config, but not with respect to the adapter. A Caddyfile order
global option changes that process's directive order, and a failed order line
can break later in-process adaptations — which is what a SIGUSR1 reload and
caddy run --watch do. caddy reload, which is what the packaged
systemctl reload caddy runs, adapts in the CLI process and is unaffected.Windows: MCP server doesn't start
cmd /c npx ... pattern from the Quick start section. Node 20+ can't spawn .cmd files directly.Node.js 20+
Caddy 2.11.3 or later, with the admin API enabled (default: localhost:2019).
The latest 2.11.x is recommended; verified against Caddy 2.11.4. Two admin-side
reasons for that floor:
Authorization header from CADDY_API_TOKEN reaches the admin listener, the
token is written to Caddy's log in plain text
(caddyserver/caddy#7578).@id silently. A racing
caddy_reverse_proxy create, or a caddy_config_by_id set with
mode: "insert" on a route id, leaves two elements sharing one @id, and
/id/ resolves to only one of them.Older 2.x mostly works, with two exceptions that both come from how Caddy sends
its ETag. Caddy 2.8.0 and later send it as a response header. Caddy 2.5.2
through 2.7.x send it as an HTTP trailer, which this client cannot read, and
earlier versions send none. So before 2.8.0:
If-Match (ETag) concurrency guard is inactive, because no ETag is ever
cached to echo back;caddy_config_by_id set and delete is refused, because the tool
reads the ETag to learn where Caddy resolves the @id before it writes
through it, and fails closed when it cannot.The @id write path relies on PATCH semantics that the live integration
suite pins per release.
See CONTRIBUTING.md for the full workflow, including release process.
MIT
Source: README.md at commit 11a4dc7
Read 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').
pathWrite 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.
modepathrequiredvaluerequiredconfirmDelete 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.
pathrequiredconfirmReplace 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.
configrequiredformatconfirmManage 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).
indexactionrequiredconfirmAccess 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.
idrequiredmodevalueactionconfirmsubpathAdd 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.
idtorequiredfromrequiredserverAdd a route with full control over match conditions and handlers. Supports any Caddy handler (reverse_proxy, file_server, static_response, redirect, encode, headers, etc.).
matchrequiredhandlerequiredserverterminalList 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'.
serverRemove 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.
idindexserverconfirmConvert 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, unreleased as of v2.11.4.
configrequiredadapterGet 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, and only when that issuer's module is 'acme' -- 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.
caemailactionrequiredprofileCheck Caddy connectivity and get a config summary: servers, routes, listen addresses, and TLS status.
Takes no parameters.
List all configured HTTP servers with their names, listen addresses, route counts, and TLS status. Use this to discover server names before calling route tools.
Takes no parameters.
Caddy'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.
Takes no parameters.
Get PKI certificate authority info or the CA certificate chain.
cacertificatesGet 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.
filtermax_linesGracefully shut down the Caddy server. Requires confirm=true to prevent accidental shutdown.
confirmrequired90% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
{ "mcpServers": { "caddy": { "command": "npx", "args": ["-y", "@yawlabs/caddy-mcp@latest"] } }}{ "mcpServers": { "caddy": { "command": "cmd", "args": ["/c", "npx", "-y", "@yawlabs/caddy-mcp@latest"] } }}{ admin unix//var/run/caddy-admin.sock}> "Proxy api.example.com to my app on port 3000"→ caddy_reverse_proxy({ from: "api.example.com", to: ["localhost:3000"] })> "Make sure api.example.com points at localhost:3000, with a stable id"→ caddy_reverse_proxy({ from: "api.example.com", to: ["localhost:3000"], id: "api-prod" }) # First call creates the route under @id="api-prod". # Subsequent calls with the same id REPLACE in place — no duplicate routes. # Refuses with a clear error if "api-prod" is already in use by a non-route # config object (TLS issuer, server, etc.) — @ids are config-global in Caddy.> "Just the HTTP request metrics, please"→ caddy_metrics({ filter: "http_requests" }) # Keeps sample lines whose metric name contains "http_requests", # plus their `# HELP` / `# TYPE` lines. Drops the rest.> "Convert this Caddyfile to JSON so I can review it: example.com { reverse_proxy localhost:8080 }"→ caddy_adapt({ config: "..." })> "Fetch Prometheus metrics and tell me which route is slowest"→ caddy_metrics()> "Update the route with @id 'api-v2' to point to the new backend"→ caddy_config_by_id({ id: "api-v2", action: "set", value: {...} }) # Uses ETags — you'll get HTTP 412 if someone else changed it first> "Replace the whole config with this Caddyfile"→ caddy_adapt({ config: "..." }) # validate first→ caddy_load({ config: adaptedJson }) # apply atomicallygit clone https://github.com/YawLabs/caddy-mcp.gitcd caddy-mcpnpm installnpm run lint # Biome checknpm run lint:fix # Auto-fixnpm run build # tsup bundlenpm test # Vitest (782 unit tests, +39 POSIX-only unix-socket and launcher tests; +39 live-Caddy integration tests gated by CADDY_MCP_INTEGRATION=1)npm run typecheck # tsc --noEmit