Skip to content

Commit 3209f71

Browse files
committed
H4HIP: Add MCP Server to Helm CLI
Signed-off-by: nick powell <[email protected]>
1 parent fcdf969 commit 3209f71

File tree

2 files changed

+119
-0
lines changed

2 files changed

+119
-0
lines changed

hips/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ restricted markdown format and can be found in the
3535
- [hip-0024: Improve the Helm Documentation](hip-0024.md)
3636
- [hip-0025: Better Support for Resource Creation Sequencing](hip-0025.md)
3737
- [hip:0026: H4HIP: Wasm plugin system](hip-0026.md)
38+
- [hip-0028: Add MCP Server to Helm CLI](hip-0028.md)

hips/hip-0028.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
---
2+
hip: "0028"
3+
title: "Add MCP Server to Helm CLI"
4+
authors: [ "nick powell <[email protected]>" ]
5+
created: "2025-09-03"
6+
type: "feature"
7+
status: "draft"
8+
---
9+
10+
## Abstract
11+
12+
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.
13+
14+
## Motivation
15+
16+
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.
17+
18+
## Specification
19+
20+
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.
21+
22+
### MCP Command Tree
23+
24+
The integration adds the following command hierarchy under `helm mcp`:
25+
26+
```
27+
helm mcp
28+
├── start # Start MCP server on stdio
29+
├── tools # Export available MCP tools as JSON
30+
├── claude
31+
│ ├── enable # Enable Helm MCP in Claude Desktop
32+
│ ├── disable # Disable Helm MCP in Claude Desktop
33+
│ └── list # List MCP configurations in Claude Desktop
34+
└── vscode
35+
├── enable # Enable Helm MCP in VS Code
36+
├── disable # Disable Helm MCP in VS Code
37+
└── list # List MCP configurations in VS Code
38+
```
39+
40+
### Available MCP Tools
41+
42+
Once enabled, AI assistants will have access to the following Helm operations as MCP tools. Each Helm command becomes an MCP tool, with its flags and arguments automatically converted to the tool's input schema:
43+
44+
| Tool Name | Helm Command | Description |
45+
|-----------|--------------|-------------|
46+
| `helm_list` | `helm list` | List releases in current namespace |
47+
| `helm_status` | `helm status` | Show the status of a named release |
48+
| `helm_history` | `helm history` | Fetch release history |
49+
| `helm_get_all` | `helm get all` | Download all information for a named release |
50+
| `helm_get_hooks` | `helm get hooks` | Download hooks for a named release |
51+
| `helm_get_manifest` | `helm get manifest` | Download the manifest for a named release |
52+
| `helm_get_metadata` | `helm get metadata` | Download metadata for a named release |
53+
| `helm_get_notes` | `helm get notes` | Download notes for a named release |
54+
| `helm_get_values` | `helm get values` | Download values for a named release |
55+
| `helm_show_all` | `helm show all` | Show all information of a chart |
56+
| `helm_show_chart` | `helm show chart` | Show the chart's metadata |
57+
| `helm_show_crds` | `helm show crds` | Show the chart's CRDs |
58+
| `helm_show_readme` | `helm show readme` | Show the chart's README |
59+
| `helm_show_values` | `helm show values` | Show the chart's default values |
60+
61+
The complete tool definitions with their schemas can be exported by running `helm mcp tools`.
62+
63+
## Rationale
64+
65+
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.
66+
67+
## Backwards compatibility
68+
69+
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.
70+
71+
## How to teach this
72+
73+
- Provide a quick start guide showing how to enable MCP in Claude Desktop or VS Code
74+
- Include examples demonstrating AI-assisted Helm workflows
75+
76+
### Example Usage
77+
78+
```bash
79+
# Enable for Claude Desktop
80+
helm mcp claude enable
81+
```
82+
```bash
83+
# Enable for VS Code
84+
helm mcp vscode enable
85+
```
86+
87+
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.
88+
89+
## Reference Implementation
90+
91+
[PR #31221](https://github.com/helm/helm/pull/31221)
92+
93+
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`:
94+
95+
```go
96+
// add mcp server commands
97+
rootCmd.AddCommand(
98+
ophis.Command(&ophis.Config{
99+
GeneratorOptions: []tools.GeneratorOption{
100+
tools.WithFilters(tools.Allow([]string{
101+
"list",
102+
"status",
103+
"get",
104+
"history",
105+
"show",
106+
})),
107+
},
108+
}),
109+
)
110+
```
111+
112+
## Open issues
113+
114+
### Command Granularity
115+
Should subcommands be filtered more granularly? For example, allowing `helm repo list` but not `helm repo add`?
116+
117+
### Upgrade Path
118+
Version handoff using upgrade methods like `brew` should be explored

0 commit comments

Comments
 (0)