HUB
Sign inSign up

talkopsai/traefik-mcp-server

By talkopsai

•Updated 3 days ago

MCP Server for Traefik edge routing, traffic splitting, and NGINX migrations

Image
Developer tools
Monitoring & observability
0

568

talkopsai/traefik-mcp-server repository overview

⁠Traefik MCP Server

Let your AI assistant manage Traefik v3 on Kubernetes: configure IngressRoutes, weighted canary splits, traffic mirroring, middlewares, TLS options, and TCP/UDP routes, diagnose 404/502/TLS errors, and audit your edge security posture.

⁠Quick Reference

⁠What You Get

  • 15 MCP tools (5 read-only) built for AI agents and MCP clients
  • 12 MCP resources under traefik:// for structured context discovery
  • 7 Agent Skills bundled in /app/skills (browse on GitHub⁠)
  • Container ready: Includes kubectl inside a minimal non-root image (linux/amd64, linux/arm64). Runs over stdio transport.
  • Safe by default: starts in read-only mode until you explicitly set MCP_ALLOW_WRITE=true.

⁠Quick Start (MCP Client over stdio)

Use this configuration in Claude Desktop, Cursor, Windsurf, or VS Code (mcp.json / claude_desktop_config.json):

{
  "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"
      }
    }
  }
}

Using Claude Code? Register it in one command:

claude mcp add traefik -e TRAEFIK_NAMESPACE=traefik -- docker run -i --rm -v ~/.kube/config:/app/.kube/config:ro -e TRAEFIK_NAMESPACE talkopsai/traefik-mcp-server:latest

Tip: If your kubeconfig references external client certificate files (for example with minikube or kind), mount the full ~/.kube directory (-v /path/to/.kube:/app/.kube:ro) so those files are reachable inside the container.

Restart your MCP 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."

Note: Traefik MCP Server runs over stdio transport only (docker run -i --rm).


⁠Allowing Changes (Write Mode)

Out of the box, the container runs in read-only mode (MCP_ALLOW_WRITE=false). To allow mutations (creating, updating, or deleting routes, weighted services, middlewares, and TLS resources), pass -e MCP_ALLOW_WRITE=true to docker run. Even with writes enabled, changes support dry-run previews and destructive operations require explicit confirmation.


⁠Environment Variables

VariableContainer DefaultDescription
K8S_KUBECONFIG/app/.kube/configPath to mounted kubeconfig inside the container
K8S_CONTEXTcurrent contextKubernetes context name to target
TRAEFIK_NAMESPACEtraefikNamespace where Traefik runs
TRAEFIK_API_URLvia KubernetesOptional direct URL to the Traefik dashboard/API
PROMETHEUS_URLhttp://prometheus:9090Optional Prometheus URL for route traffic metrics
MCP_ALLOW_WRITEfalseSet to true to enable cluster mutations
MCP_ALLOWED_NAMESPACESallComma-separated allowlist of namespaces where writes are permitted
MCP_PROTECTED_NAMESPACESkube-system,traefikNamespaces requiring explicit confirmation before changes
MCP_TOOLSETSallFilter tools: traffic, policies, diagnostics, readonly

⁠Available Tools (15)

ToolAccessDescription
traefik_analyze_logsReadParse 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_configurationReadRun 20 deterministic security, TLS, reliability, hygiene, v3_migration, and gateway_api checks across Traefik static configuration, routes, policies, certificates, and Gateway API...
traefik_compare_traffic_metricsReadQuery 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 c...
traefik_configure_http_routeWriteCreate or update a Traefik v3 HTTP IngressRoute (<= 8 parameters).
traefik_configure_middlewareWriteCreate or update a Traefik v3 HTTP Middleware or TCP MiddlewareTCP (<= 8 parameters).
traefik_configure_servers_transportWriteCreate or update a Traefik ServersTransport or ServersTransportTCP CRD (<= 8 parameters).
traefik_configure_tcp_udp_routeWriteCreate or update a Traefik IngressRouteTCP or IngressRouteUDP (<= 8 parameters).
traefik_configure_tls_policyWrite (destructive)Create or update a Traefik TLSOption policy or default TLSStore (<= 8 parameters).
traefik_configure_traffic_mirroringWrite (destructive)Enable, update, or disable shadow traffic mirroring via a TraefikService (<= 8 parameters).
traefik_configure_weighted_serviceWriteCreate 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_resourceWrite (destructive)Delete a Traefik custom resource (IngressRoute, IngressRouteTCP, IngressRouteUDP, TraefikService, Middleware, MiddlewareTCP, TLSOption, TLSStore, ServersTransport, ServersTransport...
traefik_diagnose_routeReadPerform deep end-to-end health diagnosis of an IngressRoute, IngressRouteTCP, IngressRouteUDP, TraefikService, Ingress, HTTPRoute, GRPCRoute, TLSRoute, TCPRoute, or Gateway across...
traefik_set_traffic_weightsWriteShift traffic weights on an existing weighted TraefikService (<= 8 parameters).
traefik_trace_requestReadEvaluate 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-miss...
traefik_update_routeWrite (destructive)Patch an existing IngressRoute, IngressRouteTCP, or Kubernetes Ingress without restating the full resource (<= 8 parameters).

⁠Bundled Agent Skills (7)

This image also ships step-by-step operational playbooks (SKILL.md) under /app/skills:

To copy the skills onto your workstation for Claude Code or Cursor:

docker run --rm --entrypoint tar talkopsai/traefik-mcp-server:latest -C /app/skills -cf - . | tar -xf - -C ~/.claude/skills/

⁠Support & Community

Tag summary

Content type

Image

Digest

sha256:e77beace7…

Size

94.1 MB

Last updated

3 days ago

docker pull talkopsai/traefik-mcp-server