traefik-hub-mcp
Controls the local Docker daemon and a Docker Compose Traefik stack: lists containers on the traefik-public network, fetches container logs, restarts containers, rebuilds/recreates Compose services, starts and stops the Traefik stack, and creates the traefik-public network.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@traefik-hub-mcp run a full health check on my Traefik stack"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
traefik-hub-mcp
MCP server for managing a local Traefik reverse proxy from Claude Code. Inspect routers, services, and middlewares; manage Docker containers; health-check domains; and configure CORS and middleware -- all without leaving your editor.
Installation
# Run directly (recommended for Claude Code)
npx traefik-hub-mcp
# Or install globally
npm install -g traefik-hub-mcpRelated MCP server: docker-compose-mcp
Prerequisites
Node.js >= 18
Docker running (Docker Desktop or daemon)
A Traefik stack managed via
docker-compose.yml(see traefik-hub for a ready-made setup)
Environment Variables
Variable | Required | Default | Description |
| Yes | -- | Path to Traefik config directory (contains |
| Yes | -- | Path to the Traefik Hub repo root (contains |
| No |
| Traefik API base URL |
| No | -- | Comma-separated domain suffixes for multi-domain routing (e.g., |
Configuration
Claude Code
claude mcp add traefik -e TRAEFIK_HUB_DIR=/path/to/traefik-hub -e TRAEFIK_CONFIG_DIR=/path/to/traefik-hub/traefik -e TRAEFIK_API_URL=http://localhost:8080 -- npx -y traefik-hub-mcpOr add manually to ~/.claude.json or project .mcp.json:
{
"mcpServers": {
"traefik": {
"command": "npx",
"args": ["-y", "traefik-hub-mcp"],
"env": {
"TRAEFIK_HUB_DIR": "/path/to/traefik-hub",
"TRAEFIK_CONFIG_DIR": "/path/to/traefik-hub/traefik",
"TRAEFIK_API_URL": "http://localhost:8080"
}
}
}
}Cursor
Add to Cursor Settings > MCP Servers:
{
"mcpServers": {
"traefik": {
"command": "npx",
"args": ["-y", "traefik-hub-mcp"],
"env": {
"TRAEFIK_HUB_DIR": "/path/to/traefik-hub",
"TRAEFIK_CONFIG_DIR": "/path/to/traefik-hub/traefik",
"TRAEFIK_API_URL": "http://localhost:8080"
}
}
}
}VS Code (Copilot)
Add to your VS Code settings.json:
{
"mcp": {
"servers": {
"traefik": {
"type": "stdio",
"command": "npx",
"args": ["-y", "traefik-hub-mcp"],
"env": {
"TRAEFIK_HUB_DIR": "/path/to/traefik-hub",
"TRAEFIK_CONFIG_DIR": "/path/to/traefik-hub/traefik",
"TRAEFIK_API_URL": "http://localhost:8080"
}
}
}
}
}Windsurf
Add to ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"traefik": {
"command": "npx",
"args": ["-y", "traefik-hub-mcp"],
"env": {
"TRAEFIK_HUB_DIR": "/path/to/traefik-hub",
"TRAEFIK_CONFIG_DIR": "/path/to/traefik-hub/traefik",
"TRAEFIK_API_URL": "http://localhost:8080"
}
}
}
}Cline
Add to Cline MCP settings:
{
"mcpServers": {
"traefik": {
"command": "npx",
"args": ["-y", "traefik-hub-mcp"],
"env": {
"TRAEFIK_HUB_DIR": "/path/to/traefik-hub",
"TRAEFIK_CONFIG_DIR": "/path/to/traefik-hub/traefik",
"TRAEFIK_API_URL": "http://localhost:8080"
},
"disabled": false
}
}
}Tools
Traefik API
Tool | Description |
| Traefik version and component counts |
| List HTTP routers (optionally filter by provider) |
| List HTTP services (optionally filter by provider) |
| List all HTTP middlewares |
| Get details of a specific router |
Docker
Tool | Description |
| List containers on the |
| Get logs from a container |
| Restart a container |
| Rebuild and recreate a Docker Compose service ( |
Health & Diagnostics
Tool | Description |
| Check if a domain is responding |
| Comprehensive stack health check (Docker, network, container, API, ports, config) |
| Check for newer Traefik versions and whether it's safe to update |
| Verify MCP env vars and paths are correctly set |
Stack Management
Tool | Description |
| Start the Traefik stack ( |
| Stop the Traefik stack ( |
| Create the |
| Initialize from scratch (create network + start containers) |
Configuration
Tool | Description |
| Generate docker-compose Traefik labels for a new project |
| Add a middleware to |
| Show available middleware types with example configs |
| Show current CORS configuration |
| Add or remove origins from the |
Multi-Domain Routing
Tool | Description |
| Add multi-domain route for a service (LAN/Tailscale access) |
| Remove a multi-domain route |
| List all multi-domain routes |
Development
git clone https://github.com/dominic-righthere/traefik-hub-mcp.git
cd traefik-hub-mcp
npm install
npm run build
npm testLicense
MIT
Available Tools
25 toolsadd_domain_routeC
Add multi-domain route for a service (makes it accessible via LAN/Tailscale)
Inputs: name (required), domain (required), service (required).
add_middlewareB
Add a new middleware to traefik/dynamic/middlewares.yml (Traefik hot-reloads automatically)
Inputs: name (required), type (required), config (required).
check_healthC
Check if a domain is responding
Inputs: domain (required).
check_setupB
Verify MCP configuration - checks that env vars and paths are correctly set
Inputs: no named parameters.
check_updateA
Check if a newer Traefik version is available and whether it's safe to update
Inputs: no named parameters.
container_logsC
Get logs from a Docker container
Inputs: name (required), tail.
create_networkA
Create the traefik-public Docker network. Requires Docker running.
Inputs: no named parameters.
doctorB
Comprehensive health check of the Traefik stack - checks Docker, network, container, API, ports, and config
Inputs: no named parameters.
generate_labelsC
Generate docker-compose traefik labels for a new project
Inputs: name (required), port (required), domain (required), middlewares.
get_corsA
Show current CORS configuration (allowed origins from cors-dev middleware)
Inputs: no named parameters.
get_routerC
Get details of a specific router
Inputs: name (required).
init_stackA
Initialize Traefik stack from scratch - creates network and starts containers. Requires Docker running.
Inputs: no named parameters.
list_containersA
List Docker containers on traefik-public network
Inputs: no named parameters.
list_domain_routesB
List all multi-domain routes (LAN/Tailscale access)
Inputs: no named parameters.
list_middlewaresC
List all HTTP middlewares
Inputs: no named parameters.
list_middleware_typesB
Show available middleware types with example configurations
Inputs: no named parameters.
list_routersB
List all HTTP routers with their rules and status
Inputs: provider.
list_servicesB
List all HTTP services registered in Traefik
Inputs: provider.
rebuild_serviceA
Rebuild and recreate a Docker Compose service (runs docker compose up -d --build <service>)
Inputs: name (required).
remove_domain_routeC
Remove a multi-domain route
Inputs: name (required).
restart_containerB
Restart a Docker container
Inputs: name (required).
start_traefikA
Start the Traefik stack (docker compose up -d). Requires Docker running.
Inputs: no named parameters.
stop_traefikA
Stop the Traefik stack (docker compose down). Requires Docker running.
Inputs: no named parameters.
traefik_statusB
Get Traefik overview - version and component counts
Inputs: no named parameters.
update_corsC
Add or remove origins from the cors-dev middleware
Inputs: add, remove.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 25 tools
Most tools target distinct resources, but several clusters overlap: traefik_status, doctor, check_health, and check_setup are four different flavors of 'check' that an agent could easily misselect, and init_stack is essentially a superset of create_network plus start_traefik. list_middlewares vs list_middleware_types is also a subtle distinction (configured vs available) that names alone don't clarify.
The dominant pattern is snake_case verb_noun (list_routers, get_router, add_middleware, remove_domain_route), which is applied consistently across most tools. Deviations are minor: noun-first names like traefik_status, container_logs, and the bare doctor break the pattern but remain readable.
At 25 tools this sits at the heavy end of the scale, spanning Traefik API inspection, Docker container ops, stack lifecycle, domain routing, CORS, and middleware config. Each area is legitimate, but the surface is broad enough that some tools (init_stack, check_setup, doctor) feel like conveniences layered on top of already-covered operations.
The server covers inspection and lifecycle well: routers/services/middlewares are readable, stack start/stop/init/create_network exist, containers can be listed/logged/restarted/rebuilt, and CORS/domain routes have full add/remove/get coverage. Gaps remain on the mutation side for middlewares (add but no update/remove single middleware) and no get_service or router create/update, though generate_labels partly compensates.
Maintenance
Related MCP Connectors
Manage hosts, redirects, SSL, and traffic analytics from Claude and other AI assistants.
Deploy local apps, add managed Postgres, and inspect logs from your AI coding agent.
Your AI Agent's Infrastructure Layer. Connect Claude, Copilot, Codex, or ChatGPT to 200+ managed open source services. Start databases, pipelines, and applications through natural language.
Develop, manage, and debug Railway projects, services, and deployments from within agents.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables Docker container management directly through Claude using the Model Context Protocol. Provides 14 tools for managing containers, images, volumes, and Docker Compose deployments through natural language commands.-
- AlicenseAqualityDmaintenanceEnables Claude to manage Docker Compose containers by updating, running commands, and viewing status/logs.2MIT
- FlicenseNot gradedqualityDmaintenanceProvides Docker management tools for Claude Code, enabling container, image, network, and volume operations.-
- AlicenseAqualityDmaintenanceGenerates, audits, and tunes Docker Compose stacks inside Claude Code.68 npmMIT