Skip to main content

MCP server for Kubernetes manifest and Helm chart validation

Project description

kube-lint-mcp

CI codecov PyPI Python 3.12+ License: MIT 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 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 install kube-lint-mcp

Or from source:

git clone https://github.com/sophotechlabs/kube-lint-mcp.git
cd kube-lint-mcp
pip install .

Configuration

Claude Code

Add to your project's .mcp.json:

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

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
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

Workflow

  1. list_kube_contexts — see available clusters
  2. select_kube_context — target a cluster (in-memory only, never mutates kubeconfig)
  3. flux_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    # 83 tests, 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


Built by Artem Muterko at Sophotech

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.1.0.tar.gz (13.9 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.1.0-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: kube_lint_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for kube_lint_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fe00e97013570907326d9560e26770870866a3b348e296fca5e34bc3786384c7
MD5 a869490ca274c9417e64e8c716b2fc63
BLAKE2b-256 d4ee96d0bb9f90ed805a51dff345f165aa171db10140ab7d7bb9e1d1f89ba2e5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: kube_lint_mcp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for kube_lint_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 780cabd314600ef575d4e133b71044f0f57af8ab7df268c48335ab20531dd890
MD5 7affc6d42c8166d2549c3ec72ba8b3c6
BLAKE2b-256 1e201f38ce37117707144e501bc8796948d231ad311b6b6089e141c2c9e88fb3

See more details on using hashes here.

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