Skip to main content

kube-lint-mcp

CI codecov OpenSSF Scorecard Quality Gate Status PyPI PyPI Downloads Docker Python 3.12+ License: MIT MCP

mcp-name: io.github.sophotechlabs/kube-lint-mcp

MCP server that validates Kubernetes manifests, Helm charts, and ArgoCD applications before you commit — preventing deployment and GitOps reconciliation failures.

Works with Claude Code, Claude Desktop, and any MCP-compatible client.

How it works

You: "Validate the flux manifests in ./k8s/infrastructure/"

Claude: calls list_kube_contexts → presents list → you confirm "staging"
        calls select_kube_context → flux_dryrun

  FluxCD Dry-Run Validation
  Context: staging
  ================================================
  File: infrastructure/redis.yaml
    Client dry-run: PASS
    Server dry-run: PASS

  File: infrastructure/postgres.yaml
    Client dry-run: PASS
    Server dry-run: FAIL
      Error: namespace "db" not found
  ================================================
  Summary: 1 passed, 1 failed

  DO NOT COMMIT - Fix errors first!

No flags, no CLI args — the AI agent picks the right tool automatically.

Prerequisites

  • Python 3.12+
  • kubectl configured with cluster access
  • helm (for Helm chart validation)
  • flux (for Flux operations)
  • argocd (for ArgoCD operations — uses --core mode, no server auth needed)

Installation

pip (requires CLI tools installed separately)

pip install kube-lint-mcp

Docker (batteries included)

The Docker image ships with kubectl, helm, flux, kubeconform, and argocd — no local installs needed.

docker pull ghcr.io/sophotechlabs/kube-lint-mcp:latest

Note: If your kubeconfig uses external auth plugins (e.g. gke-gcloud-auth-plugin, aws-iam-authenticator), those binaries are not included in the image. Use the pip install method for those clusters, or embed tokens directly in your kubeconfig.

Configuration

Claude Code (pip)

Add to your project's .mcp.json:

{
  "mcpServers": {
    "kube-lint": {
      "command": "python",
      "args": ["-m", "kube_lint_mcp"]
    }
  }
}

Claude Code (Docker)

{
  "mcpServers": {
    "kube-lint": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-v", "${HOME}:${HOME}:ro",
        "-e", "KUBECONFIG=${HOME}/.kube/config",
        "ghcr.io/sophotechlabs/kube-lint-mcp:latest"
      ]
    }
  }
}

The $HOME:$HOME:ro mount preserves absolute paths that MCP clients send to the server. The read-only flag ensures the container cannot modify your files.

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%/Claude/claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "kube-lint": {
      "command": "python",
      "args": ["-m", "kube_lint_mcp"]
    }
  }
}

Tools

select_kube_context

Pick a cluster context. Stored in memory only — never mutates your kubeconfig. Must be called before any validation tool.

Parameter Type Required Description
context string yes Name of the kubectl context to use

list_kube_contexts

Show available kubectl contexts with markers for the current (kubeconfig default) and selected (in-memory) context. No parameters.

flux_dryrun

Validate FluxCD YAML files with both client-side and server-side kubectl dry-run. Catches schema errors, missing CRDs, namespace issues, and deprecated API versions.

Parameter Type Required Description
path string yes Path to YAML file or directory containing manifests
You: "Validate the flux manifests in k8s/infrastructure/"

kustomize_dryrun

Build a Kustomize overlay and validate the rendered output with kubectl dry-run. Runs the full pipeline: kustomize build → client dry-run → server dry-run.

Parameter Type Required Description
path string yes Path to directory containing kustomization.yaml
You: "Dry-run the staging kustomize overlay in k8s/overlays/staging/"

helm_dryrun

End-to-end Helm chart validation: helm lint → helm template → client dry-run → server dry-run. Catches chart errors, template rendering issues, and invalid rendered manifests.

Parameter Type Required Description
chart_path string yes Path to Helm chart directory
values_file string no Path to custom values file
namespace string no Namespace for rendering
release_name string no Release name for helm template (default: release-name)
You: "Validate the nginx helm chart in charts/nginx/ with staging values"

