Skip to main content

Traefik logo

Traefik MCP Server & Agent Plugin

An Agent Plugin (v1.0.0) and FastMCP Execution Server for Traefik v3 Kubernetes Traffic Management, Security Policies, and Deep Diagnostics — separating reasoning workflows (SKILL.md) from live cluster execution (MCP Tools & Resources).

PyPI Python 3.12+ License MCP Traefik v3.6+


Let your AI assistant manage Traefik v3 on Kubernetes: routes, weighted canary traffic, mirroring, middlewares, TLS, and TCP/UDP routing. It also explains why a request returns 404 or 502, and audits your setup for security issues.

What you get

  • 15 MCP tools (5 read-only) that work against your live Traefik setup
  • 12 resources your assistant can read for context, under traefik://
  • 7 Agent Skills: step-by-step playbooks that teach your assistant how to use the tools well
  • Safe by default: only read-only tools are loaded until you turn on writes, and changes are previewed or confirmed before they happen

Quick start

You'll need:

  • Python 3.12+ and uv, or Docker
  • Access to a Kubernetes cluster running Traefik v3 (through a kubeconfig file)
  • Optional: a Prometheus URL for traffic metrics

1. Add the server to your MCP client. For Claude Desktop, Cursor, Windsurf, and most other clients, add this to your MCP config file:

{
  "mcpServers": {
    "traefik": {
      "command": "uvx",
      "args": [
        "--from",
        "talkops-traefik-mcp-server",
        "traefik-mcp-server"
      ],
      "env": {
        "KUBECONFIG": "/path/to/your/kubeconfig",
        "TRAEFIK_NAMESPACE": "traefik"
      }
    }
  }
}

Using Claude Code? Run this instead:

claude mcp add traefik -e KUBECONFIG=/path/to/your/kubeconfig -e TRAEFIK_NAMESPACE=traefik -- uvx --from talkops-traefik-mcp-server traefik-mcp-server

uvx downloads talkops-traefik-mcp-server from PyPI and runs it, so there's nothing else to install. Prefer a normal install? Run pip install talkops-traefik-mcp-server and use traefik-mcp-server as the command.

Prefer Docker? Pull talkopsai/traefik-mcp-server from Docker Hub—no Python setup needed:

{
  "mcpServers": {
    "traefik": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "-v",
        "/path/to/your/kubeconfig:/app/.kube/config:ro",
        "-e",
        "TRAEFIK_NAMESPACE",
        "talkopsai/traefik-mcp-server:latest"
      ],
      "env": {
        "TRAEFIK_NAMESPACE": "traefik"
      }
    }
  }
}

2. Restart your client and try asking:

  • "Why does https://shop.example.com/api return a 404?"
  • "Shift 10% of traffic for checkout to the canary service, but show me the preview first."
  • "Run a security audit of my Traefik setup."

Allowing changes

Out of the box the server is read-only. To let your assistant make changes (creating and changing routes, weighted services, middlewares, TLS settings, and deleting Traefik resources), add "--allow-write" to args (or pass -e MCP_ALLOW_WRITE=true to docker run). Even then, changes are previewed first and destructive actions ask for confirmation.

Configuration

Set these as environment variables (the env block in your client config, or -e with docker run) or pass the matching flag.

Variable Flag Default What it does
K8S_KUBECONFIG / KUBECONFIG --kubeconfig ~/.kube/config Kubeconfig file to use
K8S_CONTEXT --context current context Kubernetes context to use
TRAEFIK_NAMESPACE --traefik-namespace traefik Namespace where Traefik runs
TRAEFIK_API_URL --traefik-api-url via Kubernetes Direct URL to the Traefik API (optional)
PROMETHEUS_URL --prometheus-url http://prometheus:9090 Prometheus for traffic metrics
MCP_ALLOW_WRITE --allow-write false Enable tools that change your cluster
MCP_ALLOWED_NAMESPACES --allowed-namespaces all Only allow changes in these namespaces
MCP_PROTECTED_NAMESPACES --protected-namespaces kube-system,traefik Ask for confirmation before changes here
MCP_TOOLSETS --toolsets all Limit tools: traffic, policies, diagnostics, readonly

Run uvx --from talkops-traefik-mcp-server traefik-mcp-server --help to see every option.

Agent Skills

