Skip to content

Commit 4f915a7

Browse files
author
jeff nasseri
committed
feature(helm): Add Helm (CLI) integration for MCP server framework
This commit introduces a new MCP server for Helm, the Kubernetes package manager, enabling AI assistants to interact with Helm through natural language. The integration provides comprehensive coverage of Helm's functionality including chart management, release operations, repository handling, and more. The implementation includes: - A complete Python MCP server with support for all major Helm commands - Docker configuration for containerized deployment - Comprehensive documentation with usage examples for each command - Project configuration with proper packaging and versioning - MIT license for open-source distribution This server allows AI assistants to perform complex Helm operations like installing charts, managing repositories, checking release status, and templating charts through a standardized interface, making Kubernetes management more accessible through natural language interactions.
1 parent 5a9e8dd commit 4f915a7

File tree

7 files changed

+2012
-0
lines changed

7 files changed

+2012
-0
lines changed

src/helm/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
__pycache__
2+
.venv

src/helm/Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
FROM python:3.10-slim
2+
3+
# Install Helm and required dependencies
4+
RUN apt-get update && \
5+
apt-get install -y curl apt-transport-https gnupg2 && \
6+
curl https://baltocdn.com/helm/signing.asc | apt-key add - && \
7+
echo "deb https://baltocdn.com/helm/stable/debian/ all main" | tee /etc/apt/sources.list.d/helm-stable-debian.list && \
8+
apt-get update && \
9+
apt-get install -y helm && \
10+
apt-get clean && \
11+
rm -rf /var/lib/apt/lists/*
12+
13+
# Set up work directory
14+
WORKDIR /app
15+
16+
# Install MCP package
17+
RUN pip install --no-cache-dir mcp>=0.1.0
18+
19+
# Copy the MCP server code
20+
COPY ./src/mcp_server_helm/server.py .
21+
22+
# Set the entrypoint to run the server directly
23+
ENTRYPOINT ["python", "/app/server.py"]

src/helm/LICENSE

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright (c) 2024 Anthropic, PBC.
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

src/helm/README.md

Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
## Overview
2+
3+
Helm MCP provides a bridge between AI assistants and the Helm package manager for Kubernetes. It allows AI assistants to interact with Helm through natural language requests, executing commands like installing charts, managing repositories, and more.
4+
5+
## Installation
6+
7+
### Prerequisites
8+
- Python 3.8+
9+
- Docker (for containerized deployment)
10+
- Helm CLI installed
11+
12+
### Using Docker
13+
14+
Build and run the Docker container:
15+
16+
```bash
17+
# Clone the repository
18+
git clone https://github.com/modelcontextprotocol/servers.git
19+
cd src/helm
20+
21+
# Build the Docker image
22+
docker build -t mcp-helm .
23+
```
24+
25+
### Manual Installation
26+
27+
```bash
28+
# Clone the repository
29+
git clone https://github.com/modelcontextprotocol/servers.git
30+
cd src/helm
31+
32+
# Install dependencies
33+
uv venv
34+
source .venv/Scripts/Activate.ps1
35+
uv pip install -e .
36+
37+
# Run the server
38+
mcp-server-helm
39+
```
40+
41+
## Supported Functionalities
42+
43+
Helm MCP supports all major Helm commands, including:
44+
45+
### Completion Commands
46+
- `helm completion` - Generate autocompletion scripts for various shells
47+
48+
### Chart Creation and Management
49+
- `helm create` - Create a new chart
50+
- `helm lint` - Verify chart formatting
51+
- `helm package` - Package a chart directory into a chart archive
52+
- `helm template` - Render chart templates locally
53+
54+
### Dependency Management
55+
- `helm dependency build` - Build chart dependencies
56+
- `helm dependency list` - List chart dependencies
57+
- `helm dependency update` - Update chart dependencies
58+
59+
### Environment
60+
- `helm env` - Show Helm environment information
61+
- `helm version` - Show Helm version
62+
63+
### Release Management
64+
- `helm install` - Install a chart
65+
- `helm uninstall` - Uninstall a release
66+
- `helm upgrade` - Upgrade a release
67+
- `helm rollback` - Rollback a release to a previous revision
68+
- `helm list` - List releases
69+
- `helm status` - Show release status
70+
- `helm history` - Show release history
71+
- `helm test` - Run tests for a release
72+
73+
### Release Information
74+
- `helm get all` - Get all information about a release
75+
- `helm get hooks` - Get hooks for a release
76+
- `helm get manifest` - Get manifest for a release
77+
- `helm get metadata` - Get metadata for a release
78+
- `helm get notes` - Get notes for a release
79+
- `helm get values` - Get values for a release
80+
81+
### Repository Management
82+
- `helm repo add` - Add a chart repository
83+
- `helm repo index` - Generate an index file for a chart repository
84+
- `helm repo list` - List chart repositories
85+
- `helm repo remove` - Remove a chart repository
86+
- `helm repo update` - Update chart repositories
87+
- `helm search repo` - Search repositories for charts
88+
- `helm search hub` - Search Helm Hub for charts
89+
90+
### Registry Management
91+
- `helm registry login` - Log in to a registry
92+
- `helm registry logout` - Log out from a registry
93+
- `helm push` - Push a chart to a registry
94+
- `helm pull` - Pull a chart from a repository
95+
96+
### Chart Information
97+
- `helm show all` - Show all information for a chart
98+
- `helm show chart` - Show chart definition
99+
- `helm show crds` - Show Custom Resource Definitions
100+
- `helm show readme` - Show README
101+
- `helm show values` - Show values
102+
103+
### Plugin Management
104+
- `helm plugin install` - Install a plugin
105+
- `helm plugin list` - List plugins
106+
- `helm plugin uninstall` - Uninstall a plugin
107+
- `helm plugin update` - Update a plugin
108+
109+
### Verification
110+
- `helm verify` - Verify a chart
111+
112+
## Using UV CLI to Call MCP Commands
113+
114+
Here are examples of using the UV CLI to call various Helm MCP commands:
115+
116+
### Completion Commands
117+
```bash
118+
uv run mcp-cli cmd --server helm --tool helm_completion --tool-args '{"shell": "bash"}'
119+
uv run mcp-cli cmd --server helm --tool helm_completion --tool-args '{"shell": "zsh"}'
120+
uv run mcp-cli cmd --server helm --tool helm_completion --tool-args '{"shell": "fish"}'
121+
uv run mcp-cli cmd --server helm --tool helm_completion --tool-args '{"shell": "powershell"}'
122+
```
123+
124+
### Chart Creation and Management
125+
```bash
126+
uv run mcp-cli cmd --server helm --tool helm_create --tool-args '{"name": "mychart"}'
127+
uv run mcp-cli cmd --server helm --tool helm_lint --tool-args '{"chart_path": "./mychart"}'
128+
uv run mcp-cli cmd --server helm --tool helm_package --tool-args '{"chart_path": "./mychart"}'
129+
uv run mcp-cli cmd --server helm --tool helm_template --tool-args '{"chart": "./mychart", "release_name": "my-release"}'
130+
```
131+
132+
### Dependency Management
133+
```bash
134+
uv run mcp-cli cmd --server helm --tool helm_dependency_build --tool-args '{"chart_path": "./mychart"}'
135+
uv run mcp-cli cmd --server helm --tool helm_dependency_list --tool-args '{"chart_path": "./mychart"}'
136+
uv run mcp-cli cmd --server helm --tool helm_dependency_update --tool-args '{"chart_path": "./mychart"}'
137+
```
138+
139+
### Environment
140+
```bash
141+
uv run mcp-cli cmd --server helm --tool helm_env --tool-args '{}'
142+
uv run mcp-cli cmd --server helm --tool helm_version --tool-args '{}'
143+
```
144+
145+
### Release Management
146+
```bash
147+
uv run mcp-cli cmd --server helm --tool helm_install --tool-args '{"chart": "bitnami/nginx", "release_name": "my-nginx"}'
148+
uv run mcp-cli cmd --server helm --tool helm_uninstall --tool-args '{"release_name": "my-nginx"}'
149+
uv run mcp-cli cmd --server helm --tool helm_upgrade --tool-args '{"release_name": "my-nginx", "chart": "bitnami/nginx", "set_values": {"replicaCount": "3"}}'
150+
uv run mcp-cli cmd --server helm --tool helm_rollback --tool-args '{"release_name": "my-nginx", "revision": 1}'
151+
uv run mcp-cli cmd --server helm --tool helm_list --tool-args '{}'
152+
uv run mcp-cli cmd --server helm --tool helm_status --tool-args '{"release_name": "my-nginx"}'
153+
uv run mcp-cli cmd --server helm --tool helm_history --tool-args '{"release_name": "my-nginx"}'
154+
uv run mcp-cli cmd --server helm --tool helm_test --tool-args '{"release_name": "my-nginx"}'
155+
```
156+
157+
### Release Information
158+
```bash
159+
uv run mcp-cli cmd --server helm --tool helm_get_all --tool-args '{"release_name": "my-nginx"}'
160+
uv run mcp-cli cmd --server helm --tool helm_get_hooks --tool-args '{"release_name": "my-nginx"}'
161+
uv run mcp-cli cmd --server helm --tool helm_get_manifest --tool-args '{"release_name": "my-nginx"}'
162+
uv run mcp-cli cmd --server helm --tool helm_get_metadata --tool-args '{"release_name": "my-nginx"}'
163+
uv run mcp-cli cmd --server helm --tool helm_get_notes --tool-args '{"release_name": "my-nginx"}'
164+
uv run mcp-cli cmd --server helm --tool helm_get_values --tool-args '{"release_name": "my-nginx", "all_values": true}'
165+
```
166+
167+
### Repository Management
168+
```bash
169+
uv run mcp-cli cmd --server helm --tool helm_repo_add --tool-args '{"name": "bitnami", "url": "https://charts.bitnami.com/bitnami"}'
170+
uv run mcp-cli cmd --server helm --tool helm_repo_index --tool-args '{"directory": "./charts"}'
171+
uv run mcp-cli cmd --server helm --tool helm_repo_list --tool-args '{}'
172+
uv run mcp-cli cmd --server helm --tool helm_repo_remove --tool-args '{"name": "bitnami"}'
173+
uv run mcp-cli cmd --server helm --tool helm_repo_update --tool-args '{}'
174+
uv run mcp-cli cmd --server helm --tool helm_search_repo --tool-args '{"keyword": "nginx"}'
175+
uv run mcp-cli cmd --server helm --tool helm_search_hub --tool-args '{"keyword": "nginx"}'
176+
```
177+
178+
### Registry Management
179+
```bash
180+
uv run mcp-cli cmd --server helm --tool helm_registry_login --tool-args '{"registry_url": "registry.example.com", "username": "user", "password": "pass123"}'
181+
uv run mcp-cli cmd --server helm --tool helm_registry_logout --tool-args '{"registry_url": "registry.example.com"}'
182+
uv run mcp-cli cmd --server helm --tool helm_push --tool-args '{"chart_path": "./mychart-1.0.0.tgz", "registry_url": "oci://registry.example.com/charts"}'
183+
uv run mcp-cli cmd --server helm --tool helm_pull --tool-args '{"chart": "nginx", "repo": "bitnami", "version": "13.2.0"}'
184+
```
185+
186+
### Chart Information
187+
```bash
188+
uv run mcp-cli cmd --server helm --tool helm_show_all --tool-args '{"chart": "nginx", "repo": "bitnami"}'
189+
uv run mcp-cli cmd --server helm --tool helm_show_chart --tool-args '{"chart": "nginx", "repo": "bitnami"}'
190+
uv run mcp-cli cmd --server helm --tool helm_show_crds --tool-args '{"chart": "prometheus-operator", "repo": "prometheus-community"}'
191+
uv run mcp-cli cmd --server helm --tool helm_show_readme --tool-args '{"chart": "nginx", "repo": "bitnami"}'
192+
uv run mcp-cli cmd --server helm --tool helm_show_values --tool-args '{"chart": "nginx", "repo": "bitnami"}'
193+
```
194+
195+
### Plugin Management
196+
```bash
197+
uv run mcp-cli cmd --server helm --tool helm_plugin_install --tool-args '{"plugin_url": "https://github.com/chartmuseum/helm-push"}'
198+
uv run mcp-cli cmd --server helm --tool helm_plugin_list --tool-args '{}'
199+
uv run mcp-cli cmd --server helm --tool helm_plugin_uninstall --tool-args '{"plugin_name": "push"}'
200+
uv run mcp-cli cmd --server helm --tool helm_plugin_update --tool-args '{"plugin_name": "push"}'
201+
```
202+
203+
### Verification
204+
```bash
205+
uv run mcp-cli cmd --server helm --tool helm_verify --tool-args '{"path": "./mychart-1.0.0.tgz"}'
206+
```
207+
208+
## Configuration
209+
210+
### Usage with Claude Desktop
211+
212+
Add this to your `claude_desktop_config.json`:
213+
214+
<details>
215+
<summary>Using uvx</summary>
216+
217+
```json
218+
"mcpServers": {
219+
"helm": {
220+
"command": "uvx",
221+
"args": ["mcp-server-helm"]
222+
}
223+
}
224+
```
225+
</details>
226+
227+
<details>
228+
<summary>Using docker</summary>
229+
230+
```json
231+
"mcpServers": {
232+
"helm": {
233+
"command": "docker",
234+
"args": ["run", "--rm", "-i", "mcp/helm"]
235+
}
236+
}
237+
```
238+
</details>
239+
240+
## Inspector
241+
```shell
242+
# run the inspector against the mcp-server-helm
243+
npx @modelcontextprotocol/inspector uvx mcp-server-helm
244+
```
245+
246+
## Build
247+
248+
Docker build:
249+
250+
```bash
251+
cd src/helm
252+
docker build -t mcp/helm .
253+
```
254+
255+
## License
256+
257+
This MCP server is licensed under the MIT License. This means you are free to use, modify, and distribute the software, subject to the terms and conditions of the MIT License. For more details, please see the LICENSE file in the project repository.

src/helm/pyproject.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "mcp-server-helm"
7+
version = "0.1.1"
8+
description = "MCP server for Helm integration with Claude and other AI assistants"
9+
readme = "README.md"
10+
requires-python = ">=3.8"
11+
license = {text = "MIT"}
12+
authors = [
13+
{name = "Jeff Nasseri", email = "jeff.nasseri@example.com"}
14+
]
15+
classifiers = [
16+
"Programming Language :: Python :: 3",
17+
"License :: OSI Approved :: MIT License",
18+
"Operating System :: OS Independent",
19+
]
20+
dependencies = [
21+
"mcp-python>=0.1.0",
22+
]
23+
24+
[project.scripts]
25+
mcp-server-helm = "mcp_helm.server:main"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""MCP server for Helm integration."""
2+
3+
__version__ = "0.1.1"

0 commit comments

Comments
 (0)