# Caddy MCP Server

Controls Caddy web servers through the admin API: config, routes, TLS, metrics and snapshots directly from your AI assistant.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 12
- Author: YawLabs
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/YawLabs/caddy-mcp
- Updated: 2026-10-15
- HTML: https://affpapa.org/en/nevibecode/mcp/caddy-mcp-server

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add caddy-mcp -- npx -y @yawlabs/caddy-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add caddy-mcp-server -- npx -y @yawlabs/caddy-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "caddy-mcp-server": {
            "command": "npx",
            "args": [
                "-y",
                "@yawlabs/caddy-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "caddy-mcp-server": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@yawlabs/caddy-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add caddy-mcp-server npx -y @yawlabs/caddy-mcp
```

## When to use it
- 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
- Proxy `api.local` to `localhost:3000`
- List routes on server `srv0`
- Show Prometheus metrics

## Similar
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [Oh My Posh Validator](https://affpapa.org/en/nevibecode/mcp/oh-my-posh-validator.md) — MCP server · ★ 23643
- [Keploy](https://affpapa.org/en/nevibecode/mcp/keploy.md) — MCP server · ★ 18727
- [Coder](https://affpapa.org/en/nevibecode/mcp/coder.md) — MCP server · ★ 17160
- [mcp](https://affpapa.org/en/nevibecode/mcp/kubeshark-mcp.md) — MCP server · ★ 12109

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
