Caddy MCP
MCP server for safely inspecting and operating a local Caddy admin API. Provides read-only tools and dry-run mutations for config management.
README
Caddy MCP
MCP server for safely inspecting and operating a local Caddy admin API. Built for homelab and personal-infra workflows where an AI assistant should be able to inspect active routes, validate Caddyfile snippets, and preview admin-API mutations before applying them.
Features
- FastMCP stdio and SSE transports.
- Safe default Caddy admin URL:
http://127.0.0.1:2019. - Read-only tools for active config and reverse-proxy upstream inventory.
- Caddyfile validation/adaptation helpers using the local
caddybinary. - Mutating tools default to
dry_run=true. - Redacted admin API errors.
- Installable package layout, Dockerfile, Compose sidecar, CI, tests, and client examples.
Tools
| Tool | Purpose | Mutates |
|---|---|---|
get_config |
Read active JSON config, optionally below /config/{path} |
no |
list_reverse_proxy_upstreams |
Summarize host matchers and reverse_proxy upstreams |
no |
validate_caddyfile_text |
Validate Caddyfile text with caddy validate |
no |
adapt_caddyfile_text |
Convert Caddyfile text to JSON; dry-run preview by default | no |
load_config |
Replace active config with POST /load |
yes, unless dry-run |
patch_config |
Patch one config path with PATCH /config/{path} |
yes, unless dry-run |
stop_caddy |
Stop Caddy with POST /stop |
yes, unless dry-run |
Quick start
git clone https://github.com/euisuh/caddy-mcp.git
cd caddy-mcp
python -m venv .venv
. .venv/bin/activate
pip install -e .
CADDY_ADMIN_URL=http://127.0.0.1:2019 caddy-mcp
For SSE sidecar mode:
MCP_TRANSPORT=sse MCP_HOST=127.0.0.1 MCP_PORT=8000 caddy-mcp
Docker sidecar
docker compose up --build
The Compose file binds the MCP port to localhost and points at host Caddy's admin API via host.docker.internal:2019.
Safety model
- Caddy's admin API is powerful. Keep it bound to loopback or an internal network.
- This server does not expose credentials and does not persist tokens.
- Mutating tools default to dry-run and return the exact method/path/value preview.
- Use
load_configandpatch_configonly after validating/adapting configs. stop_caddyexists for completeness but also defaults to dry-run.
Development
pip install -e . -r requirements-dev.txt
ruff check .
pytest -q
python -m build --sdist --wheel
twine check dist/*
Live smoke against a local Caddy
CADDY_ADMIN_URL=http://127.0.0.1:2019 python - <<'PY'
import asyncio
from fastmcp import Client
from caddy_mcp.server import build_server
async def main():
async with Client(build_server()) as client:
print([tool.name for tool in await client.list_tools()])
print((await client.call_tool('list_reverse_proxy_upstreams', {})).data)
asyncio.run(main())
PY
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.