Skip to content

Commit 66d699c

Browse files
authored
mcp server helm chart #829
mcp server helm chart
2 parents 8d4c58f + 5534ef0 commit 66d699c

File tree

11 files changed

+312
-0
lines changed

11 files changed

+312
-0
lines changed

install/cyclops-mcp/.helmignore

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
24+
# Ignore Notes.txt file
25+
Notes.txt

install/cyclops-mcp/Chart.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
apiVersion: v2
2+
name: mcp-cyclops
3+
description: Cyclops MCP (Model Context Protocol) server
4+
type: application
5+
version: "0.1.0"
6+
appVersion: "v0.0.4"
7+
home: https://cyclops-ui.com/docs/mcp/about
8+
keywords:
9+
- Devops
10+
- Kubernetes operator
11+
- MCP
12+
- AI agent
13+
icon: https://cyclops-ui.com/img/logo.png

install/cyclops-mcp/README.md

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
# Cyclops MCP (Model Context Protocol)
2+
3+
Cyclops MCP allows your favorite AI agent to manage your Kubernetes applications. Cyclops MCP servers provide tools for agents to create and update existing applications safely.
4+
5+
This means it can check all of your existing templates and the schema of those templates to create accurate and production-ready applications. Your agent now has much less room to make a misconfiguration since it creates high-level resources (Cyclops Modules) instead of touching every line of your Kubernetes resources (Deployments, Services, and Ingresses).
6+
7+
It allows you to move fast and ensure no uncaught misconfigurations are hitting your production.
8+
9+
**With Cyclops and our MCP, you can now abstract Kubernetes complexity from your developers AND your AI agents**
10+
11+
## Install
12+
13+
### 1. Make sure Cyclops is installed in your Kubernetes cluster
14+
15+
Check our docs on how it install it with a single command - https://cyclops-ui.com/docs/installation/install/manifest
16+
17+
### 2. Download MCP server
18+
19+
You can download the Cyclops MCP server binary with the following command:
20+
21+
```yaml
22+
GOBIN="$HOME/go/bin" go install github.com/cyclops-ui/mcp-cyclops/cmd/mcp-cyclops@latest
23+
```
24+
25+
### 3. Add server configuration
26+
27+
> ⚠️ By default, Cyclops MCP will use the `.kube/config` file to connect to your cluster
28+
29+
Configure your MCP Cyclops server:
30+
31+
```json
32+
{
33+
"mcpServers": {
34+
"mcp-cyclops": {
35+
"command": "mcp-cyclops"
36+
}
37+
}
38+
}
39+
```
40+
41+
## Install on a Kubernetes cluster
42+
43+
Instead of having each developer install `mcp-cyclops` binary, you can install the Cyclops MCP server with SSE as transport type to your Kubernetes cluster and allow all of your developers to connect to the same server.
44+
45+
1. Before installing, make sure Cyclops and all its CRDs are installed in your cluster:
46+
1. Check Cyclops pods are running:
47+
48+
```shell
49+
kubectl get pods -n cyclops
50+
```
51+
52+
Should write:
53+
54+
```
55+
NAME READY STATUS RESTARTS AGE
56+
cyclops-ctrl-676b5d9789-ntcls 1/1 Running 0 94s
57+
cyclops-ui-7798655f97-xdg29 1/1 Running 0 94s
58+
```
59+
60+
2. Check if CRDs are installed
61+
62+
```shell
63+
kubectl get crds | grep cyclops-ui
64+
```
65+
66+
Should write:
67+
68+
```
69+
modules.cyclops-ui.com 2025-04-26T15:28:18Z
70+
templateauthrules.cyclops-ui.com 2025-04-26T15:28:18Z
71+
templatestores.cyclops-ui.com 2025-04-26T15:28:18Z
72+
```
73+
74+
2. Install Cyclops MCP server with the following command:
75+
76+
```shell
77+
kubectl apply -f https://raw.githubusercontent.com/cyclops-ui/mcp-cyclops/refs/heads/main/install/mcp-server.yaml
78+
```
79+
80+
3. You can now expose the `cyclops-mcp` service. To test your MCP server, you can port-forward it:
81+
82+
```shell
83+
kubectl port-forward svc/cyclops-mcp -n cyclops 8000:8000
84+
```
85+
86+
4. Add your Cyclops MCP server host, or in case you are testing it, the [localhost](http://localhost) address where you port-forwarded the MCP service:
87+
88+
```json
89+
{
90+
"mcpServers": {
91+
"mcp-cyclops": {
92+
"url": "http://localhost:8000/sse"
93+
}
94+
}
95+
}
96+
```
97+
98+
## Tools
99+
100+
| Tool | Description |
101+
|-----------------------|------------------------------------------------------------------------------------------------------------------------------------|
102+
| `create_module` | Create new Module. Before calling this tool, make sure to call `get_template_schema` to validate values for the given template |
103+
| `get_module` | Fetch Module by name |
104+
| `list_modules` | List all Cyclops Modules |
105+
| `update_module` | Update Module by Name. Before calling this tool, make sure to call `get_template_schema` to validate values for the given template |
106+
| `get_template_schema` | Returns JSON schema for the given template. Needs to be checked before calling `create_module` tool |
107+
| `get_template_store` | Fetch Template Store by Name |
108+
| `list_template_store` | List Template Stores from cluster |
109+
110+
## Configuration
111+
112+
You can configure Cyclops MCP server via env variables. Below is an example of adding the configuration for specifying the kubeconfig file the Cyclops MCP server should use when managing your Cyclops applications.
113+
114+
```json
115+
{
116+
"mcpServers": {
117+
"mcp-cyclops": {
118+
"command": "mcp-cyclops",
119+
"env": {
120+
"KUBECONFIG": "/path/to/your/kubeconfig"
121+
}
122+
}
123+
}
124+
}
125+
126+
```
127+
128+
### Environment variables
129+
130+
Below is the list of environment variables used for configuring your Cyclops MCP server:
131+
132+
| Env var | Description |
133+
|-----------------------------------|-----------------------------------------------------------------------------------------|
134+
| `KUBECONFIG` | Path to kubeconfig file (optional, defaults to in-cluster config or $HOME/.kube/config) |
135+
| `CYCLOPS_KUBE_CONTEXT` | Kubernetes context to use (optional) |
136+
| `CYCLOPS_MODULE_NAMESPACE` | Namespace where modules are stored |
137+
| `CYCLOPS_HELM_RELEASE_NAMESPACE` | Namespace for Helm releases |
138+
| `CYCLOPS_MODULE_TARGET_NAMESPACE` | Target namespace for modules |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- define "cyclops.namespace" -}}
2+
{{- if .Release.Namespace -}}
3+
{{ .Release.Namespace }}
4+
{{- else -}}
5+
cyclops
6+
{{- end -}}
7+
{{- end -}}
8+
9+
{{- define "watchNamespace" -}}
10+
- name: CYCLOPS_MODULE_NAMESPACE
11+
{{- if (.Values.scope).watchNamespace }}
12+
value: {{ .Values.scope.watchNamespace | quote }}
13+
{{- else }}
14+
value: {{ include "cyclops.namespace" . | quote }}
15+
{{- end -}}
16+
{{- end -}}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRole
3+
metadata:
4+
labels:
5+
app.kubernetes.io/component: mcp
6+
app.kubernetes.io/name: cyclops-mcp
7+
app.kubernetes.io/part-of: cyclops
8+
name: cyclops-mcp
9+
namespace: {{ include "cyclops.namespace" . | quote }}
10+
rules:
11+
- apiGroups:
12+
- 'cyclops-ui.com'
13+
resources:
14+
- '*'
15+
verbs:
16+
- '*'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
apiVersion: rbac.authorization.k8s.io/v1
2+
kind: ClusterRoleBinding
3+
metadata:
4+
labels:
5+
app.kubernetes.io/component: mcp
6+
app.kubernetes.io/name: cyclops-mcp
7+
app.kubernetes.io/part-of: cyclops
8+
name: cyclops-mcp
9+
namespace: {{ include "cyclops.namespace" . | quote }}
10+
roleRef:
11+
apiGroup: rbac.authorization.k8s.io
12+
kind: ClusterRole
13+
name: cyclops-mcp
14+
subjects:
15+
- kind: ServiceAccount
16+
name: cyclops-mcp
17+
namespace: {{ include "cyclops.namespace" . | quote }}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: cyclops-mcp
5+
namespace: {{ include "cyclops.namespace" . | quote }}
6+
labels:
7+
app: cyclops-mcp
8+
spec:
9+
replicas: {{ .Values.replicas | default 1 }}
10+
selector:
11+
matchLabels:
12+
app: cyclops-mcp
13+
template:
14+
metadata:
15+
labels:
16+
app: cyclops-mcp
17+
spec:
18+
serviceAccountName: cyclops-mcp
19+
containers:
20+
- name: cyclops-mcp
21+
image: {{ printf "cyclopsui/cyclops-mcp:%s" (default .Chart.AppVersion .Values.version) }}
22+
ports:
23+
- name: http
24+
containerPort: 8000
25+
protocol: TCP
26+
env:
27+
{{- include "watchNamespace" . | nindent 12 }}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: cyclops-mcp
5+
namespace: {{ include "cyclops.namespace" . | quote }}
6+
labels:
7+
app: cyclops-mcp
8+
spec:
9+
type: ClusterIP
10+
ports:
11+
- port: 8000
12+
targetPort: 8000
13+
protocol: TCP
14+
name: http
15+
selector:
16+
app: cyclops-mcp
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v1
2+
kind: ServiceAccount
3+
metadata:
4+
labels:
5+
app.kubernetes.io/component: mcp
6+
app.kubernetes.io/name: cyclops-mcp
7+
app.kubernetes.io/part-of: cyclops
8+
name: cyclops-mcp
9+
namespace: {{ include "cyclops.namespace" . | quote }}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"properties": {
3+
"replicas": {
4+
"title": "Replicas",
5+
"description": "Number of replicas for your MCP server",
6+
"type": "integer"
7+
},
8+
"version": {
9+
"title": "MCP server version",
10+
"description": "Cyclops MCP server version",
11+
"type": "string"
12+
},
13+
"scope": {
14+
"properties": {
15+
"watchNamespace": {
16+
"title": "Watch Namespace",
17+
"description": "Cluster namespace where your Modules are stored - defaults to cyclops namespace",
18+
"type": "null"
19+
}
20+
},
21+
"order": [
22+
"watchNamespace"
23+
],
24+
"title": "MCP server scope",
25+
"type": "object"
26+
}
27+
},
28+
"required": [
29+
"replicas",
30+
"version"
31+
],
32+
"type": "object"
33+
}

0 commit comments

Comments
 (0)