Skip to main content

helm-python-ai — MCP Server and AI Agent for Helm

PyPI CI License: Apache-2.0 Python MCP

A Model Context Protocol (MCP) server and an autonomous AI agent for Helm, the Kubernetes package manager. Manage Helm releases from Claude Code, Claude Desktop, or any MCP client — or hand a plain-language mission to an LLM agent that investigates and operates your deployments — with safety tiers, dry-run defaults, and a structured audit trail. Built in Python on helm-python-sdk, which binds Helm's official Go SDK directly: no helm binary, no kubectl, no shelling out.

Two fronts share one safety-tiered tool layer:

Command What it is Runtime
helm-ai-mcp An MCP server exposing Helm operations to any MCP client (Claude Code, Claude Desktop, …) mcp ≥ 2
helm-ai-agent An autonomous agent that investigates and operates releases from a plain-language mission anthropic
helm (Go SDK) → helm-c-sdk (C ABI) → helm-python-sdk (ctypes) → helm-python-ai
                                                                 ├─ helm-ai-mcp    (MCP server)
                                                                 └─ helm-ai-agent  (agent CLI)

Install

pip install "helm-python-ai[all]"       # both fronts
pip install "helm-python-ai[server]"    # MCP server only
pip install "helm-python-ai[agent]"     # agent only

Python ≥ 3.10. The native Helm library ships inside the helm-python-sdk wheel — nothing else to install.

The MCP server

Register in your MCP client (stdio transport):

{
  "mcpServers": {
    "helm": {
      "command": "helm-ai-mcp"
    }
  }
}

Fifteen tools in three tiers:

  • Read (always available): helm_list_releases, helm_release_status, helm_release_manifest, helm_release_history, helm_release_values, helm_show_chart, helm_template_chart, helm_lint_chart, helm_search_repository, helm_chart_tags, helm_versions.
  • Write (dry-run by default): helm_install_release, helm_upgrade_release. They run as server-side dry runs unless called with apply=true and the server environment sets HELM_AI_ALLOW_WRITES=1.
  • Destructive (double-gated): helm_uninstall_release, helm_rollback_release. They require confirm=<release name> echoed exactly and HELM_AI_ALLOW_DESTRUCTIVE=1 in the server environment.

Cluster access uses the standard kubeconfig resolution (KUBECONFIG, then ~/.kube/config, then in-cluster).

Live feedback

Long-running tools (installs, upgrades, registry operations) are async and send MCP progress notifications every few seconds while they run — elapsed time plus the Helm SDK's own live log line ("waiting for resources…") — so the host can show real activity instead of a call that looks stuck.

Releases dashboard (MCP Apps)

helm_list_releases ships an MCP Apps (SEP-1865) UI: hosts that support the extension — Claude among them — render the releases as an interactive table (status badges, revisions, chart versions) directly in the conversation. Hosts without the extension see the same JSON text as before; nothing is lost.

Docker

docker build -t helm-ai-mcp .

The build installs helm-python-sdk straight from PyPI — prebuilt wheels exist for amd64 and arm64, so nothing compiles — on Docker Hardened Images (digest-pinned, Debian/glibc): a -dev stage assembles the venv and the hardened runtime variant ships it (non-root, no shell, no installers, near-zero CVEs). Pulling dhi.io needs a free Docker login.

Run it with least privilege (no capabilities, no privilege escalation, read-only root filesystem, tmpfs scratch space):

{
  "mcpServers": {
    "helm": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "--init",
               "--read-only", "--cap-drop", "ALL",
               "--security-opt", "no-new-privileges",
               "--tmpfs", "/tmp", "--tmpfs", "/home/nonroot",
               "-v", "/home/you/.kube/config:/home/nonroot/.kube/config:ro",
               "helm-ai-mcp"]
    }
  }
}

docker-compose.yml wraps the same image for docker compose run --rm helm-mcp (compose run, not up: stdio servers are launched by their client) with the same hardening baked in (cap_drop: [ALL], no-new-privileges, read_only, tmpfs mounts, pids_limit). Pass -e HELM_AI_ALLOW_WRITES=1 / -e HELM_AI_ALLOW_DESTRUCTIVE=1 only when you mean it, and prefer mounting a kubeconfig whose RBAC matches the tier you enabled.

The agent

export ANTHROPIC_API_KEY=...   # or an active `ant auth` profile
helm-ai-agent "why is release payments-api failing in namespace prod?"

The agent investigates with the read-only tools first, cites evidence (revisions, values diffs, manifest details), dry-runs any change it proposes, and asks at the keyboard before applying or destroying anything:

  → list_releases {"namespace": "prod"}
  → release_history {"name": "payments-api", "namespace": "prod"}
  → release_values {"name": "payments-api", "revision": 6}

APPROVAL NEEDED: helm upgrade payments-api ./charts/payments (namespace=prod)
Proceed? [y/N]