flux_check

Verify Flux installation health by running flux check. Reports controller status and version compatibility. No parameters.

flux_status

Show Flux reconciliation status for all resources across all namespaces (flux get all -A). Useful for checking if resources are synced or stuck. No parameters.

argocd_app_list

List all ArgoCD applications with sync and health status. Uses --core mode — connects via kubeconfig, no ArgoCD server auth needed.

Parameter Type Required Description
namespace string no Namespace where Application CRs live (e.g. argocd, argo-cd)
You: "List all ArgoCD applications"

argocd_app_get

Get detailed status of a single ArgoCD application including sync/health status, conditions, and per-resource breakdown.

Parameter Type Required Description
app_name string yes Name of the ArgoCD Application
namespace string no Namespace where the Application CR lives
You: "Show me the status of the my-app ArgoCD application"

argocd_app_diff

Show unified diff between live and desired state of an ArgoCD application. Indicates whether the app is in sync or what would change on the next sync.

Parameter Type Required Description
app_name string yes Name of the ArgoCD Application
namespace string no Namespace where the Application CR lives
You: "Show me what would change if we sync the my-app ArgoCD application"

yaml_validate

Validate YAML syntax of Kubernetes manifest files. Catches syntax errors, duplicate keys, and tab indentation. Does not require a cluster connection.

Parameter Type Required Description
path string yes Path to YAML file or directory

kubeconform_validate

Offline schema validation against Kubernetes JSON schemas. Does not require a cluster connection. Catches invalid fields, type mismatches, and missing required fields.

Parameter Type Required Description
path string yes Path to YAML file or directory
kubernetes_version string no Target K8s version for schema lookup (e.g. 1.29.0). Default: master
strict boolean no Reject fields not in the schema (default: false)
You: "Validate all manifests in k8s/ against Kubernetes 1.29 with strict mode"

Typical workflow

FluxCD / Helm / Kustomize

  1. list_kube_contexts — see available clusters
  2. select_kube_context — target a cluster (in-memory only, never mutates kubeconfig)
  3. flux_dryrun, kustomize_dryrun, or helm_dryrun — validate before committing
  4. Only commit when all checks pass

ArgoCD

  1. list_kube_contexts / select_kube_context — pick a cluster
  2. argocd_app_list — see all apps and their sync/health status
  3. argocd_app_get — drill into a specific app's resources and conditions
  4. argocd_app_diff — see what would change on the next sync

For offline validation without a cluster, use kubeconform_validate or yaml_validate directly — no context selection needed.

Safety

The server never mutates your kubeconfig. Context is held in memory and passed via --context flag on every subprocess call. This is a deliberate safety choice for agentic use — the AI cannot accidentally switch your global kubectl context.

All validation tools are read-only — they use kubectl apply --dry-run which simulates without applying. No resources are created, modified, or deleted.

Configuration reference

Environment variables

Variable Default Description
KUBE_LINT_KUBECTL_TIMEOUT 60 Timeout in seconds for kubectl dry-run operations
KUBE_LINT_HELM_TIMEOUT 60 Timeout for helm lint and template operations
KUBE_LINT_FLUX_TIMEOUT 60 Timeout for flux check and status operations
KUBE_LINT_KUBECONFORM_TIMEOUT 120 Timeout for kubeconform validation
KUBE_LINT_ARGOCD_TIMEOUT 60 Timeout for ArgoCD CLI operations

Set these in your MCP server config:

{
  "mcpServers": {
    "kube-lint": {
      "command": "python",
      "args": ["-m", "kube_lint_mcp"],
      "env": {
        "KUBE_LINT_KUBECTL_TIMEOUT": "120"
      }
    }
  }
}

Troubleshooting

"kubectl not found" or "helm not found"

The pip install only installs the Python package. You need kubectl, helm, and flux installed separately and on your PATH. The Docker image includes all tools — use it if you don't want to manage CLI installations.

