Traefik MCP Server
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 MCP Server show me an overview of my Traefik instance"
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 MCP Server
A Model Context Protocol (MCP) server for Traefik reverse proxy instances.
Forked from
theupriser/treafik-mcp
Overview
This MCP server enables AI assistants to query and inject Traefik configurations in LLM context window.
Related MCP server: Traefik MCP Server
Features
🔍 Query Traefik entrypoints, routers, services, and middlewares
📊 Get comprehensive configuration and statistics in markdown format
⚙️ View summary lists or detailed configuration for individual components
⚙️ Support stdio or http/sse transport
🚀 Run locally or in Docker container
Work in progress
🔒 Support for both API key and basic authentication for containerized deployment
Installation
Prerequisites
Python 3.13 or higher
uv package manager
A running Traefik instance with Dashboard enabled
Local Development Setup
Clone the repository:
git clone <repository-url> cd mcp-traefikCreate virtual environment and install dependencies:
uv venv source .venv/bin/activate # On Windows: .venv\Scripts\activate uv pip install -e ".[dev]"Configure environment variables:
cp .env.example .env # Edit .env with your own configurationRun locally:
python -m traefik_mcp.server
Docker container
Clone the repository:
git clone <repository-url> cd mcp-traefikAdapt
docker-compose.ymlenvironment and run:docker compose up -d
Docker container setup only support
http/ssetransport
Configuration
Set the following environment variables:
Required
TRAEFIK_API_URL: URL of your Traefik Dashboard endpoint (e.g.,http://localhost:8080)
Transport
MCP_TRANSPORT: Type of transport, must be 'stdio' or 'http'MCP_HOST: Host IP adres, default '0.0.0.0' (for 'http' transport only)MCP_PORT: Host port, default '8080' (for 'http' transport only)
Authentication (choose one)
TRAEFIK_API_KEY: API key for Bearer token authenticationTRAEFIK_BASIC_AUTH_USERNAME: Username for basic authenticationTRAEFIK_BASIC_AUTH_PASSWORD: Password for basic authentication
Optional
MCP_LOG_LEVEL: Logging level (default: INFO)
Note: API key authentication takes precedence over basic authentication if both are configured.
Integration with AI Clients
VSCode integration
Add to your VSCode configuration file (e.g. .vscode/mcp.json):
Local
{
"servers": {
"traefik": {
"command": "/path/to/traefik-mcp/.venv/bin/traefik-mcp",
"args": [],
"env": {
"TRAEFIK_API_URL": "http://localhost:8080",
"TRAEFIK_BASIC_AUTH_USERNAME": "admin",
"TRAEFIK_BASIC_AUTH_PASSWORD": "admin"
}
}
}
}Distant deployment in Docker container
{
"servers": {
"traefik": {
"url": "http://localhost:8080/mcp/sse"
}
}
}
}Local alternative using uv
{
"mcpServers": {
"traefik": {
"command": "uv",
"args": [
"--directory",
"/path/to/traefik-mcp",
"run",
"traefik-mcp"
],
"env": {
"TRAEFIK_API_URL": "http://localhost:8080"
}
}
}
}Available Tools
The MCP server provides the following tools:
get_traefik_overview: Get comprehensive overview of all Traefik componentsget_version: Get version of Traefik instanceget_entrypoint: Get a summarized list of entrypoints, or a detailled report of a given entrypointget_router: Get a summarized list of routers, or a detailled report of a given router, for http, tcp, and udp protocolsget_service: Get a summarized list of services, or a detailled report of a given service, for http, tcp, and udp protocolsget_middleware: Get a summarized list of middlewares, or a detailled report of a given middleware, for http, tcp, and udp protocols
Example Usage
Once configured, you can ask questions like:
"Show me all routers in my Traefik setup"
"What services are running behind the traefik.test router?"
"List all middlewares configured for Docker provider"
"Give me an overview of my Traefik instance"
"Is my Traefik configuration secured ?"
See QUALIFICATION.md for an integration test in french ;).
Development
Running Tests
pytestCode Formatting
black src/ tests/
ruff check src/ tests/Type Checking
mypy src/Troubleshooting
Common Issues
Server shows 0 routers/services
Ensure your Traefik API is accessible at the configured URL
Verify authentication credentials are correct
Check that Traefik API is enabled in your configuration
Authentication failures
Verify basic auth credentials match your Traefik configuration
If using API key, ensure it's correctly formatted
API key takes precedence over basic auth if both are set
Connection errors
Check that
TRAEFIK_API_URLis reachable from the MCP serverVerify Traefik is running and API is enabled
Check network/firewall settings
Testing the Server
You can test the MCP server manually:
# Set environment variables and run
export TRAEFIK_API_URL="http://localhost:8080"
export TRAEFIK_BASIC_AUTH_USERNAME="admin"
export TRAEFIK_BASIC_AUTH_PASSWORD="admin"
uv run traefik-mcpContributing
Contributions are welcome! Do not hesitate to propose pull request. Just make sure to conform with Code architecture, formats and tests.
Consult .windsurf/rules/project-rules.md.
License
This depot is a fork from https://github.com/theupriser/treafik-mcp.
Please visit this original depot for more informations about original commits.
MIT License - See LICENSE file for details
Resources
Available Tools
6 toolsget_entrypointC
Get informations about entrypoints
Inputs: name.
get_middlewareC
Get information about middlewares
Inputs: protocol (required), name.
get_overviewC
Get an overview of the Traefik instance configuration
Inputs: no named parameters.
get_routerC
Get information about routers
Inputs: protocol (required), name.
get_serviceC
Get information about services
Inputs: protocol (required), name.
get_versionA
Get the Traefik API version
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct Traefik resource (entrypoints, middlewares, services, routers), so boundaries are mostly clear. get_overview and get_version could be confused since overview might include version info, but the descriptions imply different scopes.
All six tools follow a strict get_<noun> pattern with snake_case. The only nit is singular vs. plural resource nouns (get_entrypoint returning a list), but the convention itself is fully uniform.
Six tools is a reasonable, well-scoped surface for a Traefik API read interface. It is slightly thin because the server exposes only one verb across the whole domain.
Core Traefik resources (routers, services, middlewares, entrypoints) are covered, which fits a read-only API. However, obvious gaps remain: no TLS/certificate inspection, no health/ping, and no way to fetch a single resource by name for targeted lookups.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to manage Docker containers, execute commands inside them, and inspect container information through a minimalist set of tools supporting both stdio and HTTP transports.334 npm1MIT
- FlicenseBqualityDmaintenanceEnables AI assistants to query and manage Traefik reverse proxy configurations, including routers, services, and middlewares, through natural language. It supports monitoring service health, viewing statistics, and performing administrative tasks across various providers like Docker.66-
- AlicenseAqualityBmaintenanceConnects a personal KodeKloud learning account to AI assistants such as Claude Desktop, Claude Code, Cursor, and ChatGPT, letting users review course progress and syllabi, inspect running hands-on labs, check certification exam readiness for CKA/CKAD/CKS/Terraform, track KodeKloud Engineer tasks, and generate weekly study plans through natural language. It runs read-only by default over stdio or remote SSE/streamable-HTTP transport, with session credentials auto-detected from a browser cookie or bearer token and redacted from all logs.9MIT
- AlicenseBqualityBmaintenanceEnables AI assistants to inspect and operate a Jenkins instance — discovering jobs, views, nodes, and plugins; reviewing build chains, parameters, last-build status, console output, test reports, and artifacts; and triggering builds, stopping runs, or answering pipeline inputs. It connects over stdio, SSE, or streamable HTTP with optional credentials, read-only mode, and a credential-free health endpoint.311MIT