Caddy MCP Server — Claude Code MCP server: what it does
Controls Caddy web servers through the admin API: config, routes, TLS, metrics and snapshots directly from your AI assistant.
claude mcp add caddy-mcp -- npx -y @yawlabs/caddy-mcpWhat Caddy MCP Server does
The server exposes 18 tools and 4 resources for the full Caddy admin endpoint set: config, routes, reverse proxies, TLS, PKI, metrics and snapshots. Concurrent edits use ETag validation (If-Match) to prevent silent overwrites. The caddy_config_set tool defaults to overwrite mode, not append — calling it twice won't duplicate routes. Config parsing is hardened against crashes even when the structure is malformed.
Caddy runs the admin API on localhost:2019 out of the box. For Docker or remote instances, set CADDY_ADMIN_URL. Without a running Caddy on that port or an address in the environment variable, tools will fail with a connection error. The optional CADDY_API_TOKEN is sent as Authorization: Bearer — only needed if an authenticating proxy sits in front of the admin endpoint.
What it helps with
- configure reverse proxies from the assistant chat
- retrieve current routes and TLS settings
- load a full config snapshot
- check Prometheus metrics from the web server
- manage PKI certificates
Example prompts for the agent
- Proxy
api.localtolocalhost:3000 - List routes on server
srv0 - Show Prometheus metrics
How to install Caddy MCP Server
Platform CLI
claude mcp add caddy-mcp -- npx -y @yawlabs/caddy-mcpPlatform CLI
codex mcp add caddy-mcp-server -- npx -y @yawlabs/caddy-mcpConfig file
{
"mcpServers": {
"caddy-mcp-server": {
"command": "npx",
"args": [
"-y",
"@yawlabs/caddy-mcp"
]
}
}
}Config file
{
"servers": {
"caddy-mcp-server": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@yawlabs/caddy-mcp"
]
}
}
}Platform CLI
gemini mcp add caddy-mcp-server npx -y @yawlabs/caddy-mcpStep by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Caddy MCP Server
How to install Caddy MCP Server in Claude Code?
Run claude mcp add caddy-mcp -- npx -y @yawlabs/caddy-mcp, then restart Claude Code and approve the server connection when prompted.
What does Caddy MCP Server do?
It provides tools to manage Caddy web servers through the admin API: edit config, routes, TLS and PKI settings, read metrics, and work with snapshots. Everything is accessible from your AI assistant chat.
What is CADDY_ADMIN_URL for?
It specifies the Caddy admin API address. The default is http://localhost:2019. If Caddy runs in Docker or on a remote host, set the corresponding address — for example, http://caddy:2019 inside a Docker network.