mcp-server-kubernetes 3.0.3 → 3.0.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/dist/index.d.ts +9 -207
- package/dist/tools/exec_in_pod.d.ts +3 -0
- package/dist/tools/exec_in_pod.js +3 -0
- package/dist/tools/helm-operations.d.ts +6 -0
- package/dist/tools/helm-operations.js +6 -0
- package/dist/tools/kubectl-apply.d.ts +3 -0
- package/dist/tools/kubectl-apply.js +3 -0
- package/dist/tools/kubectl-patch.d.ts +3 -0
- package/dist/tools/kubectl-patch.js +3 -0
- package/dist/tools/kubectl-rollout.d.ts +3 -0
- package/dist/tools/kubectl-rollout.js +3 -0
- package/dist/tools/kubectl-scale.d.ts +3 -0
- package/dist/tools/kubectl-scale.js +3 -0
- package/dist/tools/port_forward.d.ts +6 -0
- package/dist/tools/port_forward.js +6 -0
- package/dist/utils/kubernetes-manager.js +4 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -149,45 +149,6 @@ declare const destructiveTools: ({
|
|
|
149
149
|
};
|
|
150
150
|
})[];
|
|
151
151
|
declare const allTools: ({
|
|
152
|
-
name: string;
|
|
153
|
-
description: string;
|
|
154
|
-
inputSchema: {
|
|
155
|
-
type: string;
|
|
156
|
-
properties: {
|
|
157
|
-
name: {
|
|
158
|
-
type: string;
|
|
159
|
-
description: string;
|
|
160
|
-
};
|
|
161
|
-
chart: {
|
|
162
|
-
type: string;
|
|
163
|
-
description: string;
|
|
164
|
-
};
|
|
165
|
-
namespace: {
|
|
166
|
-
type: "string";
|
|
167
|
-
description: string;
|
|
168
|
-
default: string;
|
|
169
|
-
};
|
|
170
|
-
context: {
|
|
171
|
-
type: "string";
|
|
172
|
-
description: string;
|
|
173
|
-
default: string;
|
|
174
|
-
};
|
|
175
|
-
repo: {
|
|
176
|
-
type: string;
|
|
177
|
-
description: string;
|
|
178
|
-
};
|
|
179
|
-
values: {
|
|
180
|
-
type: string;
|
|
181
|
-
description: string;
|
|
182
|
-
};
|
|
183
|
-
valuesFile: {
|
|
184
|
-
type: string;
|
|
185
|
-
description: string;
|
|
186
|
-
};
|
|
187
|
-
};
|
|
188
|
-
required: string[];
|
|
189
|
-
};
|
|
190
|
-
} | {
|
|
191
152
|
name: string;
|
|
192
153
|
description: string;
|
|
193
154
|
annotations: {
|
|
@@ -342,44 +303,6 @@ declare const allTools: ({
|
|
|
342
303
|
};
|
|
343
304
|
};
|
|
344
305
|
};
|
|
345
|
-
} | {
|
|
346
|
-
name: string;
|
|
347
|
-
description: string;
|
|
348
|
-
inputSchema: {
|
|
349
|
-
type: string;
|
|
350
|
-
properties: {
|
|
351
|
-
name: {
|
|
352
|
-
type: string;
|
|
353
|
-
description: string;
|
|
354
|
-
};
|
|
355
|
-
namespace: {
|
|
356
|
-
type: "string";
|
|
357
|
-
description: string;
|
|
358
|
-
default: string;
|
|
359
|
-
};
|
|
360
|
-
command: {
|
|
361
|
-
type: string;
|
|
362
|
-
items: {
|
|
363
|
-
type: string;
|
|
364
|
-
};
|
|
365
|
-
description: string;
|
|
366
|
-
};
|
|
367
|
-
container: {
|
|
368
|
-
type: string;
|
|
369
|
-
description: string;
|
|
370
|
-
};
|
|
371
|
-
timeout: {
|
|
372
|
-
type: string;
|
|
373
|
-
description: string;
|
|
374
|
-
};
|
|
375
|
-
context: {
|
|
376
|
-
type: "string";
|
|
377
|
-
description: string;
|
|
378
|
-
default: string;
|
|
379
|
-
};
|
|
380
|
-
};
|
|
381
|
-
required: string[];
|
|
382
|
-
};
|
|
383
306
|
} | {
|
|
384
307
|
readonly name: "cleanup";
|
|
385
308
|
readonly description: "Cleanup all managed resources";
|
|
@@ -393,6 +316,9 @@ declare const allTools: ({
|
|
|
393
316
|
} | {
|
|
394
317
|
name: string;
|
|
395
318
|
description: string;
|
|
319
|
+
annotations: {
|
|
320
|
+
title: string;
|
|
321
|
+
};
|
|
396
322
|
inputSchema: {
|
|
397
323
|
type: string;
|
|
398
324
|
properties: {
|
|
@@ -417,43 +343,14 @@ declare const allTools: ({
|
|
|
417
343
|
} | {
|
|
418
344
|
name: string;
|
|
419
345
|
description: string;
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
properties: {
|
|
423
|
-
id: {
|
|
424
|
-
type: string;
|
|
425
|
-
};
|
|
426
|
-
};
|
|
427
|
-
required: string[];
|
|
346
|
+
annotations: {
|
|
347
|
+
title: string;
|
|
428
348
|
};
|
|
429
|
-
} | {
|
|
430
|
-
name: string;
|
|
431
|
-
description: string;
|
|
432
349
|
inputSchema: {
|
|
433
350
|
type: string;
|
|
434
351
|
properties: {
|
|
435
|
-
|
|
436
|
-
type: string;
|
|
437
|
-
description: string;
|
|
438
|
-
};
|
|
439
|
-
namespace: {
|
|
440
|
-
type: "string";
|
|
441
|
-
description: string;
|
|
442
|
-
default: string;
|
|
443
|
-
};
|
|
444
|
-
replicas: {
|
|
445
|
-
type: string;
|
|
446
|
-
description: string;
|
|
447
|
-
};
|
|
448
|
-
resourceType: {
|
|
352
|
+
id: {
|
|
449
353
|
type: string;
|
|
450
|
-
description: string;
|
|
451
|
-
default: string;
|
|
452
|
-
};
|
|
453
|
-
context: {
|
|
454
|
-
type: "string";
|
|
455
|
-
description: string;
|
|
456
|
-
default: string;
|
|
457
354
|
};
|
|
458
355
|
};
|
|
459
356
|
required: string[];
|
|
@@ -587,6 +484,9 @@ declare const allTools: ({
|
|
|
587
484
|
} | {
|
|
588
485
|
readonly name: "kubectl_apply";
|
|
589
486
|
readonly description: "Apply a Kubernetes YAML manifest from a string or file";
|
|
487
|
+
readonly annotations: {
|
|
488
|
+
readonly destructiveHint: true;
|
|
489
|
+
};
|
|
590
490
|
readonly inputSchema: {
|
|
591
491
|
readonly type: "object";
|
|
592
492
|
readonly properties: {
|
|
@@ -868,104 +768,6 @@ declare const allTools: ({
|
|
|
868
768
|
};
|
|
869
769
|
readonly required: readonly ["resourceType", "name", "namespace"];
|
|
870
770
|
};
|
|
871
|
-
} | {
|
|
872
|
-
name: string;
|
|
873
|
-
description: string;
|
|
874
|
-
inputSchema: {
|
|
875
|
-
type: string;
|
|
876
|
-
properties: {
|
|
877
|
-
resourceType: {
|
|
878
|
-
type: string;
|
|
879
|
-
description: string;
|
|
880
|
-
};
|
|
881
|
-
name: {
|
|
882
|
-
type: string;
|
|
883
|
-
description: string;
|
|
884
|
-
};
|
|
885
|
-
namespace: {
|
|
886
|
-
type: "string";
|
|
887
|
-
description: string;
|
|
888
|
-
default: string;
|
|
889
|
-
};
|
|
890
|
-
patchType: {
|
|
891
|
-
type: string;
|
|
892
|
-
description: string;
|
|
893
|
-
enum: string[];
|
|
894
|
-
default: string;
|
|
895
|
-
};
|
|
896
|
-
patchData: {
|
|
897
|
-
type: string;
|
|
898
|
-
description: string;
|
|
899
|
-
};
|
|
900
|
-
patchFile: {
|
|
901
|
-
type: string;
|
|
902
|
-
description: string;
|
|
903
|
-
};
|
|
904
|
-
dryRun: {
|
|
905
|
-
type: "boolean";
|
|
906
|
-
description: string;
|
|
907
|
-
default: boolean;
|
|
908
|
-
};
|
|
909
|
-
context: {
|
|
910
|
-
type: "string";
|
|
911
|
-
description: string;
|
|
912
|
-
default: string;
|
|
913
|
-
};
|
|
914
|
-
};
|
|
915
|
-
required: string[];
|
|
916
|
-
};
|
|
917
|
-
} | {
|
|
918
|
-
name: string;
|
|
919
|
-
description: string;
|
|
920
|
-
inputSchema: {
|
|
921
|
-
type: string;
|
|
922
|
-
properties: {
|
|
923
|
-
subCommand: {
|
|
924
|
-
type: string;
|
|
925
|
-
description: string;
|
|
926
|
-
enum: string[];
|
|
927
|
-
default: string;
|
|
928
|
-
};
|
|
929
|
-
resourceType: {
|
|
930
|
-
type: string;
|
|
931
|
-
description: string;
|
|
932
|
-
enum: string[];
|
|
933
|
-
default: string;
|
|
934
|
-
};
|
|
935
|
-
name: {
|
|
936
|
-
type: string;
|
|
937
|
-
description: string;
|
|
938
|
-
};
|
|
939
|
-
namespace: {
|
|
940
|
-
type: "string";
|
|
941
|
-
description: string;
|
|
942
|
-
default: string;
|
|
943
|
-
};
|
|
944
|
-
revision: {
|
|
945
|
-
type: string;
|
|
946
|
-
description: string;
|
|
947
|
-
};
|
|
948
|
-
toRevision: {
|
|
949
|
-
type: string;
|
|
950
|
-
description: string;
|
|
951
|
-
};
|
|
952
|
-
timeout: {
|
|
953
|
-
type: string;
|
|
954
|
-
description: string;
|
|
955
|
-
};
|
|
956
|
-
watch: {
|
|
957
|
-
type: string;
|
|
958
|
-
description: string;
|
|
959
|
-
default: boolean;
|
|
960
|
-
};
|
|
961
|
-
context: {
|
|
962
|
-
type: "string";
|
|
963
|
-
description: string;
|
|
964
|
-
default: string;
|
|
965
|
-
};
|
|
966
|
-
};
|
|
967
|
-
required: string[];
|
|
968
|
-
};
|
|
969
771
|
} | {
|
|
970
772
|
name: string;
|
|
971
773
|
description: string;
|
|
@@ -21,6 +21,9 @@ import { contextParameter, namespaceParameter } from "../models/common-parameter
|
|
|
21
21
|
export const execInPodSchema = {
|
|
22
22
|
name: "exec_in_pod",
|
|
23
23
|
description: "Execute a command in a Kubernetes pod or container and return the output. Command must be an array of strings where the first element is the executable and remaining elements are arguments. This executes directly without shell interpretation for security.",
|
|
24
|
+
annotations: {
|
|
25
|
+
destructiveHint: true,
|
|
26
|
+
},
|
|
24
27
|
inputSchema: {
|
|
25
28
|
type: "object",
|
|
26
29
|
properties: {
|
|
@@ -19,6 +19,9 @@ import { HelmInstallOperation, HelmUpgradeOperation, HelmUninstallOperation } fr
|
|
|
19
19
|
export declare const installHelmChartSchema: {
|
|
20
20
|
name: string;
|
|
21
21
|
description: string;
|
|
22
|
+
annotations: {
|
|
23
|
+
destructiveHint: boolean;
|
|
24
|
+
};
|
|
22
25
|
inputSchema: {
|
|
23
26
|
type: string;
|
|
24
27
|
properties: {
|
|
@@ -78,6 +81,9 @@ export declare const installHelmChartSchema: {
|
|
|
78
81
|
export declare const upgradeHelmChartSchema: {
|
|
79
82
|
name: string;
|
|
80
83
|
description: string;
|
|
84
|
+
annotations: {
|
|
85
|
+
destructiveHint: boolean;
|
|
86
|
+
};
|
|
81
87
|
inputSchema: {
|
|
82
88
|
type: string;
|
|
83
89
|
properties: {
|
|
@@ -23,6 +23,9 @@ import { contextParameter, namespaceParameter, } from "../models/common-paramete
|
|
|
23
23
|
export const installHelmChartSchema = {
|
|
24
24
|
name: "install_helm_chart",
|
|
25
25
|
description: "Install a Helm chart with support for both standard and template-based installation",
|
|
26
|
+
annotations: {
|
|
27
|
+
destructiveHint: true,
|
|
28
|
+
},
|
|
26
29
|
inputSchema: {
|
|
27
30
|
type: "object",
|
|
28
31
|
properties: {
|
|
@@ -74,6 +77,9 @@ export const installHelmChartSchema = {
|
|
|
74
77
|
export const upgradeHelmChartSchema = {
|
|
75
78
|
name: "upgrade_helm_chart",
|
|
76
79
|
description: "Upgrade an existing Helm chart release",
|
|
80
|
+
annotations: {
|
|
81
|
+
destructiveHint: true,
|
|
82
|
+
},
|
|
77
83
|
inputSchema: {
|
|
78
84
|
type: "object",
|
|
79
85
|
properties: {
|
|
@@ -2,6 +2,9 @@ import { KubernetesManager } from "../types.js";
|
|
|
2
2
|
export declare const kubectlApplySchema: {
|
|
3
3
|
readonly name: "kubectl_apply";
|
|
4
4
|
readonly description: "Apply a Kubernetes YAML manifest from a string or file";
|
|
5
|
+
readonly annotations: {
|
|
6
|
+
readonly destructiveHint: true;
|
|
7
|
+
};
|
|
5
8
|
readonly inputSchema: {
|
|
6
9
|
readonly type: "object";
|
|
7
10
|
readonly properties: {
|
|
@@ -8,6 +8,9 @@ import { contextParameter, namespaceParameter, dryRunParameter } from "../models
|
|
|
8
8
|
export const kubectlApplySchema = {
|
|
9
9
|
name: "kubectl_apply",
|
|
10
10
|
description: "Apply a Kubernetes YAML manifest from a string or file",
|
|
11
|
+
annotations: {
|
|
12
|
+
destructiveHint: true,
|
|
13
|
+
},
|
|
11
14
|
inputSchema: {
|
|
12
15
|
type: "object",
|
|
13
16
|
properties: {
|
|
@@ -8,6 +8,9 @@ import { contextParameter, dryRunParameter, namespaceParameter, } from "../model
|
|
|
8
8
|
export const kubectlPatchSchema = {
|
|
9
9
|
name: "kubectl_patch",
|
|
10
10
|
description: "Update field(s) of a resource using strategic merge patch, JSON merge patch, or JSON patch",
|
|
11
|
+
annotations: {
|
|
12
|
+
destructiveHint: true,
|
|
13
|
+
},
|
|
11
14
|
inputSchema: {
|
|
12
15
|
type: "object",
|
|
13
16
|
properties: {
|
|
@@ -5,6 +5,9 @@ import { contextParameter, namespaceParameter } from "../models/common-parameter
|
|
|
5
5
|
export const kubectlRolloutSchema = {
|
|
6
6
|
name: "kubectl_rollout",
|
|
7
7
|
description: "Manage the rollout of a resource (e.g., deployment, daemonset, statefulset)",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
},
|
|
8
11
|
inputSchema: {
|
|
9
12
|
type: "object",
|
|
10
13
|
properties: {
|
|
@@ -5,6 +5,9 @@ import { contextParameter, namespaceParameter } from "../models/common-parameter
|
|
|
5
5
|
export const kubectlScaleSchema = {
|
|
6
6
|
name: "kubectl_scale",
|
|
7
7
|
description: "Scale a Kubernetes deployment",
|
|
8
|
+
annotations: {
|
|
9
|
+
destructiveHint: true,
|
|
10
|
+
},
|
|
8
11
|
inputSchema: {
|
|
9
12
|
type: "object",
|
|
10
13
|
properties: {
|
|
@@ -2,6 +2,9 @@ import { KubernetesManager } from "../utils/kubernetes-manager.js";
|
|
|
2
2
|
export declare const PortForwardSchema: {
|
|
3
3
|
name: string;
|
|
4
4
|
description: string;
|
|
5
|
+
annotations: {
|
|
6
|
+
title: string;
|
|
7
|
+
};
|
|
5
8
|
inputSchema: {
|
|
6
9
|
type: string;
|
|
7
10
|
properties: {
|
|
@@ -39,6 +42,9 @@ export declare function startPortForward(k8sManager: KubernetesManager, input: {
|
|
|
39
42
|
export declare const StopPortForwardSchema: {
|
|
40
43
|
name: string;
|
|
41
44
|
description: string;
|
|
45
|
+
annotations: {
|
|
46
|
+
title: string;
|
|
47
|
+
};
|
|
42
48
|
inputSchema: {
|
|
43
49
|
type: string;
|
|
44
50
|
properties: {
|
|
@@ -38,6 +38,9 @@ async function executeKubectlCommandAsync(command) {
|
|
|
38
38
|
export const PortForwardSchema = {
|
|
39
39
|
name: "port_forward",
|
|
40
40
|
description: "Forward a local port to a port on a Kubernetes resource",
|
|
41
|
+
annotations: {
|
|
42
|
+
title: "Port Forward",
|
|
43
|
+
},
|
|
41
44
|
inputSchema: {
|
|
42
45
|
type: "object",
|
|
43
46
|
properties: {
|
|
@@ -87,6 +90,9 @@ export async function startPortForward(k8sManager, input) {
|
|
|
87
90
|
export const StopPortForwardSchema = {
|
|
88
91
|
name: "stop_port_forward",
|
|
89
92
|
description: "Stop a port-forward process",
|
|
93
|
+
annotations: {
|
|
94
|
+
title: "Stop Port Forward",
|
|
95
|
+
},
|
|
90
96
|
inputSchema: {
|
|
91
97
|
type: "object",
|
|
92
98
|
properties: {
|
|
@@ -146,10 +146,13 @@ export class KubernetesManager {
|
|
|
146
146
|
if (!process.env.K8S_SERVER || !process.env.K8S_TOKEN) {
|
|
147
147
|
throw new Error("K8S_SERVER and K8S_TOKEN environment variables are required");
|
|
148
148
|
}
|
|
149
|
+
// When K8S_CA_DATA is provided, force skipTLSVerify to false as they are incompatible
|
|
150
|
+
const hasCAData = !!(process.env.K8S_CA_DATA && process.env.K8S_CA_DATA.trim());
|
|
151
|
+
const skipTLSVerify = hasCAData ? false : process.env.K8S_SKIP_TLS_VERIFY === "true";
|
|
149
152
|
const cluster = {
|
|
150
153
|
name: "env-cluster",
|
|
151
154
|
server: process.env.K8S_SERVER,
|
|
152
|
-
skipTLSVerify
|
|
155
|
+
skipTLSVerify,
|
|
153
156
|
caData: process.env.K8S_CA_DATA || undefined,
|
|
154
157
|
};
|
|
155
158
|
const user = {
|