Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions hips/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ restricted markdown format and can be found in the
- [hip-0024: Improve the Helm Documentation](hip-0024.md)
- [hip-0025: Better Support for Resource Creation Sequencing](hip-0025.md)
- [hip:0026: H4HIP: Wasm plugin system](hip-0026.md)
- [hip-0028: Add MCP Server to Helm CLI](hip-0028.md)
118 changes: 118 additions & 0 deletions hips/hip-0028.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
---
hip: "0028"
title: "Add MCP Server to Helm CLI"
authors: [ "nick powell <[email protected]>" ]
created: "2025-09-03"
type: "feature"
status: "draft"
---

## Abstract

This HIP adds MCP (Model Context Protocol) support to Helm, letting AI assistants like Claude safely run read-only Helm commands. It's completely opt-in, only exposes read operations, and requires minimal implementation effort. The integration automatically converts Helm's Cobra commands into MCP tools, with command flags and arguments becoming the tool's input schema.

## Motivation

Developers are increasingly using AI assistants in their workflows. Currently, if an AI assistant needs to help with Helm operations, users must manually copy and paste terminal output. With MCP support, AI assistants can directly query Helm releases, check status, and explore charts without manual intervention.

## Specification

This HIP adds `helm mcp` commands that enable AI assistants to run safe, read-only Helm operations. Each allowed Helm command becomes an MCP tool, with the command's flags (like `--namespace`, `--all-namespaces`, `--output`) and arguments becoming the tool's input parameters that the AI assistant can use. Convenience commands, like `helm mcp claude enable`, provide a fast and easy opt-in user experience.

### MCP Command Tree

The integration adds the following command hierarchy under `helm mcp`:

```
helm mcp
├── start # Start MCP server on stdio
├── tools # Export available MCP tools as JSON
├── claude
│ ├── enable # Enable Helm MCP in Claude Desktop
│ ├── disable # Disable Helm MCP in Claude Desktop
│ └── list # List MCP configurations in Claude Desktop
└── vscode
├── enable # Enable Helm MCP in VS Code
├── disable # Disable Helm MCP in VS Code
└── list # List MCP configurations in VS Code
```

### Available MCP Tools

Once enabled, AI assistants will have access to the following Helm operations as MCP tools. This list is subject to change with the command tree. Each Helm command becomes an MCP tool, with its flags and arguments automatically converted to the tool's input schema:

| Tool Name | Helm Command | Description |
|-----------|--------------|-------------|
| `helm_list` | `helm list` | List releases in current namespace |
| `helm_status` | `helm status` | Show the status of a named release |
| `helm_history` | `helm history` | Fetch release history |
| `helm_get_all` | `helm get all` | Download all information for a named release |
| `helm_get_hooks` | `helm get hooks` | Download hooks for a named release |
| `helm_get_manifest` | `helm get manifest` | Download the manifest for a named release |
| `helm_get_metadata` | `helm get metadata` | Download metadata for a named release |
| `helm_get_notes` | `helm get notes` | Download notes for a named release |
| `helm_get_values` | `helm get values` | Download values for a named release |
| `helm_show_all` | `helm show all` | Show all information of a chart |
| `helm_show_chart` | `helm show chart` | Show the chart's metadata |
| `helm_show_crds` | `helm show crds` | Show the chart's CRDs |
| `helm_show_readme` | `helm show readme` | Show the chart's README |
| `helm_show_values` | `helm show values` | Show the chart's default values |

The complete tool definitions with their schemas can be exported by running `helm mcp tools`.

## Rationale

The proposed design leverages Helm's existing Cobra command structure to automatically generate MCP tools. Each Cobra command becomes an MCP tool, with the command's flags and arguments becoming the tool's input schema - meaning Helm's existing CLI structure directly maps to the MCP interface without additional configuration. This approach minimizes code changes and maintenance burden while providing a natural mapping between CLI commands and MCP tools.

## Backwards compatibility

Helm will continue to function exactly as before for users who do not enable MCP support. The MCP feature is entirely opt-in and does not modify any existing Helm commands or behaviors.

## How to teach this

- Provide a quick start guide showing how to enable MCP in Claude Desktop or VS Code
- Include examples demonstrating AI-assisted Helm workflows

### Example Usage

```bash
# Enable for Claude Desktop
helm mcp claude enable
```
```bash
# Enable for VS Code
helm mcp vscode enable
```

Users can then ask their AI assistant questions like "What Helm releases are deployed?" or "Show me the nginx values" and the assistant will execute the appropriate commands and provide explanations.

## Reference Implementation

[PR #31221](https://github.com/helm/helm/pull/31221)

The implementation uses [Ophis](https://github.com/njayp/ophis), a Go library that automatically converts Cobra CLI commands into MCP servers. Each allowed Cobra command becomes an MCP tool, with the command's flags and arguments automatically becoming the tool's input parameters. The integration is added to `pkg/cmd/root.go`:

```go
// add mcp server commands
rootCmd.AddCommand(
ophis.Command(&ophis.Config{
GeneratorOptions: []tools.GeneratorOption{
tools.WithFilters(tools.Allow([]string{
"helm list",
"helm status",
"helm get",
"helm history",
"helm show",
"helm search",
"helm repo list",
"helm repo update",
})),
},
}),
)
```

## Open issues

### Command Granularity
Should subcommands be filtered more granularly? For example, allowing `helm repo list` but not `helm repo add`?