Docker: "unable to load kubeconfig" or auth errors

Make sure your kubeconfig is accessible inside the container. The $HOME:$HOME:ro mount maps your home directory read-only. If your kubeconfig references files outside $HOME (e.g. /etc/kubernetes/), mount those paths too.

If your kubeconfig uses auth plugins (GKE, EKS), the plugin binaries aren't in the Docker image. Either:

  • Use the pip install method instead
  • Or generate a static token/certificate kubeconfig for the Docker image

"context not selected" errors

Always call select_kube_context (or let the agent call list_kube_contexts first) before running any validation tool. The server does not read a default context from kubeconfig — this is intentional for safety.

Exception: kubeconform_validate works offline and does not need a context.

Timeouts on large charts or slow clusters

Increase the relevant timeout via environment variables. For a Helm chart with many templates against a slow API server:

{
  "env": {
    "KUBE_LINT_KUBECTL_TIMEOUT": "120",
    "KUBE_LINT_HELM_TIMEOUT": "120"
  }
}

Server dry-run fails but client dry-run passes

This is expected. Client dry-run validates syntax and schema locally. Server dry-run sends the manifest to the API server which checks additional constraints: namespace existence, CRD availability, admission webhooks, resource quotas. Fix the server-side issue before committing.

"argocd not found"

Install the ArgoCD CLI: brew install argocd (macOS) or download from releases. The Docker image includes the ArgoCD CLI.

ArgoCD --core mode

All ArgoCD tools use --core mode, which connects directly via your kubeconfig — no ArgoCD server authentication is needed. This requires that the ArgoCD CRDs (Application, AppProject) are installed on the cluster.

kubeconform reports "skipped" resources

Custom Resource Definitions (CRDs) don't have upstream schemas. kubeconform skips resources it can't validate. This is normal for FluxCD, cert-manager, and other CRD-heavy stacks.

Development

pip install -e ".[dev]"
make test    # 100% coverage
make lint    # ruff

Contributing

  1. Fork the repo
  2. Create a feature branch
  3. Make sure make test and make lint pass
  4. Open a PR

License

MIT


If this tool saves you from a bad deploy, consider sponsoring.

Metadata

Release files for kube-lint-mcp 0.8.9

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

Source distribution (sdist)

Source distribution for kube-lint-mcp 0.8.9
File Size Uploaded Provenance Actions
kube_lint_mcp-0.8.9.tar.gz 57.6 kB With provenance Details for kube_lint_mcp-0.8.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kube-lint-mcp 0.8.9
File Interpreter ABI Platform Actions
kube_lint_mcp-0.8.9-py3-none-any.whl Python 3 none any Details for kube_lint_mcp-0.8.9-py3-none-any.whl

Total release size: 85.4 kB

Release files / kube_lint_mcp-0.8.9.tar.gz

Download URL kube_lint_mcp-0.8.9.tar.gz
Size 57.6 kB
Tags Source
SHA-256 checksum
How to use checksums
093760d3ec8a0ae36415de9e40ae1a3f13a0f3a8ec2c7e3a9684a680b3068d1a
BLAKE2b-256 checksum
How to use checksums
504bf6000a8f17bd188789dd5ec0aa11efb1bcefa69093728c5190469adfb850
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 26, 2026.

Transparency log

Release files / kube_lint_mcp-0.8.9-py3-none-any.whl

Download URL kube_lint_mcp-0.8.9-py3-none-any.whl
Size 27.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
556e4802aac5f7a2d468d3d7b492f92da796ebfdeb0184187a659ed803ee2f3e
BLAKE2b-256 checksum
How to use checksums
b1e3a3e5da7f77a0b1b974cbd9ea8cd322bd305a7efdf918994fcc2486dc0409
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.13

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 Jun 26, 2026.

Transparency log

Security for kube-lint-mcp 0.8.9

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for kube_lint_mcp-0.8.9.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 Jun 26, 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.

Release history Release notifications | RSS feed

This release

0.8.9 This release

2 release files Full provenance

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