@futuretea/rancher-mcp-server 0.4.3 → 0.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +152 -4
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -19,12 +19,20 @@ A [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for Ra
|
|
|
19
19
|
- Describe resources with related events (similar to `kubectl describe`)
|
|
20
20
|
- List and filter Kubernetes events by namespace, object name, and object kind
|
|
21
21
|
- Query container logs with filtering (tail lines, time range, timestamps, keyword search)
|
|
22
|
+
- Multi-pod log aggregation via label selector with time-based sorting
|
|
23
|
+
- View rollout history for Deployments
|
|
24
|
+
- Analyze node health and resource usage
|
|
22
25
|
- Inspect pods with parent workload, metrics, and logs
|
|
26
|
+
- Show dependency/dependent trees for any resource (inspired by kube-lineage)
|
|
23
27
|
- **Rancher Resources via Norman API**: List clusters and projects
|
|
24
28
|
- **Security Controls**:
|
|
25
29
|
- `read_only`: Disables create, patch, and delete operations
|
|
26
30
|
- `disable_destructive`: Disables delete operations only
|
|
27
|
-
-
|
|
31
|
+
- `show_sensitive_data`: Global administrator control for sensitive data visibility (default: `false`)
|
|
32
|
+
- When disabled (default): All sensitive data is masked with `***`
|
|
33
|
+
- When enabled: Per-tool `showSensitiveData` parameter controls visibility
|
|
34
|
+
- Applies to: Kubernetes Secret `data` and `stringData` fields
|
|
35
|
+
- Affects tools: `kubernetes_get`, `kubernetes_list`, `kubernetes_describe`
|
|
28
36
|
- **Output Formats**: Table, YAML, and JSON
|
|
29
37
|
- **Output Filters**: Remove verbose fields like `managedFields` from responses
|
|
30
38
|
- **Pagination**: Limit and page parameters for list operations
|
|
@@ -96,6 +104,7 @@ npx @futuretea/rancher-mcp-server@latest --help
|
|
|
96
104
|
| `--rancher-tls-insecure` | Skip TLS verification | `false` |
|
|
97
105
|
| `--read-only` | Disable write operations | `true` |
|
|
98
106
|
| `--disable-destructive` | Disable delete operations | `false` |
|
|
107
|
+
| `--show-sensitive-data` | Global admin flag to allow sensitive data visibility | `false` |
|
|
99
108
|
| `--list-output` | Output format (json, table, yaml) | `json` |
|
|
100
109
|
| `--output-filters` | Fields to remove from output | `metadata.managedFields` |
|
|
101
110
|
| `--toolsets` | Toolsets to enable | `kubernetes,rancher` |
|
|
@@ -121,6 +130,13 @@ rancher_token: your-bearer-token
|
|
|
121
130
|
read_only: true # default: true
|
|
122
131
|
disable_destructive: false
|
|
123
132
|
|
|
133
|
+
# Sensitive Data Control:
|
|
134
|
+
# Global administrator setting that controls whether sensitive data can be shown.
|
|
135
|
+
# - false (default): All sensitive data is always masked with '***'
|
|
136
|
+
# - true: Allows per-tool showSensitiveData parameter to control visibility
|
|
137
|
+
# Applies to Kubernetes Secret data and stringData fields.
|
|
138
|
+
show_sensitive_data: false
|
|
139
|
+
|
|
124
140
|
list_output: json
|
|
125
141
|
|
|
126
142
|
# Remove verbose fields from output
|
|
@@ -145,6 +161,7 @@ RANCHER_MCP_PORT=8080
|
|
|
145
161
|
RANCHER_MCP_RANCHER_SERVER_URL=https://rancher.example.com
|
|
146
162
|
RANCHER_MCP_RANCHER_TOKEN=your-token
|
|
147
163
|
RANCHER_MCP_READ_ONLY=true
|
|
164
|
+
RANCHER_MCP_SHOW_SENSITIVE_DATA=false # Global admin control for sensitive data
|
|
148
165
|
```
|
|
149
166
|
|
|
150
167
|
### HTTP/SSE Mode
|
|
@@ -174,6 +191,86 @@ rancher-mcp-server --port 8080 \
|
|
|
174
191
|
|
|
175
192
|
## Tools and Functionalities <a id="tools-and-functionalities"></a>
|
|
176
193
|
|
|
194
|
+
### Sensitive Data Protection
|
|
195
|
+
|
|
196
|
+
The server provides a two-tier security control for handling sensitive Kubernetes resources (currently Secrets):
|
|
197
|
+
|
|
198
|
+
#### Global Administrator Control
|
|
199
|
+
|
|
200
|
+
The `--show-sensitive-data` flag (default: `false`) is a global administrator setting that determines whether sensitive data can ever be revealed:
|
|
201
|
+
|
|
202
|
+
- **Disabled (default: `false`)**: All sensitive data is **always masked** with `***`, regardless of per-tool parameters
|
|
203
|
+
- Secret `data` and `stringData` fields are masked
|
|
204
|
+
- Provides maximum security by preventing any accidental data exposure
|
|
205
|
+
- Recommended for production environments
|
|
206
|
+
|
|
207
|
+
- **Enabled (`true`)**: Allows per-tool `showSensitiveData` parameter to control visibility
|
|
208
|
+
- Each tool call can choose whether to show or mask sensitive data
|
|
209
|
+
- Useful for troubleshooting and administrative tasks
|
|
210
|
+
- Requires explicit per-call parameter to reveal data
|
|
211
|
+
|
|
212
|
+
#### Per-Tool Parameter Control
|
|
213
|
+
|
|
214
|
+
When global `--show-sensitive-data` is enabled, tools that access sensitive resources accept a `showSensitiveData` parameter:
|
|
215
|
+
|
|
216
|
+
- `showSensitiveData: false` (default): Masks sensitive fields with `***`
|
|
217
|
+
- `showSensitiveData: true`: Shows actual values
|
|
218
|
+
|
|
219
|
+
**Affected Tools:**
|
|
220
|
+
- `kubernetes_get`: Get individual resources including Secrets
|
|
221
|
+
- `kubernetes_list`: List resources including Secrets
|
|
222
|
+
- `kubernetes_describe`: Describe resources with events
|
|
223
|
+
|
|
224
|
+
**Example Behavior:**
|
|
225
|
+
|
|
226
|
+
```yaml
|
|
227
|
+
# Global flag disabled (--show-sensitive-data=false)
|
|
228
|
+
# Secret data is ALWAYS masked, regardless of per-tool parameter
|
|
229
|
+
apiVersion: v1
|
|
230
|
+
kind: Secret
|
|
231
|
+
data:
|
|
232
|
+
password: "***" # Always masked
|
|
233
|
+
token: "***" # Always masked
|
|
234
|
+
|
|
235
|
+
# Global flag enabled (--show-sensitive-data=true)
|
|
236
|
+
# Per-tool parameter controls visibility:
|
|
237
|
+
|
|
238
|
+
# With showSensitiveData: false (default)
|
|
239
|
+
apiVersion: v1
|
|
240
|
+
kind: Secret
|
|
241
|
+
data:
|
|
242
|
+
password: "***" # Masked
|
|
243
|
+
token: "***" # Masked
|
|
244
|
+
|
|
245
|
+
# With showSensitiveData: true
|
|
246
|
+
apiVersion: v1
|
|
247
|
+
kind: Secret
|
|
248
|
+
data:
|
|
249
|
+
password: "<base64-encoded-value>" # Actual base64 value shown
|
|
250
|
+
token: "<base64-encoded-value>" # Actual base64 value shown
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Configuration Examples:**
|
|
254
|
+
|
|
255
|
+
```shell
|
|
256
|
+
# Maximum security (production recommended)
|
|
257
|
+
rancher-mcp-server --show-sensitive-data=false # or omit (default)
|
|
258
|
+
|
|
259
|
+
# Allow administrators to reveal data when needed
|
|
260
|
+
rancher-mcp-server --show-sensitive-data=true
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
```yaml
|
|
264
|
+
# config.yaml
|
|
265
|
+
show_sensitive_data: false # Production: always mask
|
|
266
|
+
# show_sensitive_data: true # Development: allow per-tool control
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
```shell
|
|
270
|
+
# Environment variable
|
|
271
|
+
RANCHER_MCP_SHOW_SENSITIVE_DATA=false
|
|
272
|
+
```
|
|
273
|
+
|
|
177
274
|
Tools are organized into toolsets. Use `--toolsets` to enable specific sets or `--enabled-tools`/`--disabled-tools` for fine-grained control.
|
|
178
275
|
|
|
179
276
|
### Toolsets
|
|
@@ -185,6 +282,23 @@ Tools are organized into toolsets. Use `--toolsets` to enable specific sets or `
|
|
|
185
282
|
|
|
186
283
|
### kubernetes
|
|
187
284
|
|
|
285
|
+
<details>
|
|
286
|
+
<summary>kubernetes_dep</summary>
|
|
287
|
+
|
|
288
|
+
Show all dependencies or dependents of any Kubernetes resource as a tree. Covers OwnerReference chains, Pod→Node/SA/ConfigMap/Secret/PVC, Service→Pod (label selector), Ingress→IngressClass/Service/TLS Secret, PVC↔PV→StorageClass, RBAC bindings, PDB→Pod, and Events.
|
|
289
|
+
|
|
290
|
+
| Parameter | Type | Required | Description |
|
|
291
|
+
|-----------|------|----------|-------------|
|
|
292
|
+
| `cluster` | string | Yes | Cluster ID |
|
|
293
|
+
| `kind` | string | Yes | Resource kind (e.g., deployment, pod, service, ingress, node) |
|
|
294
|
+
| `namespace` | string | No | Namespace (optional for cluster-scoped resources) |
|
|
295
|
+
| `name` | string | Yes | Resource name |
|
|
296
|
+
| `direction` | string | No | Traversal direction: `dependents` (default) or `dependencies` |
|
|
297
|
+
| `depth` | integer | No | Maximum traversal depth, 1-20 (default: 10) |
|
|
298
|
+
| `format` | string | No | Output format: tree, json (default: tree) |
|
|
299
|
+
|
|
300
|
+
</details>
|
|
301
|
+
|
|
188
302
|
<details>
|
|
189
303
|
<summary>kubernetes_get</summary>
|
|
190
304
|
|
|
@@ -197,6 +311,7 @@ Get a Kubernetes resource by kind, namespace, and name.
|
|
|
197
311
|
| `namespace` | string | No | Namespace (optional for cluster-scoped resources) |
|
|
198
312
|
| `name` | string | Yes | Resource name |
|
|
199
313
|
| `format` | string | No | Output format: json, yaml (default: json) |
|
|
314
|
+
| `showSensitiveData` | boolean | No | Show sensitive data values (e.g., Secret data). Default: false. Only takes effect when global `--show-sensitive-data` is enabled. When global setting is disabled, data is always masked with `***` |
|
|
200
315
|
|
|
201
316
|
</details>
|
|
202
317
|
|
|
@@ -215,26 +330,33 @@ List Kubernetes resources by kind.
|
|
|
215
330
|
| `limit` | integer | No | Items per page (default: 100) |
|
|
216
331
|
| `page` | integer | No | Page number, starting from 1 (default: 1) |
|
|
217
332
|
| `format` | string | No | Output format: json, table, yaml (default: json) |
|
|
333
|
+
| `showSensitiveData` | boolean | No | Show sensitive data values (e.g., Secret data). Default: false. Only takes effect when global `--show-sensitive-data` is enabled. When global setting is disabled, data is always masked with `***` |
|
|
218
334
|
|
|
219
335
|
</details>
|
|
220
336
|
|
|
221
337
|
<details>
|
|
222
338
|
<summary>kubernetes_logs</summary>
|
|
223
339
|
|
|
224
|
-
Get logs from a pod container.
|
|
340
|
+
Get logs from a pod container. Supports multi-pod log aggregation via label selector with time-based sorting.
|
|
225
341
|
|
|
226
342
|
| Parameter | Type | Required | Description |
|
|
227
343
|
|-----------|------|----------|-------------|
|
|
228
344
|
| `cluster` | string | Yes | Cluster ID |
|
|
229
345
|
| `namespace` | string | Yes | Namespace |
|
|
230
|
-
| `name` | string |
|
|
346
|
+
| `name` | string | No | Pod name (required if labelSelector not specified) |
|
|
347
|
+
| `labelSelector` | string | No | Label selector for multi-pod log aggregation (e.g., "app=nginx") |
|
|
231
348
|
| `container` | string | No | Container name (empty = all containers) |
|
|
232
349
|
| `tailLines` | integer | No | Lines from end (default: 100) |
|
|
233
350
|
| `sinceSeconds` | integer | No | Logs from last N seconds |
|
|
234
|
-
| `timestamps` | boolean | No | Include timestamps (default:
|
|
351
|
+
| `timestamps` | boolean | No | Include timestamps (default: true) |
|
|
235
352
|
| `previous` | boolean | No | Previous container instance (default: false) |
|
|
236
353
|
| `keyword` | string | No | Filter log lines containing this keyword (case-insensitive) |
|
|
237
354
|
|
|
355
|
+
**Notes:**
|
|
356
|
+
- When `labelSelector` is specified, logs from all matching pods are aggregated and sorted by timestamp
|
|
357
|
+
- Output format for single pod: `[container] timestamp content`
|
|
358
|
+
- Output format for multi-pod: `[pod/container] timestamp content`
|
|
359
|
+
|
|
238
360
|
</details>
|
|
239
361
|
|
|
240
362
|
<details>
|
|
@@ -250,6 +372,31 @@ Get pod diagnostics: details, parent workload, metrics, and logs.
|
|
|
250
372
|
|
|
251
373
|
</details>
|
|
252
374
|
|
|
375
|
+
<details>
|
|
376
|
+
<summary>kubernetes_rollout_history</summary>
|
|
377
|
+
|
|
378
|
+
View rollout history for Deployments. Shows revision history with change annotations (similar to `kubectl rollout history`).
|
|
379
|
+
|
|
380
|
+
| Parameter | Type | Required | Description |
|
|
381
|
+
|-----------|------|----------|-------------|
|
|
382
|
+
| `cluster` | string | Yes | Cluster ID |
|
|
383
|
+
| `namespace` | string | Yes | Namespace |
|
|
384
|
+
| `name` | string | Yes | Deployment name |
|
|
385
|
+
|
|
386
|
+
</details>
|
|
387
|
+
|
|
388
|
+
<details>
|
|
389
|
+
<summary>kubernetes_node_analysis</summary>
|
|
390
|
+
|
|
391
|
+
Analyze node health and resource usage. Shows node capacity, allocatable resources, pod distribution, and identifies potential issues.
|
|
392
|
+
|
|
393
|
+
| Parameter | Type | Required | Description |
|
|
394
|
+
|-----------|------|----------|-------------|
|
|
395
|
+
| `cluster` | string | Yes | Cluster ID |
|
|
396
|
+
| `name` | string | No | Node name (if empty, analyzes all nodes) |
|
|
397
|
+
|
|
398
|
+
</details>
|
|
399
|
+
|
|
253
400
|
<details>
|
|
254
401
|
<summary>kubernetes_describe</summary>
|
|
255
402
|
|
|
@@ -262,6 +409,7 @@ Describe a Kubernetes resource with its related events. Similar to `kubectl desc
|
|
|
262
409
|
| `namespace` | string | No | Namespace (optional for cluster-scoped resources) |
|
|
263
410
|
| `name` | string | Yes | Resource name |
|
|
264
411
|
| `format` | string | No | Output format: json, yaml (default: json) |
|
|
412
|
+
| `showSensitiveData` | boolean | No | Show sensitive data values (e.g., Secret data). Default: false. Only takes effect when global `--show-sensitive-data` is enabled. When global setting is disabled, data is always masked with `***` |
|
|
265
413
|
|
|
266
414
|
</details>
|
|
267
415
|
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@futuretea/rancher-mcp-server",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Model Context Protocol (MCP) server for Rancher multi-cluster management",
|
|
5
5
|
"main": "./bin/index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"rancher-mcp-server": "bin/index.js"
|
|
8
8
|
},
|
|
9
9
|
"optionalDependencies": {
|
|
10
|
-
"@futuretea/rancher-mcp-server-darwin-amd64": "0.4.
|
|
11
|
-
"@futuretea/rancher-mcp-server-darwin-arm64": "0.4.
|
|
12
|
-
"@futuretea/rancher-mcp-server-linux-amd64": "0.4.
|
|
13
|
-
"@futuretea/rancher-mcp-server-linux-arm64": "0.4.
|
|
14
|
-
"@futuretea/rancher-mcp-server-windows-amd64": "0.4.
|
|
15
|
-
"@futuretea/rancher-mcp-server-windows-arm64": "0.4.
|
|
10
|
+
"@futuretea/rancher-mcp-server-darwin-amd64": "0.4.5",
|
|
11
|
+
"@futuretea/rancher-mcp-server-darwin-arm64": "0.4.5",
|
|
12
|
+
"@futuretea/rancher-mcp-server-linux-amd64": "0.4.5",
|
|
13
|
+
"@futuretea/rancher-mcp-server-linux-arm64": "0.4.5",
|
|
14
|
+
"@futuretea/rancher-mcp-server-windows-amd64": "0.4.5",
|
|
15
|
+
"@futuretea/rancher-mcp-server-windows-arm64": "0.4.5"
|
|
16
16
|
},
|
|
17
17
|
"repository": {
|
|
18
18
|
"type": "git",
|