经 AI Skill Hub 精选评估,Caddy MCP 获评「强烈推荐」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 8.0 分,适合有一定技术背景的用户使用。
Caddy MCP 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
Caddy MCP 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/YawLabs/caddy-mcp
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"caddy-mcp": {
"command": "npx",
"args": ["-y", "caddy-mcp"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 Caddy MCP 执行以下任务... Claude: [自动调用 Caddy MCP MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"caddy_mcp": {
"command": "npx",
"args": ["-y", "caddy-mcp"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
Manage Caddy web servers from Claude Code, Cursor, and any MCP client. 18 tools + 4 resources covering every endpoint of Caddy's admin API — config, routes, reverse proxies, TLS, PKI, metrics, snapshots.
Built and maintained by Yaw Labs.
One click adds this to your local Yaw MCP config so it's available in every Yaw Terminal session. Or install manually below.
localhost:2019)> "Replace the whole config with this Caddyfile"
→ caddy_adapt({ config: "..." }) # validate first
→ caddy_load({ config: adaptedJson }) # apply atomically
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:
{
"mcpServers": {
"caddy": {
"command": "npx",
"args": ["-y", "@yawlabs/caddy-mcp@latest"]
}
}
}
Windows:
{
"mcpServers": {
"caddy": {
"command": "cmd",
"args": ["/c", "npx", "-y", "@yawlabs/caddy-mcp@latest"]
}
}
}
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"
| Environment variable | Default | Description |
|---|---|---|
CADDY_ADMIN_URL | http://localhost:2019 | Caddy admin API URL. Set to http://caddy:2019 inside Docker, or an https URL for remote admin. |
CADDY_API_TOKEN | (none) | Optional Bearer token for authenticated admin endpoints. Only needed if you've configured Caddy with auth. |
CADDY_MAX_RETRIES | 2 | Number of retries on transient failures (5xx, network errors). 4xx and 412 never retry. POSTs to /config/* and /id/* also skip retry (non-idempotent appends/creates -- retrying could duplicate routes or 409 a half-applied create). POSTs to /load, /adapt, /stop still retry. Hard-capped at 5; values above the cap log a one-time stderr notice so the clamp is visible. Set to 0 to disable. |
CADDY_TIMEOUT | 10000 | Timeout in ms for all admin API requests except /load (which uses CADDY_LOAD_TIMEOUT). Non-numeric, <= 0, or fractional values below 1ms fall back to the default. |
CADDY_LOAD_TIMEOUT | 60000 | Timeout in ms for the /load endpoint; raise for ACME-heavy bring-ups where provisioning many certificates can exceed the default. Non-numeric, <= 0, or fractional values below 1ms fall back to the default. |
Alternate MCP clients:
| Client | Config file |
|---|---|
| Claude Code | .mcp.json (project root) or ~/.claude.json (global) |
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) |
| Cursor | ~/.cursor/mcp.json |
| Windsurf | ~/.codeium/windsurf/mcp_config.json |
| VS Code | .vscode/mcp.json |
Use the same JSON block shown above in any of these.
overwrite (PATCH, default, idempotent), append (POST), insert (PUT, for array positions).confirm=true (deleting a parent path also removes every descendant).@id tag — much easier than navigating deep paths. The delete action requires confirm=true.list, save, apply (confirm-gated). In-memory, last 10.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."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."HTTP 412 Precondition Failed"
"HTTP 403" on /load or /config writes
admin.listen or admin.origins restrictions set in your Caddy config, or you're missing an Authorization header.CADDY_API_TOKEN in your MCP config env if Caddy expects a Bearer token.Windows: MCP server doesn't start
cmd /c npx ... pattern from the Quick start section. Node 20+ can't spawn .cmd files directly.高质量的MCP工具,支持Caddy admin API
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:Caddy MCP 的核心功能完整,质量优秀。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | caddy-mcp |
| 原始描述 | 开源MCP工具:Caddy admin API MCP server -- complete coverage of config, routes, reverse proxi。⭐9 · TypeScript |
| Topics | caddymcptypescript |
| GitHub | https://github.com/YawLabs/caddy-mcp |
| License | MIT |
| 语言 | TypeScript |
收录时间:2026-05-28 · 更新时间:2026-05-30 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端