mcp-server-kubernetes 1.6.0 → 1.6.1

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 CHANGED
@@ -155,6 +155,8 @@ For more advanced information like using SSE transport, Non-destructive mode wit
155
155
 
156
156
  ## Architecture
157
157
 
158
+ See this [DeepWiki link](https://deepwiki.com/Flux159/mcp-server-kubernetes) for a more indepth architecture overview created by Devin.
159
+
158
160
  This section describes the high-level architecture of the MCP Kubernetes server.
159
161
 
160
162
  ### Request Flow
package/dist/index.d.ts CHANGED
@@ -1,2 +1,1035 @@
1
1
  #!/usr/bin/env node
2
- export {};
2
+ declare const destructiveTools: ({
3
+ name: string;
4
+ description: string;
5
+ inputSchema: {
6
+ type: string;
7
+ properties: {
8
+ name: {
9
+ type: string;
10
+ description: string;
11
+ };
12
+ namespace: {
13
+ type: string;
14
+ description: string;
15
+ };
16
+ };
17
+ required: string[];
18
+ };
19
+ } | {
20
+ readonly name: "delete_cronjob";
21
+ readonly description: "Delete a Kubernetes CronJob";
22
+ readonly inputSchema: {
23
+ readonly type: "object";
24
+ readonly properties: {
25
+ readonly name: {
26
+ readonly type: "string";
27
+ };
28
+ readonly namespace: {
29
+ readonly type: "string";
30
+ };
31
+ };
32
+ readonly required: readonly ["name", "namespace"];
33
+ };
34
+ } | {
35
+ readonly name: "delete_pod";
36
+ readonly description: "Delete a Kubernetes pod";
37
+ readonly inputSchema: {
38
+ readonly type: "object";
39
+ readonly properties: {
40
+ readonly name: {
41
+ readonly type: "string";
42
+ };
43
+ readonly namespace: {
44
+ readonly type: "string";
45
+ };
46
+ readonly ignoreNotFound: {
47
+ readonly type: "boolean";
48
+ readonly default: false;
49
+ };
50
+ };
51
+ readonly required: readonly ["name", "namespace"];
52
+ };
53
+ } | {
54
+ readonly name: "delete_namespace";
55
+ readonly description: "Delete a Kubernetes namespace";
56
+ readonly inputSchema: {
57
+ readonly type: "object";
58
+ readonly properties: {
59
+ readonly name: {
60
+ readonly type: "string";
61
+ };
62
+ readonly ignoreNotFound: {
63
+ readonly type: "boolean";
64
+ readonly default: false;
65
+ };
66
+ };
67
+ readonly required: readonly ["name"];
68
+ };
69
+ } | {
70
+ readonly name: "cleanup";
71
+ readonly description: "Cleanup all managed resources";
72
+ readonly inputSchema: {
73
+ readonly type: "object";
74
+ readonly properties: {};
75
+ };
76
+ } | {
77
+ readonly name: "delete_deployment";
78
+ readonly description: "Delete a Kubernetes deployment";
79
+ readonly inputSchema: {
80
+ readonly type: "object";
81
+ readonly properties: {
82
+ readonly name: {
83
+ readonly type: "string";
84
+ };
85
+ readonly namespace: {
86
+ readonly type: "string";
87
+ };
88
+ readonly ignoreNotFound: {
89
+ readonly type: "boolean";
90
+ readonly default: false;
91
+ };
92
+ };
93
+ readonly required: readonly ["name", "namespace"];
94
+ };
95
+ } | {
96
+ readonly name: "delete_service";
97
+ readonly description: "Delete a Kubernetes service";
98
+ readonly inputSchema: {
99
+ readonly type: "object";
100
+ readonly properties: {
101
+ readonly name: {
102
+ readonly type: "string";
103
+ };
104
+ readonly namespace: {
105
+ readonly type: "string";
106
+ readonly default: "default";
107
+ };
108
+ readonly ignoreNotFound: {
109
+ readonly type: "boolean";
110
+ readonly default: false;
111
+ };
112
+ };
113
+ readonly required: readonly ["name"];
114
+ };
115
+ })[];
116
+ declare const allTools: ({
117
+ readonly name: "list_pods";
118
+ readonly description: "List pods in a namespace";
119
+ readonly inputSchema: {
120
+ readonly type: "object";
121
+ readonly properties: {
122
+ readonly namespace: {
123
+ readonly type: "string";
124
+ readonly default: "default";
125
+ };
126
+ };
127
+ readonly required: readonly ["namespace"];
128
+ };
129
+ } | {
130
+ readonly name: "list_nodes";
131
+ readonly description: "List all nodes in the cluster";
132
+ readonly inputSchema: {
133
+ readonly type: "object";
134
+ readonly properties: {};
135
+ };
136
+ } | {
137
+ readonly name: "list_services";
138
+ readonly description: "List services in a namespace";
139
+ readonly inputSchema: {
140
+ readonly type: "object";
141
+ readonly properties: {
142
+ readonly namespace: {
143
+ readonly type: "string";
144
+ readonly default: "default";
145
+ };
146
+ };
147
+ readonly required: readonly ["namespace"];
148
+ };
149
+ } | {
150
+ readonly name: "list_deployments";
151
+ readonly description: "List deployments in a namespace";
152
+ readonly inputSchema: {
153
+ readonly type: "object";
154
+ readonly properties: {
155
+ readonly namespace: {
156
+ readonly type: "string";
157
+ readonly default: "default";
158
+ };
159
+ };
160
+ readonly required: readonly ["namespace"];
161
+ };
162
+ } | {
163
+ readonly name: "list_cronjobs";
164
+ readonly description: "List CronJobs in a namespace";
165
+ readonly inputSchema: {
166
+ readonly type: "object";
167
+ readonly properties: {
168
+ readonly namespace: {
169
+ readonly type: "string";
170
+ readonly default: "default";
171
+ };
172
+ };
173
+ readonly required: readonly ["namespace"];
174
+ };
175
+ } | {
176
+ readonly name: "describe_cronjob";
177
+ readonly description: "Get detailed information about a Kubernetes CronJob including recent job history";
178
+ readonly inputSchema: {
179
+ readonly type: "object";
180
+ readonly properties: {
181
+ readonly name: {
182
+ readonly type: "string";
183
+ };
184
+ readonly namespace: {
185
+ readonly type: "string";
186
+ readonly default: "default";
187
+ };
188
+ };
189
+ readonly required: readonly ["name", "namespace"];
190
+ };
191
+ } | {
192
+ readonly name: "list_jobs";
193
+ readonly description: "List Jobs in a namespace, optionally filtered by a CronJob parent";
194
+ readonly inputSchema: {
195
+ readonly type: "object";
196
+ readonly properties: {
197
+ readonly namespace: {
198
+ readonly type: "string";
199
+ readonly default: "default";
200
+ };
201
+ readonly cronJobName: {
202
+ readonly type: "string";
203
+ readonly description: "Optional: Filter jobs created by a specific CronJob";
204
+ readonly optional: true;
205
+ };
206
+ };
207
+ readonly required: readonly ["namespace"];
208
+ };
209
+ } | {
210
+ readonly name: "get_job_logs";
211
+ readonly description: "Get logs from Pods created by a specific Job";
212
+ readonly inputSchema: {
213
+ readonly type: "object";
214
+ readonly properties: {
215
+ readonly name: {
216
+ readonly type: "string";
217
+ readonly description: "Name of the Job to get logs from";
218
+ };
219
+ readonly namespace: {
220
+ readonly type: "string";
221
+ readonly default: "default";
222
+ };
223
+ readonly tail: {
224
+ readonly type: "number";
225
+ readonly description: "Number of lines to return from the end of the logs";
226
+ readonly optional: true;
227
+ };
228
+ readonly timestamps: {
229
+ readonly type: "boolean";
230
+ readonly description: "Include timestamps in the logs";
231
+ readonly optional: true;
232
+ };
233
+ };
234
+ readonly required: readonly ["name", "namespace"];
235
+ };
236
+ } | {
237
+ readonly name: "describe_node";
238
+ readonly description: "Describe a Kubernetes node (read details like status, capacity, conditions, etc.)";
239
+ readonly inputSchema: {
240
+ readonly type: "object";
241
+ readonly properties: {
242
+ readonly name: {
243
+ readonly type: "string";
244
+ };
245
+ };
246
+ readonly required: readonly ["name"];
247
+ };
248
+ } | {
249
+ name: string;
250
+ description: string;
251
+ inputSchema: {
252
+ type: string;
253
+ properties: {
254
+ name: {
255
+ type: string;
256
+ description: string;
257
+ };
258
+ namespace: {
259
+ type: string;
260
+ description: string;
261
+ };
262
+ };
263
+ required: string[];
264
+ };
265
+ } | {
266
+ name: string;
267
+ description: string;
268
+ inputSchema: {
269
+ type: string;
270
+ properties: {
271
+ resource: {
272
+ type: string;
273
+ description: string;
274
+ };
275
+ apiVersion: {
276
+ type: string;
277
+ description: string;
278
+ };
279
+ recursive: {
280
+ type: string;
281
+ description: string;
282
+ default: boolean;
283
+ };
284
+ output: {
285
+ type: string;
286
+ description: string;
287
+ enum: string[];
288
+ default: string;
289
+ };
290
+ };
291
+ required: string[];
292
+ };
293
+ } | {
294
+ name: string;
295
+ description: string;
296
+ inputSchema: {
297
+ type: string;
298
+ properties: {
299
+ apiGroup: {
300
+ type: string;
301
+ description: string;
302
+ };
303
+ namespaced: {
304
+ type: string;
305
+ description: string;
306
+ };
307
+ verbs: {
308
+ type: string;
309
+ items: {
310
+ type: string;
311
+ };
312
+ description: string;
313
+ };
314
+ output: {
315
+ type: string;
316
+ description: string;
317
+ enum: string[];
318
+ default: string;
319
+ };
320
+ };
321
+ };
322
+ } | {
323
+ readonly name: "create_namespace";
324
+ readonly description: "Create a new Kubernetes namespace";
325
+ readonly inputSchema: {
326
+ readonly type: "object";
327
+ readonly properties: {
328
+ readonly name: {
329
+ readonly type: "string";
330
+ };
331
+ };
332
+ readonly required: readonly ["name"];
333
+ };
334
+ } | {
335
+ readonly name: "create_pod";
336
+ readonly description: "Create a new Kubernetes pod";
337
+ readonly inputSchema: {
338
+ readonly type: "object";
339
+ readonly properties: {
340
+ readonly name: {
341
+ readonly type: "string";
342
+ };
343
+ readonly namespace: {
344
+ readonly type: "string";
345
+ };
346
+ readonly template: {
347
+ readonly type: "string";
348
+ readonly enum: ["ubuntu", "nginx", "busybox", "alpine", "custom"];
349
+ };
350
+ readonly command: {
351
+ readonly type: "array";
352
+ readonly items: {
353
+ readonly type: "string";
354
+ };
355
+ readonly optional: true;
356
+ };
357
+ readonly customConfig: {
358
+ readonly type: "object";
359
+ readonly optional: true;
360
+ readonly properties: {
361
+ readonly image: {
362
+ readonly type: "string";
363
+ };
364
+ readonly command: {
365
+ readonly type: "array";
366
+ readonly items: {
367
+ readonly type: "string";
368
+ };
369
+ };
370
+ readonly args: {
371
+ readonly type: "array";
372
+ readonly items: {
373
+ readonly type: "string";
374
+ };
375
+ };
376
+ readonly ports: {
377
+ readonly type: "array";
378
+ readonly items: {
379
+ readonly type: "object";
380
+ readonly properties: {
381
+ readonly containerPort: {
382
+ readonly type: "number";
383
+ };
384
+ readonly name: {
385
+ readonly type: "string";
386
+ };
387
+ readonly protocol: {
388
+ readonly type: "string";
389
+ };
390
+ };
391
+ };
392
+ };
393
+ readonly resources: {
394
+ readonly type: "object";
395
+ readonly properties: {
396
+ readonly limits: {
397
+ readonly type: "object";
398
+ readonly additionalProperties: {
399
+ readonly type: "string";
400
+ };
401
+ };
402
+ readonly requests: {
403
+ readonly type: "object";
404
+ readonly additionalProperties: {
405
+ readonly type: "string";
406
+ };
407
+ };
408
+ };
409
+ };
410
+ readonly env: {
411
+ readonly type: "array";
412
+ readonly items: {
413
+ readonly type: "object";
414
+ readonly properties: {
415
+ readonly name: {
416
+ readonly type: "string";
417
+ };
418
+ readonly value: {
419
+ readonly type: "string";
420
+ };
421
+ readonly valueFrom: {
422
+ readonly type: "object";
423
+ };
424
+ };
425
+ };
426
+ };
427
+ readonly volumeMounts: {
428
+ readonly type: "array";
429
+ readonly items: {
430
+ readonly type: "object";
431
+ readonly properties: {
432
+ readonly name: {
433
+ readonly type: "string";
434
+ };
435
+ readonly mountPath: {
436
+ readonly type: "string";
437
+ };
438
+ readonly readOnly: {
439
+ readonly type: "boolean";
440
+ };
441
+ };
442
+ };
443
+ };
444
+ };
445
+ };
446
+ };
447
+ readonly required: readonly ["name", "namespace", "template"];
448
+ };
449
+ } | {
450
+ readonly name: "create_cronjob";
451
+ readonly description: "Create a new Kubernetes CronJob";
452
+ readonly inputSchema: {
453
+ readonly type: "object";
454
+ readonly properties: {
455
+ readonly name: {
456
+ readonly type: "string";
457
+ };
458
+ readonly namespace: {
459
+ readonly type: "string";
460
+ };
461
+ readonly schedule: {
462
+ readonly type: "string";
463
+ };
464
+ readonly image: {
465
+ readonly type: "string";
466
+ };
467
+ readonly command: {
468
+ readonly type: "array";
469
+ readonly items: {
470
+ readonly type: "string";
471
+ };
472
+ readonly optional: true;
473
+ };
474
+ readonly suspend: {
475
+ readonly type: "boolean";
476
+ readonly optional: true;
477
+ };
478
+ };
479
+ readonly required: readonly ["name", "namespace", "schedule", "image"];
480
+ };
481
+ } | {
482
+ readonly name: "delete_cronjob";
483
+ readonly description: "Delete a Kubernetes CronJob";
484
+ readonly inputSchema: {
485
+ readonly type: "object";
486
+ readonly properties: {
487
+ readonly name: {
488
+ readonly type: "string";
489
+ };
490
+ readonly namespace: {
491
+ readonly type: "string";
492
+ };
493
+ };
494
+ readonly required: readonly ["name", "namespace"];
495
+ };
496
+ } | {
497
+ readonly name: "delete_pod";
498
+ readonly description: "Delete a Kubernetes pod";
499
+ readonly inputSchema: {
500
+ readonly type: "object";
501
+ readonly properties: {
502
+ readonly name: {
503
+ readonly type: "string";
504
+ };
505
+ readonly namespace: {
506
+ readonly type: "string";
507
+ };
508
+ readonly ignoreNotFound: {
509
+ readonly type: "boolean";
510
+ readonly default: false;
511
+ };
512
+ };
513
+ readonly required: readonly ["name", "namespace"];
514
+ };
515
+ } | {
516
+ readonly name: "describe_pod";
517
+ readonly description: "Describe a Kubernetes pod (read details like status, containers, etc.)";
518
+ readonly inputSchema: {
519
+ readonly type: "object";
520
+ readonly properties: {
521
+ readonly name: {
522
+ readonly type: "string";
523
+ };
524
+ readonly namespace: {
525
+ readonly type: "string";
526
+ };
527
+ };
528
+ readonly required: readonly ["name", "namespace"];
529
+ };
530
+ } | {
531
+ readonly name: "get_logs";
532
+ readonly description: "Get logs from pods, deployments, jobs, or resources matching a label selector";
533
+ readonly inputSchema: {
534
+ readonly type: "object";
535
+ readonly properties: {
536
+ readonly resourceType: {
537
+ readonly type: "string";
538
+ readonly enum: readonly ["pod", "deployment", "job"];
539
+ readonly description: "Type of resource to get logs from";
540
+ };
541
+ readonly name: {
542
+ readonly type: "string";
543
+ readonly description: "Name of the resource";
544
+ };
545
+ readonly namespace: {
546
+ readonly type: "string";
547
+ readonly description: "Namespace of the resource";
548
+ readonly default: "default";
549
+ };
550
+ readonly labelSelector: {
551
+ readonly type: "string";
552
+ readonly description: "Label selector to filter resources";
553
+ readonly optional: true;
554
+ };
555
+ readonly container: {
556
+ readonly type: "string";
557
+ readonly description: "Container name (required when pod has multiple containers)";
558
+ readonly optional: true;
559
+ };
560
+ readonly tail: {
561
+ readonly type: "number";
562
+ readonly description: "Number of lines to show from end of logs";
563
+ readonly optional: true;
564
+ };
565
+ readonly since: {
566
+ readonly type: "number";
567
+ readonly description: "Get logs since relative time in seconds";
568
+ readonly optional: true;
569
+ };
570
+ readonly timestamps: {
571
+ readonly type: "boolean";
572
+ readonly description: "Include timestamps in logs";
573
+ readonly default: false;
574
+ };
575
+ };
576
+ readonly required: readonly ["resourceType"];
577
+ };
578
+ } | {
579
+ name: string;
580
+ description: string;
581
+ inputSchema: {
582
+ type: string;
583
+ properties: {
584
+ namespace: {
585
+ type: string;
586
+ description: string;
587
+ };
588
+ fieldSelector: {
589
+ type: string;
590
+ description: string;
591
+ };
592
+ };
593
+ required: never[];
594
+ };
595
+ } | {
596
+ readonly name: "create_deployment";
597
+ readonly description: "Create a new Kubernetes deployment";
598
+ readonly inputSchema: {
599
+ readonly type: "object";
600
+ readonly properties: {
601
+ readonly name: {
602
+ readonly type: "string";
603
+ };
604
+ readonly namespace: {
605
+ readonly type: "string";
606
+ };
607
+ readonly template: {
608
+ readonly type: "string";
609
+ readonly enum: ["ubuntu", "nginx", "busybox", "alpine", "custom"];
610
+ };
611
+ readonly replicas: {
612
+ readonly type: "number";
613
+ readonly default: 1;
614
+ };
615
+ readonly ports: {
616
+ readonly type: "array";
617
+ readonly items: {
618
+ readonly type: "number";
619
+ };
620
+ readonly optional: true;
621
+ };
622
+ readonly customConfig: {
623
+ readonly type: "object";
624
+ readonly optional: true;
625
+ readonly properties: {
626
+ readonly image: {
627
+ readonly type: "string";
628
+ };
629
+ readonly command: {
630
+ readonly type: "array";
631
+ readonly items: {
632
+ readonly type: "string";
633
+ };
634
+ };
635
+ readonly args: {
636
+ readonly type: "array";
637
+ readonly items: {
638
+ readonly type: "string";
639
+ };
640
+ };
641
+ readonly ports: {
642
+ readonly type: "array";
643
+ readonly items: {
644
+ readonly type: "object";
645
+ readonly properties: {
646
+ readonly containerPort: {
647
+ readonly type: "number";
648
+ };
649
+ readonly name: {
650
+ readonly type: "string";
651
+ };
652
+ readonly protocol: {
653
+ readonly type: "string";
654
+ };
655
+ };
656
+ };
657
+ };
658
+ readonly resources: {
659
+ readonly type: "object";
660
+ readonly properties: {
661
+ readonly limits: {
662
+ readonly type: "object";
663
+ readonly additionalProperties: {
664
+ readonly type: "string";
665
+ };
666
+ };
667
+ readonly requests: {
668
+ readonly type: "object";
669
+ readonly additionalProperties: {
670
+ readonly type: "string";
671
+ };
672
+ };
673
+ };
674
+ };
675
+ readonly env: {
676
+ readonly type: "array";
677
+ readonly items: {
678
+ readonly type: "object";
679
+ readonly properties: {
680
+ readonly name: {
681
+ readonly type: "string";
682
+ };
683
+ readonly value: {
684
+ readonly type: "string";
685
+ };
686
+ readonly valueFrom: {
687
+ readonly type: "object";
688
+ };
689
+ };
690
+ };
691
+ };
692
+ readonly volumeMounts: {
693
+ readonly type: "array";
694
+ readonly items: {
695
+ readonly type: "object";
696
+ readonly properties: {
697
+ readonly name: {
698
+ readonly type: "string";
699
+ };
700
+ readonly mountPath: {
701
+ readonly type: "string";
702
+ };
703
+ readonly readOnly: {
704
+ readonly type: "boolean";
705
+ };
706
+ };
707
+ };
708
+ };
709
+ };
710
+ };
711
+ };
712
+ readonly required: readonly ["name", "namespace", "template"];
713
+ };
714
+ } | {
715
+ readonly name: "list_namespaces";
716
+ readonly description: "List all namespaces";
717
+ readonly inputSchema: {
718
+ readonly type: "object";
719
+ readonly properties: {};
720
+ };
721
+ } | {
722
+ readonly name: "delete_namespace";
723
+ readonly description: "Delete a Kubernetes namespace";
724
+ readonly inputSchema: {
725
+ readonly type: "object";
726
+ readonly properties: {
727
+ readonly name: {
728
+ readonly type: "string";
729
+ };
730
+ readonly ignoreNotFound: {
731
+ readonly type: "boolean";
732
+ readonly default: false;
733
+ };
734
+ };
735
+ readonly required: readonly ["name"];
736
+ };
737
+ } | {
738
+ readonly name: "cleanup";
739
+ readonly description: "Cleanup all managed resources";
740
+ readonly inputSchema: {
741
+ readonly type: "object";
742
+ readonly properties: {};
743
+ };
744
+ } | {
745
+ name: string;
746
+ description: string;
747
+ inputSchema: {
748
+ type: string;
749
+ properties: {
750
+ resourceType: {
751
+ type: string;
752
+ };
753
+ resourceName: {
754
+ type: string;
755
+ };
756
+ localPort: {
757
+ type: string;
758
+ };
759
+ targetPort: {
760
+ type: string;
761
+ };
762
+ namespace: {
763
+ type: string;
764
+ };
765
+ };
766
+ required: string[];
767
+ };
768
+ } | {
769
+ name: string;
770
+ description: string;
771
+ inputSchema: {
772
+ type: string;
773
+ properties: {
774
+ id: {
775
+ type: string;
776
+ };
777
+ };
778
+ required: string[];
779
+ };
780
+ } | {
781
+ readonly name: "delete_deployment";
782
+ readonly description: "Delete a Kubernetes deployment";
783
+ readonly inputSchema: {
784
+ readonly type: "object";
785
+ readonly properties: {
786
+ readonly name: {
787
+ readonly type: "string";
788
+ };
789
+ readonly namespace: {
790
+ readonly type: "string";
791
+ };
792
+ readonly ignoreNotFound: {
793
+ readonly type: "boolean";
794
+ readonly default: false;
795
+ };
796
+ };
797
+ readonly required: readonly ["name", "namespace"];
798
+ };
799
+ } | {
800
+ name: string;
801
+ description: string;
802
+ inputSchema: {
803
+ type: string;
804
+ properties: {
805
+ name: {
806
+ type: string;
807
+ };
808
+ namespace: {
809
+ type: string;
810
+ };
811
+ replicas: {
812
+ type: string;
813
+ };
814
+ };
815
+ required: string[];
816
+ };
817
+ } | {
818
+ readonly name: "describe_deployment";
819
+ readonly description: "Get details about a Kubernetes deployment";
820
+ readonly inputSchema: {
821
+ readonly type: "object";
822
+ readonly properties: {
823
+ readonly name: {
824
+ readonly type: "string";
825
+ };
826
+ readonly namespace: {
827
+ readonly type: "string";
828
+ };
829
+ };
830
+ readonly required: readonly ["name", "namespace"];
831
+ };
832
+ } | {
833
+ name: string;
834
+ description: string;
835
+ inputSchema: {
836
+ type: string;
837
+ properties: {
838
+ name: {
839
+ type: string;
840
+ };
841
+ namespace: {
842
+ type: string;
843
+ };
844
+ data: {
845
+ type: string;
846
+ ConfigData: {
847
+ type: string;
848
+ };
849
+ };
850
+ };
851
+ required: string[];
852
+ };
853
+ } | {
854
+ readonly name: "list_contexts";
855
+ readonly description: "List all available Kubernetes contexts";
856
+ readonly inputSchema: {
857
+ readonly type: "object";
858
+ readonly properties: {
859
+ readonly showCurrent: {
860
+ readonly type: "boolean";
861
+ readonly description: "Show which context is currently active";
862
+ readonly default: true;
863
+ };
864
+ };
865
+ };
866
+ } | {
867
+ readonly name: "get_current_context";
868
+ readonly description: "Get the current Kubernetes context";
869
+ readonly inputSchema: {
870
+ readonly type: "object";
871
+ readonly properties: {
872
+ readonly detailed: {
873
+ readonly type: "boolean";
874
+ readonly description: "Include detailed information about the current context";
875
+ readonly default: false;
876
+ };
877
+ };
878
+ };
879
+ } | {
880
+ readonly name: "set_current_context";
881
+ readonly description: "Set the current Kubernetes context";
882
+ readonly inputSchema: {
883
+ readonly type: "object";
884
+ readonly properties: {
885
+ readonly name: {
886
+ readonly type: "string";
887
+ readonly description: "Name of the context to set as current";
888
+ };
889
+ };
890
+ readonly required: readonly ["name"];
891
+ };
892
+ } | {
893
+ readonly name: "create_service";
894
+ readonly description: "Create a new Kubernetes service";
895
+ readonly inputSchema: {
896
+ readonly type: "object";
897
+ readonly properties: {
898
+ readonly name: {
899
+ readonly type: "string";
900
+ };
901
+ readonly namespace: {
902
+ readonly type: "string";
903
+ readonly default: "default";
904
+ };
905
+ readonly type: {
906
+ readonly type: "string";
907
+ readonly enum: readonly ["ClusterIP", "NodePort", "LoadBalancer"];
908
+ readonly default: "ClusterIP";
909
+ };
910
+ readonly selector: {
911
+ readonly type: "object";
912
+ readonly additionalProperties: {
913
+ readonly type: "string";
914
+ };
915
+ readonly default: {};
916
+ };
917
+ readonly ports: {
918
+ readonly type: "array";
919
+ readonly items: {
920
+ readonly type: "object";
921
+ readonly properties: {
922
+ readonly port: {
923
+ readonly type: "number";
924
+ };
925
+ readonly targetPort: {
926
+ readonly type: "number";
927
+ };
928
+ readonly protocol: {
929
+ readonly type: "string";
930
+ readonly enum: readonly ["TCP", "UDP"];
931
+ readonly default: "TCP";
932
+ };
933
+ readonly name: {
934
+ readonly type: "string";
935
+ };
936
+ readonly nodePort: {
937
+ readonly type: "number";
938
+ };
939
+ };
940
+ readonly required: readonly ["port"];
941
+ };
942
+ };
943
+ };
944
+ readonly required: readonly ["name", "ports"];
945
+ };
946
+ } | {
947
+ readonly name: "describe_service";
948
+ readonly description: "Describe a Kubernetes service (read details like status, ports, selectors, etc.)";
949
+ readonly inputSchema: {
950
+ readonly type: "object";
951
+ readonly properties: {
952
+ readonly name: {
953
+ readonly type: "string";
954
+ };
955
+ readonly namespace: {
956
+ readonly type: "string";
957
+ readonly default: "default";
958
+ };
959
+ };
960
+ readonly required: readonly ["name"];
961
+ };
962
+ } | {
963
+ name: string;
964
+ description: string;
965
+ inputSchema: {
966
+ type: string;
967
+ required: string[];
968
+ properties: {
969
+ name: {
970
+ type: string;
971
+ };
972
+ namespace: {
973
+ type: string;
974
+ default: string;
975
+ };
976
+ type: {
977
+ type: string;
978
+ enum: string[];
979
+ };
980
+ selector: {
981
+ type: string;
982
+ additionalProperties: {
983
+ type: string;
984
+ };
985
+ };
986
+ ports: {
987
+ type: string;
988
+ items: {
989
+ type: string;
990
+ properties: {
991
+ port: {
992
+ type: string;
993
+ };
994
+ targetPort: {
995
+ type: string;
996
+ };
997
+ protocol: {
998
+ type: string;
999
+ enum: string[];
1000
+ default: string;
1001
+ };
1002
+ name: {
1003
+ type: string;
1004
+ };
1005
+ nodePort: {
1006
+ type: string;
1007
+ };
1008
+ };
1009
+ required: string[];
1010
+ };
1011
+ };
1012
+ };
1013
+ };
1014
+ } | {
1015
+ readonly name: "delete_service";
1016
+ readonly description: "Delete a Kubernetes service";
1017
+ readonly inputSchema: {
1018
+ readonly type: "object";
1019
+ readonly properties: {
1020
+ readonly name: {
1021
+ readonly type: "string";
1022
+ };
1023
+ readonly namespace: {
1024
+ readonly type: "string";
1025
+ readonly default: "default";
1026
+ };
1027
+ readonly ignoreNotFound: {
1028
+ readonly type: "boolean";
1029
+ readonly default: false;
1030
+ };
1031
+ };
1032
+ readonly required: readonly ["name"];
1033
+ };
1034
+ })[];
1035
+ export { allTools, destructiveTools };
package/dist/index.js CHANGED
@@ -36,9 +36,9 @@ import { scaleDeployment, scaleDeploymentSchema, } from "./tools/scale_deploymen
36
36
  import { describeDeployment, describeDeploymentSchema, } from "./tools/describe_deployment.js";
37
37
  import { updateDeployment, updateDeploymentSchema, } from "./tools/update_deployment.js";
38
38
  import { createConfigMap, CreateConfigMapSchema, } from "./tools/create_configmap.js";
39
- import { getConfigMap, GetConfigMapSchema } from "./tools/get_configmap.js";
40
- import { updateConfigMap, UpdateConfigMapSchema } from "./tools/update_configmap.js";
41
- import { deleteConfigMap, DeleteConfigMapSchema } from "./tools/delete_configmap.js";
39
+ import { getConfigMap } from "./tools/get_configmap.js";
40
+ import { updateConfigMap } from "./tools/update_configmap.js";
41
+ import { deleteConfigMap } from "./tools/delete_configmap.js";
42
42
  import { listContexts, listContextsSchema } from "./tools/list_contexts.js";
43
43
  import { getCurrentContext, getCurrentContextSchema, } from "./tools/get_current_context.js";
44
44
  import { setCurrentContext, setCurrentContextSchema, } from "./tools/set_current_context.js";
@@ -48,11 +48,6 @@ import { updateService, updateServiceSchema } from "./tools/update_service.js";
48
48
  import { deleteService, deleteServiceSchema } from "./tools/delete_service.js";
49
49
  // Check if non-destructive tools only mode is enabled
50
50
  const nonDestructiveTools = process.env.ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS === "true";
51
- const k8sManager = new KubernetesManager();
52
- const server = new Server({
53
- name: serverConfig.name,
54
- version: serverConfig.version,
55
- }, serverConfig);
56
51
  // Define destructive tools (delete and uninstall operations)
57
52
  const destructiveTools = [
58
53
  deletePodSchema,
@@ -63,54 +58,56 @@ const destructiveTools = [
63
58
  DeleteCronJobSchema,
64
59
  cleanupSchema, // Cleanup is also destructive as it deletes resources
65
60
  ];
61
+ // Get all available tools
62
+ const allTools = [
63
+ cleanupSchema,
64
+ createDeploymentSchema,
65
+ createNamespaceSchema,
66
+ createPodSchema,
67
+ createCronJobSchema,
68
+ createServiceSchema,
69
+ deletePodSchema,
70
+ deleteDeploymentSchema,
71
+ deleteNamespaceSchema,
72
+ deleteServiceSchema,
73
+ describeCronJobSchema,
74
+ describePodSchema,
75
+ describeNodeSchema,
76
+ describeDeploymentSchema,
77
+ describeServiceSchema,
78
+ explainResourceSchema,
79
+ getEventsSchema,
80
+ getJobLogsSchema,
81
+ getLogsSchema,
82
+ installHelmChartSchema,
83
+ listApiResourcesSchema,
84
+ listCronJobsSchema,
85
+ listContextsSchema,
86
+ getCurrentContextSchema,
87
+ setCurrentContextSchema,
88
+ listDeploymentsSchema,
89
+ listJobsSchema,
90
+ listNamespacesSchema,
91
+ listNodesSchema,
92
+ listPodsSchema,
93
+ listServicesSchema,
94
+ uninstallHelmChartSchema,
95
+ updateDeploymentSchema,
96
+ upgradeHelmChartSchema,
97
+ PortForwardSchema,
98
+ StopPortForwardSchema,
99
+ scaleDeploymentSchema,
100
+ DeleteCronJobSchema,
101
+ CreateConfigMapSchema,
102
+ updateServiceSchema,
103
+ ];
104
+ const k8sManager = new KubernetesManager();
105
+ const server = new Server({
106
+ name: serverConfig.name,
107
+ version: serverConfig.version,
108
+ }, serverConfig);
66
109
  // Tools handlers
67
110
  server.setRequestHandler(ListToolsRequestSchema, async () => {
68
- // Get all available tools
69
- const allTools = [
70
- cleanupSchema,
71
- createDeploymentSchema,
72
- createNamespaceSchema,
73
- createPodSchema,
74
- createCronJobSchema,
75
- createServiceSchema,
76
- deletePodSchema,
77
- deleteDeploymentSchema,
78
- deleteNamespaceSchema,
79
- deleteServiceSchema,
80
- describeCronJobSchema,
81
- describePodSchema,
82
- describeNodeSchema,
83
- describeDeploymentSchema,
84
- describeServiceSchema,
85
- explainResourceSchema,
86
- getEventsSchema,
87
- getJobLogsSchema,
88
- getLogsSchema,
89
- installHelmChartSchema,
90
- listApiResourcesSchema,
91
- listCronJobsSchema,
92
- listContextsSchema,
93
- getCurrentContextSchema,
94
- setCurrentContextSchema,
95
- listDeploymentsSchema,
96
- listJobsSchema,
97
- listNamespacesSchema,
98
- listNodesSchema,
99
- listPodsSchema,
100
- listServicesSchema,
101
- uninstallHelmChartSchema,
102
- updateDeploymentSchema,
103
- upgradeHelmChartSchema,
104
- PortForwardSchema,
105
- StopPortForwardSchema,
106
- scaleDeploymentSchema,
107
- DeleteCronJobSchema,
108
- CreateConfigMapSchema,
109
- updateServiceSchema,
110
- GetConfigMapSchema,
111
- UpdateConfigMapSchema,
112
- DeleteConfigMapSchema,
113
- ];
114
111
  // Filter out destructive tools if ALLOW_ONLY_NON_DESTRUCTIVE_TOOLS is set to 'true'
115
112
  const tools = nonDestructiveTools
116
113
  ? allTools.filter((tool) => !destructiveTools.some((dt) => dt.name === tool.name))
@@ -301,3 +298,4 @@ else {
301
298
  process.exit(0);
302
299
  });
303
300
  });
301
+ export { allTools, destructiveTools };
@@ -15,7 +15,7 @@ export async function listPods(k8sManager, input) {
15
15
  const pods = body.items.map((pod) => ({
16
16
  name: pod.metadata?.name || "",
17
17
  namespace: pod.metadata?.namespace || "",
18
- status: pod.status?.phase,
18
+ phase: pod.status?.phase,
19
19
  createdAt: pod.metadata?.creationTimestamp,
20
20
  }));
21
21
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-server-kubernetes",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "MCP server for interacting with Kubernetes clusters via kubectl",
5
5
  "license": "MIT",
6
6
  "type": "module",