Skip to main content

MCP server for Kubernetes manifest and Helm chart validation

Project description

kube-lint-mcp

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

mcp-name: io.github.archy-rock3t-cloud/kube-lint-mcp

MCP server that validates Kubernetes manifests and Helm charts with kubectl dry-run 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)

Installation

pip (requires CLI tools installed separately)

pip install kube-lint-mcp

Docker (batteries included)

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

docker pull sophotechlabs/kube-lint-mcp:latest
# or: 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

Tool Description
select_kube_context Pick a cluster context (held in memory, no kubeconfig mutation). Call first.
list_kube_contexts Show available kubectl contexts and which is selected
flux_dryrun Validate FluxCD YAML with client + server dry-run
kustomize_dryrun Build and dry-run a Kustomize overlay end-to-end
helm_dryrun Lint, render, and dry-run a Helm chart end-to-end
flux_check Verify Flux installation health
flux_status Show Flux reconciliation status across namespaces
kubeconform_validate Offline schema validation — no cluster needed

Workflow

  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

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.

Development

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

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kube_lint_mcp-0.4.2.tar.gz (33.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kube_lint_mcp-0.4.2-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file kube_lint_mcp-0.4.2.tar.gz.

File metadata

  • Download URL: kube_lint_mcp-0.4.2.tar.gz
  • Upload date:
  • Size: 33.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kube_lint_mcp-0.4.2.tar.gz
Algorithm Hash digest
SHA256 19f33b00dd37282818224e9606e4e6be37a2a74c244672e6d58ec2941c39b1ba
MD5 5f9351b7db2214f79c249d6c8fb11869
BLAKE2b-256 2398d6f5cd30feab21c5c780e32a141ae6540bb7dd7d390ad685578ac0abd87d

See more details on using hashes here.

Provenance

The following attestation bundles were made for kube_lint_mcp-0.4.2.tar.gz:

Publisher: release-on-merge.yml on sophotechlabs/kube-lint-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kube_lint_mcp-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: kube_lint_mcp-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kube_lint_mcp-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d1a0cad7f29d9e79424cd34a901a88d38b28f465199dcca57bd6972c67ebe352
MD5 5c7c87c96c41a44a52ec7bf05f1ad07f
BLAKE2b-256 b6000884621591ecef25e24fbb58c075f48e435a3521e2c0b6184eb59476655e

See more details on using hashes here.

Provenance

The following attestation bundles were made for kube_lint_mcp-0.4.2-py3-none-any.whl:

Publisher: release-on-merge.yml on sophotechlabs/kube-lint-mcp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page