--yes auto-approves gated operations (for scripted use, together with the environment gates); --model selects the Claude model (default claude-opus-5); -v/--verbose streams the Helm SDK's own log lines to stderr while operations run.

Security model

The design follows the MCP security best practices and the OWASP GenAI Practical Guide for Secure MCP Server Development (v1.0, Feb 2026):

  • stdio transport only. The server is a local child process of its MCP client; it never opens a network socket, so the remote-transport attack classes (token passthrough, confused deputy, session hijacking) do not arise. Do not put it behind an HTTP proxy without adding authentication.
  • Structured, schema-validated invocation. Every tool has a typed JSON schema; values documents are size-capped (1 MB) and must parse to a JSON object; release names are validated by Helm's own rules before use.
  • Least privilege by default. Read tools are ungated; writes are dry-run unless explicitly enabled; destructive operations are double-gated (exact-name confirmation + a separate environment flag). For defense in depth, run the server with a kubeconfig whose RBAC matches the tier you enabled — a read-only account when the gates are off.
  • Human in the loop. The agent pauses for keyboard approval on every write/destructive operation; over MCP (no terminal), the environment gates are the authorization channel and the client's own approval UI governs tool use.
  • No secrets in the model's reach. No tool accepts or returns credentials. Registry and cluster credentials come from Helm's and Kubernetes' own configuration files; there is no login tool, and error messages carry Helm's detail strings, not tracebacks.
  • Untrusted data stays data. Chart READMEs, notes, values, and manifests are cluster-controlled input. The agent's system prompt pins them as data-not-instructions; treat MCP tool output the same way in your client.
  • Resource limits. Install/upgrade waits are capped (300 s default) and tool output is truncated at 200 K characters with an explicit marker, so a wedged rollout or a huge manifest cannot hang the process or flood the model's context.
  • Audit trail. Every allow/refuse decision and every mutating operation (with parameters) is logged to stderr, where the MCP host captures it — stdout stays reserved for protocol framing.

Observability & audit

Instrumentation is vendor-neutral OpenTelemetry; no backend is bundled.

  • Tracing — the MCP SDK emits a span per inbound message (tools/call helm_install_release, GenAI execute_tool attributes, W3C trace-context propagation from the caller), and the tool layer adds a nested span per operation. The agent wraps each mission in an invoke_agent span carrying gen_ai.usage.input_tokens/ output_tokens and turn count. Export activates only when the standard OTEL_EXPORTER_OTLP_ENDPOINT is set and the observability extra is installed (pip install helm-python-ai[observability]); point it at any OTLP backend (Grafana/Tempo, Jaeger, Langfuse, Datadog, ...).
  • Audit trail — every tool invocation (with an allowlisted argument snapshot; values payloads are recorded as sizes only, never content), every safety allow/refuse decision, every MCP request outcome, and each agent mission produce structured JSON events on the helm_ai.audit logger (stderr) and, when HELM_AI_AUDIT_LOG=/path/file.jsonl is set, an append-only JSONL file. Events carry the active trace/span IDs, so audit records and traces cross-reference.
  • Metricshelm_ai.tool.calls (by tool and outcome) and a helm_ai.tool.duration histogram flow through the same OTLP pipeline; refusal spikes and error rates are the signals worth alerting on.

Development

python -m venv .venv && .venv/bin/pip install -e ".[dev]"
.venv/bin/pytest            # offline; cluster tests auto-skip
.venv/bin/ruff check src tests

License

Apache-2.0. See LICENSE and NOTICE.

Download files

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

Source Distribution

helm_python_ai-0.1.0.tar.gz (39.9 kB view details)

Uploaded Source

Built Distribution

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

helm_python_ai-0.1.0-py3-none-any.whl (32.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: helm_python_ai-0.1.0.tar.gz
  • Upload date:
  • Size: 39.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for helm_python_ai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1326246a0f6a127ca1b3a1d0c95eb975ae4cfaa3495e30b511a6859992d5949e
MD5 9fb65e990bb184eb4ea38d7a2cbf923d
BLAKE2b-256 a4b7e499765b7bbca0fcb6dd63c538651eb0bdd7f2b8fd6ac6db705b3b17ea5b

See more details on using hashes here.

Provenance

The following attestation bundles were made for helm_python_ai-0.1.0.tar.gz:

Publisher: wheels.yml on shivamkumar99/helm-python-ai

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

File details

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

File metadata

  • Download URL: helm_python_ai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for helm_python_ai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8f2f908a435a1349ff9134b38eaa91260ecfc32c573723cb668899016e17707d
MD5 c50456b2a5eddf7041c046e900d089a5
BLAKE2b-256 c27f79ec3719e1ea339c2ec6674b6bfd446353b57731faa95c130afb521170f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for helm_python_ai-0.1.0-py3-none-any.whl:

Publisher: wheels.yml on shivamkumar99/helm-python-ai

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

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

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