Skills live in skills/. Each one is a SKILL.md playbook (plus optional references/ and offline scripts/) that teaches your AI assistant how to do a job safely, while the MCP server does the actual work. Tools are the hands, skills are the know-how.

To use them, copy the folders into your assistant's skills directory, for example:

git clone https://github.com/talkops-ai/talkops-mcp.git
cp -r talkops-mcp/src/traefik-mcp-server/skills/* ~/.claude/skills/

This folder is also a portable Agent Plugin (plugin.json + mcp.json + skills/), so plugin-aware clients can load the server and skills together.

Skill Use it to
managing-traefik-traffic-routing Create routes and run canary, blue-green, and mirrored traffic.
configuring-traefik-middlewares Add rate limits, circuit breakers, auth, headers, and other middlewares in the right order.
securing-traefik-tls-and-certificates Set up TLS options, mTLS, and check certificates.
routing-traefik-tcp-and-udp Route TCP and UDP traffic, including TLS passthrough.
troubleshooting-traefik-routing Work out why requests fail (404, 502, 503, TLS errors, and more).
auditing-traefik-security-posture Run a security and best-practice audit and fix the findings.
adopting-traefik-nginx-ingress-provider Serve existing NGINX Ingress resources with Traefik's built-in NGINX provider.

Reference

All 15 tools
Tool Access What it does
traefik_analyze_logs Read Parse and aggregate Traefik pod access logs (JSON or CLF) or controller logs with automatic secret/token redaction, status/router/latency filtering, and grouped counts.
traefik_audit_configuration Read Run 20 deterministic security, TLS, reliability, hygiene, v3_migration, and gateway_api checks across Traefik static configuration, routes, policies, certificates, and Gateway API objects.
traefik_compare_traffic_metrics Read Query Prometheus for Traefik service, router, or entrypoint request rate, 4xx/5xx error rate, P50/P95/P99 latency, and open connections across baseline and comparison windows, or compare canary vs stable backend sub-services.
traefik_configure_http_route Write Create or update a Traefik v3 HTTP IngressRoute (<= 8 parameters).
traefik_configure_middleware Write Create or update a Traefik v3 HTTP Middleware or TCP MiddlewareTCP (<= 8 parameters).
traefik_configure_servers_transport Write Create or update a Traefik ServersTransport or ServersTransportTCP CRD (<= 8 parameters).
traefik_configure_tcp_udp_route Write Create or update a Traefik IngressRouteTCP or IngressRouteUDP (<= 8 parameters).
traefik_configure_tls_policy Write (destructive) Create or update a Traefik TLSOption policy or default TLSStore (<= 8 parameters).
traefik_configure_traffic_mirroring Write (destructive) Enable, update, or disable shadow traffic mirroring via a TraefikService (<= 8 parameters).
traefik_configure_weighted_service Write Create or update a weighted TraefikService for canary or blue-green traffic splitting, and optionally expose it via an IngressRoute in one call (<= 8 parameters).
traefik_delete_resource Write (destructive) Delete a Traefik custom resource (IngressRoute, IngressRouteTCP, IngressRouteUDP, TraefikService, Middleware, MiddlewareTCP, TLSOption, TLSStore, ServersTransport, ServersTransportTCP) with referential-integrity and human confirmation checks. Does NOT delete Kubernetes Services, Secrets, or Gateway API resources.
traefik_diagnose_route Read Perform deep end-to-end health diagnosis of an IngressRoute, IngressRouteTCP, IngressRouteUDP, TraefikService, Ingress, HTTPRoute, GRPCRoute, TLSRoute, TCPRoute, or Gateway across Kubernetes manifests, Traefik runtime API, endpoints, and TLS.
traefik_set_traffic_weights Write Shift traffic weights on an existing weighted TraefikService (<= 8 parameters).
traefik_trace_request Read Evaluate which Traefik router matches a synthetic HTTP/TCP request by priority, trace the ordered middleware chain and backend service tree, identify shadowed routers and near-misses, and optionally run an SSRF-guarded live HTTP/TLS probe.
traefik_update_route Write (destructive) Patch an existing IngressRoute, IngressRouteTCP, or Kubernetes Ingress without restating the full resource (<= 8 parameters).
All 12 resources
Resource What it returns
traefik://cluster/contexts Available kubeconfig contexts, active context, and cluster connection mode.
traefik://instance/static-config Redacted Traefik static configuration including entryPoints, providers (kubernetesCRD, kubernetesIngress, kubernetesIngressNGINX, kubernetesGateway), certificatesResolvers, metrics, accessLog, and plugins.
traefik://runtime/health Live Traefik runtime overview (/api/overview + /api/entrypoints): router, service, and middleware error/warning counts per protocol plus entryPoint listener status.
traefik://server/capabilities Server readiness, allow_write flag, active toolsets, Traefik version, installed CRDs (traefik.io and gateway.networking.k8s.io), enabled providers, Prometheus reachability, and namespace policies.
traefik://certificates/{namespace} Sanitized X.509 certificate metadata (Subject, Issuer, SANs, NotBefore, NotAfter, days_remaining, cert-manager Certificate status) in a namespace (or '_all'). Never exposes private key material.
traefik://gateway/{namespace} Read-only Kubernetes Gateway API inventory (GatewayClass, Gateway, HTTPRoute, GRPCRoute, TLSRoute, TCPRoute, ReferenceGrant) with listener & parent status conditions (Accepted, Programmed, ResolvedRefs).
traefik://manifests/{kind}/{namespace}/{name} Sanitized Kubernetes manifest (managedFields and applied-configuration bloat stripped, Secret data redacted) with resourceVersion for optimistic concurrency.
traefik://metrics/{namespace}/{service}/summary 5-minute Prometheus GOLDEN metrics snapshot (RPS, 2xx/4xx/5xx error rates, P50/P95/P99 latency, open connections) for a Traefik service.
traefik://policies/{namespace} Unified policy inventory (Middleware, MiddlewareTCP, TLSOption, TLSStore, ServersTransport, ServersTransportTCP) in a namespace (or '_all') with referenced-by route counts.
traefik://routes/{namespace} Unified route inventory (IngressRoute, IngressRouteTCP, IngressRouteUDP, TraefikService, and Ingress) in a namespace (or '_all'), enriched with hosts, entryPoints, weights, mirror percentages, and ownership metadata.
traefik://runtime/{protocol} Active Traefik runtime routers, services (with backend serverStatus UP/DOWN), and middlewares for protocol ('http', 'tcp', or 'udp').
traefik://schema/{kind} Cluster-installed CRD OpenAPI v3 spec schema and supported field names for a Traefik or Gateway API resource kind.

Development

git clone https://github.com/talkops-ai/talkops-mcp.git
cd talkops-mcp/src/traefik-mcp-server
uv sync --dev
uv run pytest
uv run traefik-mcp-server --help

Get help

License

Apache 2.0. See LICENSE.

Metadata

Release files for talkops-traefik-mcp-server 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for talkops-traefik-mcp-server 0.2.1
File Size Uploaded Provenance Actions
talkops_traefik_mcp_server-0.2.1.tar.gz 273.6 kB With provenance Details for talkops_traefik_mcp_server-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for talkops-traefik-mcp-server 0.2.1
File Interpreter ABI Platform Actions
talkops_traefik_mcp_server-0.2.1-py3-none-any.whl Python 3 none any Details for talkops_traefik_mcp_server-0.2.1-py3-none-any.whl

Total release size: 391.9 kB

Release files / talkops_traefik_mcp_server-0.2.1.tar.gz

Download URL talkops_traefik_mcp_server-0.2.1.tar.gz
Size 273.6 kB
Tags Source
SHA-256 checksum
How to use checksums
3e5b49d7b0bdfc386bb29cd793ef79a787cacbfccddd2bf561c06b8bd06fa7b3
BLAKE2b-256 checksum
How to use checksums
3a1666880748c4f908e18138d2f575d56851bccec7963cf90b3cce841202b7b6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Release files / talkops_traefik_mcp_server-0.2.1-py3-none-any.whl

Download URL talkops_traefik_mcp_server-0.2.1-py3-none-any.whl
Size 118.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
14b38ff8c8f1bc57d6651b4f2164b706e7f1944a5df8406bf57030121374fa33
BLAKE2b-256 checksum
How to use checksums
1eff4c9f3a61a04f510e495875701c3352777716c0a914c6ca3adee276afd71a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

Security for talkops-traefik-mcp-server 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for talkops_traefik_mcp_server-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 18, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page