kubectl-mcp-server 1.15.0__py3-none-any.whl → 1.17.0__py3-none-any.whl
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.
- {kubectl_mcp_server-1.15.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/METADATA +34 -13
- kubectl_mcp_server-1.17.0.dist-info/RECORD +75 -0
- kubectl_mcp_tool/__init__.py +1 -1
- kubectl_mcp_tool/cli/cli.py +83 -9
- kubectl_mcp_tool/cli/output.py +14 -0
- kubectl_mcp_tool/config/__init__.py +46 -0
- kubectl_mcp_tool/config/loader.py +386 -0
- kubectl_mcp_tool/config/schema.py +184 -0
- kubectl_mcp_tool/crd_detector.py +247 -0
- kubectl_mcp_tool/k8s_config.py +19 -0
- kubectl_mcp_tool/mcp_server.py +246 -8
- kubectl_mcp_tool/observability/__init__.py +59 -0
- kubectl_mcp_tool/observability/metrics.py +223 -0
- kubectl_mcp_tool/observability/stats.py +255 -0
- kubectl_mcp_tool/observability/tracing.py +335 -0
- kubectl_mcp_tool/prompts/__init__.py +43 -0
- kubectl_mcp_tool/prompts/builtin.py +695 -0
- kubectl_mcp_tool/prompts/custom.py +298 -0
- kubectl_mcp_tool/prompts/prompts.py +180 -4
- kubectl_mcp_tool/safety.py +155 -0
- kubectl_mcp_tool/tools/__init__.py +20 -0
- kubectl_mcp_tool/tools/backup.py +881 -0
- kubectl_mcp_tool/tools/capi.py +727 -0
- kubectl_mcp_tool/tools/certs.py +709 -0
- kubectl_mcp_tool/tools/cilium.py +582 -0
- kubectl_mcp_tool/tools/cluster.py +384 -0
- kubectl_mcp_tool/tools/gitops.py +552 -0
- kubectl_mcp_tool/tools/keda.py +464 -0
- kubectl_mcp_tool/tools/kiali.py +652 -0
- kubectl_mcp_tool/tools/kubevirt.py +803 -0
- kubectl_mcp_tool/tools/policy.py +554 -0
- kubectl_mcp_tool/tools/rollouts.py +790 -0
- tests/test_browser.py +2 -2
- tests/test_config.py +386 -0
- tests/test_ecosystem.py +331 -0
- tests/test_mcp_integration.py +251 -0
- tests/test_observability.py +521 -0
- tests/test_prompts.py +716 -0
- tests/test_safety.py +218 -0
- tests/test_tools.py +70 -8
- kubectl_mcp_server-1.15.0.dist-info/RECORD +0 -49
- {kubectl_mcp_server-1.15.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/WHEEL +0 -0
- {kubectl_mcp_server-1.15.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/entry_points.txt +0 -0
- {kubectl_mcp_server-1.15.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/licenses/LICENSE +0 -0
- {kubectl_mcp_server-1.15.0.dist-info → kubectl_mcp_server-1.17.0.dist-info}/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: kubectl-mcp-server
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary: A Model Context Protocol (MCP) server for Kubernetes with
|
|
3
|
+
Version: 1.17.0
|
|
4
|
+
Summary: A Model Context Protocol (MCP) server for Kubernetes with 220+ tools, 8 resources, and 8 prompts
|
|
5
5
|
Home-page: https://github.com/rohitg00/kubectl-mcp-server
|
|
6
6
|
Author: Rohit Ghumare
|
|
7
7
|
Author-email: ghumare64@gmail.com
|
|
@@ -70,7 +70,7 @@ Talk to your clusters like you talk to a DevOps expert. Debug crashed pods, opti
|
|
|
70
70
|
[](https://pypi.org/project/kubectl-mcp-server/)
|
|
71
71
|
[](https://www.npmjs.com/package/kubectl-mcp-server)
|
|
72
72
|
[](https://hub.docker.com/r/rohitghumare64/kubectl-mcp-server)
|
|
73
|
-
[](https://github.com/rohitg00/kubectl-mcp-server)
|
|
74
74
|
[](https://aregistry.ai)
|
|
75
75
|
|
|
76
76
|
---
|
|
@@ -155,7 +155,7 @@ Simply ask your AI assistant in natural language:
|
|
|
155
155
|
- Interactive HTML dashboards with live metrics
|
|
156
156
|
- Visual timeline of events and resource usage
|
|
157
157
|
|
|
158
|
-
**
|
|
158
|
+
**224 powerful tools** | **8 workflow prompts** | **8 data resources** | **Works with all major AI assistants**
|
|
159
159
|
|
|
160
160
|
## Why kubectl-mcp-server?
|
|
161
161
|
|
|
@@ -456,7 +456,7 @@ Add to `~/.config/roo-code/mcp.json` or `~/.config/kilo-code/mcp.json`:
|
|
|
456
456
|
|
|
457
457
|
## Complete Feature Set
|
|
458
458
|
|
|
459
|
-
###
|
|
459
|
+
### 224 MCP Tools for Complete Kubernetes Management
|
|
460
460
|
|
|
461
461
|
| Category | Tools |
|
|
462
462
|
|----------|-------|
|
|
@@ -481,6 +481,16 @@ Add to `~/.config/roo-code/mcp.json` or `~/.config/kilo-code/mcp.json`:
|
|
|
481
481
|
| **Cost Optimization** | `get_resource_recommendations`, `get_idle_resources`, `get_resource_quotas_usage`, `get_cost_analysis`, `get_overprovisioned_resources`, `get_resource_trends`, `get_namespace_cost_allocation`, `optimize_resource_requests` |
|
|
482
482
|
| **Advanced** | `kubectl_generic`, `kubectl_explain`, `get_api_resources`, `port_forward`, `get_resource_usage`, `node_management` |
|
|
483
483
|
| **UI Dashboards** | `show_pod_logs_ui`, `show_pods_dashboard_ui`, `show_resource_yaml_ui`, `show_cluster_overview_ui`, `show_events_timeline_ui`, `render_k8s_dashboard_screenshot` |
|
|
484
|
+
| **GitOps (Flux/Argo)** | `gitops_apps_list`, `gitops_app_get`, `gitops_app_sync`, `gitops_app_status`, `gitops_sources_list`, `gitops_source_get`, `gitops_detect_engine` |
|
|
485
|
+
| **Cert-Manager** | `certs_list`, `certs_get`, `certs_issuers_list`, `certs_issuer_get`, `certs_renew`, `certs_status_explain`, `certs_challenges_list`, `certs_requests_list`, `certs_detect` |
|
|
486
|
+
| **Policy (Kyverno/Gatekeeper)** | `policy_list`, `policy_get`, `policy_violations_list`, `policy_explain_denial`, `policy_audit`, `policy_detect` |
|
|
487
|
+
| **Backup (Velero)** | `backup_list`, `backup_get`, `backup_create`, `backup_delete`, `restore_list`, `restore_create`, `restore_get`, `backup_locations_list`, `backup_schedules_list`, `backup_schedule_create`, `backup_detect` |
|
|
488
|
+
| **KEDA Autoscaling** | `keda_scaledobjects_list`, `keda_scaledobject_get`, `keda_scaledjobs_list`, `keda_triggerauths_list`, `keda_triggerauth_get`, `keda_hpa_list`, `keda_detect` |
|
|
489
|
+
| **Cilium/Hubble** | `cilium_policies_list`, `cilium_policy_get`, `cilium_endpoints_list`, `cilium_identities_list`, `cilium_nodes_list`, `cilium_status`, `hubble_flows_query`, `cilium_detect` |
|
|
490
|
+
| **Argo Rollouts/Flagger** | `rollouts_list`, `rollout_get`, `rollout_status`, `rollout_promote`, `rollout_abort`, `rollout_retry`, `rollout_restart`, `analysis_runs_list`, `flagger_canaries_list`, `flagger_canary_get`, `rollouts_detect` |
|
|
491
|
+
| **Cluster API** | `capi_clusters_list`, `capi_cluster_get`, `capi_machines_list`, `capi_machine_get`, `capi_machinedeployments_list`, `capi_machinedeployment_scale`, `capi_machinesets_list`, `capi_machinehealthchecks_list`, `capi_clusterclasses_list`, `capi_cluster_kubeconfig`, `capi_detect` |
|
|
492
|
+
| **KubeVirt VMs** | `kubevirt_vms_list`, `kubevirt_vm_get`, `kubevirt_vmis_list`, `kubevirt_vm_start`, `kubevirt_vm_stop`, `kubevirt_vm_restart`, `kubevirt_vm_pause`, `kubevirt_vm_unpause`, `kubevirt_vm_migrate`, `kubevirt_datasources_list`, `kubevirt_instancetypes_list`, `kubevirt_datavolumes_list`, `kubevirt_detect` |
|
|
493
|
+
| **Istio/Kiali** | `istio_virtualservices_list`, `istio_virtualservice_get`, `istio_destinationrules_list`, `istio_gateways_list`, `istio_peerauthentications_list`, `istio_authorizationpolicies_list`, `istio_proxy_status`, `istio_analyze`, `istio_sidecar_status`, `istio_detect` |
|
|
484
494
|
|
|
485
495
|
### MCP Resources
|
|
486
496
|
|
|
@@ -520,11 +530,12 @@ Pre-built workflow prompts for common Kubernetes operations:
|
|
|
520
530
|
|
|
521
531
|
### Key Capabilities
|
|
522
532
|
|
|
523
|
-
- 🤖 **
|
|
533
|
+
- 🤖 **224 Powerful Tools** - Complete Kubernetes management from pods to security
|
|
524
534
|
- 🎯 **8 AI Workflow Prompts** - Pre-built workflows for common operations
|
|
525
535
|
- 📊 **8 MCP Resources** - Browsable Kubernetes data exposure
|
|
526
536
|
- 🎨 **6 Interactive Dashboards** - HTML UI tools for visual cluster management
|
|
527
537
|
- 🌐 **26 Browser Tools** - Web automation with cloud provider support
|
|
538
|
+
- 🔄 **93 Ecosystem Tools** - GitOps, Cert-Manager, Policy, Backup, KEDA, Cilium, Rollouts, CAPI, KubeVirt, Istio
|
|
528
539
|
- ⚡ **Multi-Transport** - stdio, SSE, HTTP, streamable-http
|
|
529
540
|
- 🔐 **Security First** - Non-destructive mode, secret masking, RBAC validation
|
|
530
541
|
- 🏥 **Advanced Diagnostics** - AI-powered troubleshooting and cost optimization
|
|
@@ -759,7 +770,7 @@ EOF
|
|
|
759
770
|
agentgateway --config gateway.yaml
|
|
760
771
|
```
|
|
761
772
|
|
|
762
|
-
Connect clients to `http://localhost:3000/mcp` for unified access to all
|
|
773
|
+
Connect clients to `http://localhost:3000/mcp` for unified access to all 224 tools.
|
|
763
774
|
|
|
764
775
|
## In-Cluster Deployment
|
|
765
776
|
|
|
@@ -818,7 +829,7 @@ kubectl apply -f deploy/kagent/toolserver-stdio.yaml
|
|
|
818
829
|
kagent dashboard
|
|
819
830
|
```
|
|
820
831
|
|
|
821
|
-
Your AI agents now have access to all
|
|
832
|
+
Your AI agents now have access to all 224 Kubernetes tools. See [kagent quickstart](https://kagent.dev/docs/kagent/getting-started/quickstart).
|
|
822
833
|
|
|
823
834
|
## Architecture
|
|
824
835
|
|
|
@@ -836,7 +847,7 @@ The MCP server implements the [Model Context Protocol](https://github.com/modelc
|
|
|
836
847
|
```
|
|
837
848
|
kubectl_mcp_tool/
|
|
838
849
|
├── mcp_server.py # Main server (FastMCP, transports)
|
|
839
|
-
├── tools/ #
|
|
850
|
+
├── tools/ # 224 MCP tools organized by category
|
|
840
851
|
│ ├── pods.py # Pod management & diagnostics
|
|
841
852
|
│ ├── deployments.py # Deployments, StatefulSets, DaemonSets
|
|
842
853
|
│ ├── core.py # Namespaces, ConfigMaps, Secrets
|
|
@@ -848,7 +859,17 @@ kubectl_mcp_tool/
|
|
|
848
859
|
│ ├── operations.py # kubectl apply/patch/describe/etc
|
|
849
860
|
│ ├── diagnostics.py # Metrics, namespace comparison
|
|
850
861
|
│ ├── cost.py # Resource optimization & cost analysis
|
|
851
|
-
│
|
|
862
|
+
│ ├── ui.py # MCP-UI interactive dashboards
|
|
863
|
+
│ ├── gitops.py # GitOps (Flux/ArgoCD)
|
|
864
|
+
│ ├── certs.py # Cert-Manager
|
|
865
|
+
│ ├── policy.py # Policy (Kyverno/Gatekeeper)
|
|
866
|
+
│ ├── backup.py # Backup (Velero)
|
|
867
|
+
│ ├── keda.py # KEDA autoscaling
|
|
868
|
+
│ ├── cilium.py # Cilium/Hubble network observability
|
|
869
|
+
│ ├── rollouts.py # Argo Rollouts/Flagger
|
|
870
|
+
│ ├── capi.py # Cluster API
|
|
871
|
+
│ ├── kubevirt.py # KubeVirt VMs
|
|
872
|
+
│ └── kiali.py # Istio/Kiali service mesh
|
|
852
873
|
├── resources/ # 8 MCP Resources for data exposure
|
|
853
874
|
├── prompts/ # 8 MCP Prompts for workflows
|
|
854
875
|
└── cli/ # CLI interface
|
|
@@ -860,7 +881,7 @@ Seamlessly manage multiple Kubernetes clusters through natural language. **Every
|
|
|
860
881
|
|
|
861
882
|
### Context Parameter (v1.15.0)
|
|
862
883
|
|
|
863
|
-
All
|
|
884
|
+
All 224 tools accept an optional `context` parameter to target specific clusters:
|
|
864
885
|
|
|
865
886
|
**Talk to your AI assistant:**
|
|
866
887
|
```
|
|
@@ -949,13 +970,13 @@ pytest tests/ -v -m unit
|
|
|
949
970
|
tests/
|
|
950
971
|
├── __init__.py # Test package
|
|
951
972
|
├── conftest.py # Shared fixtures and mocks
|
|
952
|
-
├── test_tools.py # Unit tests for
|
|
973
|
+
├── test_tools.py # Unit tests for 224 MCP tools
|
|
953
974
|
├── test_resources.py # Tests for 8 MCP Resources
|
|
954
975
|
├── test_prompts.py # Tests for 8 MCP Prompts
|
|
955
976
|
└── test_server.py # Server initialization tests
|
|
956
977
|
```
|
|
957
978
|
|
|
958
|
-
**
|
|
979
|
+
**234 tests covering**: tool registration, resource exposure, prompt generation, server initialization, non-destructive mode, secret masking, error handling, transport methods, CLI commands, browser automation, and ecosystem tools.
|
|
959
980
|
|
|
960
981
|
### Code Quality
|
|
961
982
|
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
kubectl_mcp_server-1.17.0.dist-info/licenses/LICENSE,sha256=nH9Z0W0WNH2oQ4cPrBAU8ldDcHfeI6NUbkSGiazYWgQ,1070
|
|
2
|
+
kubectl_mcp_tool/__init__.py,sha256=9s67uMXh5QXX-vJgm6xVezzvqqpgckeH0JrNM9Q381E,580
|
|
3
|
+
kubectl_mcp_tool/__main__.py,sha256=CE6cTD6PA71Ap0i5_gE17Pb9FcedOJmtGRNzZ5-TFSc,1490
|
|
4
|
+
kubectl_mcp_tool/crd_detector.py,sha256=xLZSyg3iIe_MjSMI3mESe2VK8wGJzu40rJ7F72fULBs,7139
|
|
5
|
+
kubectl_mcp_tool/diagnostics.py,sha256=uwolSoHadRkB-J8PAsabbexfj6sTNCIIRRrABBRXoTU,11776
|
|
6
|
+
kubectl_mcp_tool/k8s_config.py,sha256=tjP_VONsoqhd5qn0LPB25aKhiPw2qCYhJ_B52NbRYDo,15746
|
|
7
|
+
kubectl_mcp_tool/mcp_server.py,sha256=-p-r-NRaX6UiHUebvO4OIozRlA2PX851rmAlW_rO3Tk,31112
|
|
8
|
+
kubectl_mcp_tool/safety.py,sha256=7bx7tUH_hT4Y_eTnpH5knnHTsvnIZvI_0oo9MSBe_z8,5036
|
|
9
|
+
kubectl_mcp_tool/auth/__init__.py,sha256=ot8ivZZkDtV8Rg0y1UYruwobKCPyxX1svqh35wWxKvY,347
|
|
10
|
+
kubectl_mcp_tool/auth/config.py,sha256=wi3wuJNMyDqMeluDHL0MaJyedIFv5CFVxiUaEVaTvzk,2267
|
|
11
|
+
kubectl_mcp_tool/auth/scopes.py,sha256=KPmuGO0SrTkjzlElWFOV29ie9apTdMklOCkiA-965lI,6147
|
|
12
|
+
kubectl_mcp_tool/auth/verifier.py,sha256=ChZM-UsZJgZc3LjSfw8VfSydkKqKBZ1s8es71LlB_A0,2431
|
|
13
|
+
kubectl_mcp_tool/cli/__init__.py,sha256=NDd1-7_Ira9vx0uNVOUqhkK7S53IOTu0WUBWOKCtap8,1348
|
|
14
|
+
kubectl_mcp_tool/cli/__main__.py,sha256=OxhHqW8YsTd565acTDlZknljPAw6FN9JW7pNtgWIcFE,196
|
|
15
|
+
kubectl_mcp_tool/cli/cli.py,sha256=vty-ooXE9lpi7BgIHmEsuUn3WYEiqlmPm6WIEmb9nYg,22510
|
|
16
|
+
kubectl_mcp_tool/cli/errors.py,sha256=nCvopWH9bt8wGRt6RTDoXo7IsKwsdwzRMvJ5OM2a1Eg,9018
|
|
17
|
+
kubectl_mcp_tool/cli/output.py,sha256=Ml14BadxgbOUpUZy_76lHrOxsxramvISgK_2Gney9lI,10558
|
|
18
|
+
kubectl_mcp_tool/config/__init__.py,sha256=1jk1JHO1Wpr7W9ISoJST8bZkm7B8ZAjVSQ3OoF9mZyw,961
|
|
19
|
+
kubectl_mcp_tool/config/loader.py,sha256=7HecHrQ-PvBad22954fqZqFLozpfhJ5BDspZWXBjOEg,12045
|
|
20
|
+
kubectl_mcp_tool/config/schema.py,sha256=Y4cvsHLXcTBpuWdobxDO5y4Ig8LiyeEgKd7wUZp4Rag,6103
|
|
21
|
+
kubectl_mcp_tool/observability/__init__.py,sha256=cNGHWjn7cAPHwI_0ZimcLUVQd5VMRKgcNnfkA6bj658,1469
|
|
22
|
+
kubectl_mcp_tool/observability/metrics.py,sha256=u2CbMTjceibz04f6o8l_iUmgMSfzX2EgnGCDS9FQbUY,5790
|
|
23
|
+
kubectl_mcp_tool/observability/stats.py,sha256=qbbWaKCuHm1nbTVF-AeIfBlhaITJuUCnv9IccpuRxgQ,7971
|
|
24
|
+
kubectl_mcp_tool/observability/tracing.py,sha256=DEziQN7WbR9taQ7vEo2yM3JtlHKXpLSyPNWjVh6SvUg,11162
|
|
25
|
+
kubectl_mcp_tool/prompts/__init__.py,sha256=ecxQuPcBKRaF8zbG5fkthrRXGhlSjORLVuk9hV4582g,1104
|
|
26
|
+
kubectl_mcp_tool/prompts/builtin.py,sha256=ET5KYqC-J3XwzVfesB7V6faLFSFlvvAqpT0gTuexRgk,20146
|
|
27
|
+
kubectl_mcp_tool/prompts/custom.py,sha256=ce4DmQLMh_UTKb4kbredekvvgI8GQWzuuB2H0P4JJAA,9214
|
|
28
|
+
kubectl_mcp_tool/prompts/prompts.py,sha256=ogDhU6FVsYIlig_QuIw-TblxR9GQJ3Xp8mJHLBcZ1z4,28263
|
|
29
|
+
kubectl_mcp_tool/resources/__init__.py,sha256=ERkn0ErlaGi9-dybv4wrAaT8WretvNp6K002h7Agjno,83
|
|
30
|
+
kubectl_mcp_tool/resources/resources.py,sha256=kvK4OM3Ox5cFvWDqJBTXOfBgnRYdoqdvvjsdCg0PJfY,12713
|
|
31
|
+
kubectl_mcp_tool/tools/__init__.py,sha256=DgFcaXxqMf7dgXcYWXl0-zKBJTUSF7Y__Cqsd79hRBA,1761
|
|
32
|
+
kubectl_mcp_tool/tools/backup.py,sha256=ToZABafXvrBQy-Hlc31xzVX5shWaB71JeqD3xq-4kh0,30423
|
|
33
|
+
kubectl_mcp_tool/tools/browser.py,sha256=OvXUHzEuciRQInnwLLC16iObOOdniu09b9RT81y7sdc,25338
|
|
34
|
+
kubectl_mcp_tool/tools/capi.py,sha256=mPCm6wUI3Sr5Mg9RjWSKBR5uwWn02Byyx42Cc1Fo7IE,25738
|
|
35
|
+
kubectl_mcp_tool/tools/certs.py,sha256=7Qdsx3IwCI3_mgcPrypzF6MFL5jZjKkVXsXUohAbfh8,25720
|
|
36
|
+
kubectl_mcp_tool/tools/cilium.py,sha256=ku5E-fQ9vS4MhSnaZA_rli6ebXXLCHBuKhZBrEo221c,19973
|
|
37
|
+
kubectl_mcp_tool/tools/cluster.py,sha256=DAA2NQyRmMtyBDgyYOgwaCEPl0jGL24HOH07ypiCOYw,35660
|
|
38
|
+
kubectl_mcp_tool/tools/core.py,sha256=67Cx1z4DqV0Qd26yXkF1eBXbUIlBB3Qj2W8rOInvb54,17801
|
|
39
|
+
kubectl_mcp_tool/tools/cost.py,sha256=fcFlIv-bsMdKESw-l-T6ECsUplDukNHaqM76JCYVHvQ,29629
|
|
40
|
+
kubectl_mcp_tool/tools/deployments.py,sha256=e138KV30DQhLCnvXntrofx1XdLH0dC0_mlODbzkluKk,18329
|
|
41
|
+
kubectl_mcp_tool/tools/diagnostics.py,sha256=LGpW-cx2ui40IIq4pZPT2O8nVzKCpOEVnnQ1OGUSVt0,7864
|
|
42
|
+
kubectl_mcp_tool/tools/gitops.py,sha256=YMsSL0vzzz-XtFXRgney3yKwVfIfuYTSOsLbbLUEI5w,20497
|
|
43
|
+
kubectl_mcp_tool/tools/helm.py,sha256=v_d1aH79VCKJmFi-kXG1LwzZRw6OFToyVC7D9tEp99A,61658
|
|
44
|
+
kubectl_mcp_tool/tools/keda.py,sha256=Et7NSRIH2FSIG2iJ0LyLcQTsFqdeVsKTUr1KKT4tmso,16155
|
|
45
|
+
kubectl_mcp_tool/tools/kiali.py,sha256=ThUF3d_PBEpu9aVSg8gVw9WtPGwkwJlmn6R8sj-BgqM,21932
|
|
46
|
+
kubectl_mcp_tool/tools/kubevirt.py,sha256=yN5ilsGEEFTKJ7h5iAONr4CVFqj_wKjHBcdijGx2DWU,26878
|
|
47
|
+
kubectl_mcp_tool/tools/networking.py,sha256=5I-2SHp2kK9OyGJJ9KUU0hetlYoREIfin1J6CJA6HVQ,14309
|
|
48
|
+
kubectl_mcp_tool/tools/operations.py,sha256=c7j1quXwRDoB9pMkmnLZ5Mk4QoCAuEzWVXJl_hmg2tc,24862
|
|
49
|
+
kubectl_mcp_tool/tools/pods.py,sha256=PsjqbudCUEgZdJmBBeHX3qg-mObn9mlVOCpJOU8XBd8,27271
|
|
50
|
+
kubectl_mcp_tool/tools/policy.py,sha256=T4zf6EvOdIOtqLfnn4wE1QR7nzIeYOkG-vIvXNcu4nc,21769
|
|
51
|
+
kubectl_mcp_tool/tools/rollouts.py,sha256=K1VpvnMIE36I0kWB0Bo338UNQhctkIdmtmcdkt3ddhE,26224
|
|
52
|
+
kubectl_mcp_tool/tools/security.py,sha256=d7WLj-JZwr-0opzkRNWyPdMykvBjdsDCBSZHovDIPLo,13971
|
|
53
|
+
kubectl_mcp_tool/tools/storage.py,sha256=ILI3X5GYXASCETqg3A7X33B7PjwD5UsxL-iDG7yTi_8,5676
|
|
54
|
+
kubectl_mcp_tool/tools/ui.py,sha256=HHi0KM2JTvZFpQjo5V6XkJf02hxFoasec7uyNY5wuuo,39702
|
|
55
|
+
kubectl_mcp_tool/utils/__init__.py,sha256=CHBCpaXwt994DlqyRFkkRky2TK8OmmDl0Gyc28369gI,348
|
|
56
|
+
kubectl_mcp_tool/utils/helpers.py,sha256=W--wiVSKKqmjpxxdLT0J6rmhOQcp1OFk9jLrtQUVpGw,2444
|
|
57
|
+
tests/__init__.py,sha256=qZPXYXv3whkkWhi61Ngzj09GHnIFlVSZrajE0XRk55o,290
|
|
58
|
+
tests/conftest.py,sha256=6054YlpuGleV3Wg8BnVj4lnKWhGk-Eqc9JYTXxOmsXs,10782
|
|
59
|
+
tests/test_auth.py,sha256=PoESfWiN92wSGUdVwLL3Z1AP6C1zUsVmgTI7Q8ZdlxM,11074
|
|
60
|
+
tests/test_browser.py,sha256=6rB6Atqq3b2-xWnKzFdCVFHbF2Q3nt2Dy8Rp4ZwIgNk,20621
|
|
61
|
+
tests/test_cli.py,sha256=G-f9uByWooe-yUOH0ahBdoft4uz8TC0R0OzDs1Lom-4,10014
|
|
62
|
+
tests/test_config.py,sha256=9_A6_ntjvX556GvFvHGHuel1ERGo-WrbnFJX8OniUvg,12568
|
|
63
|
+
tests/test_ecosystem.py,sha256=SkxDWAASELIxzaYWu0d-Rw1HaKSSlyMMenwwF2HWvSA,13227
|
|
64
|
+
tests/test_mcp_integration.py,sha256=9ePvu1MJ0mTnMRFHthDwl3D2jyVPgQ1beUbchpT8Y3M,8782
|
|
65
|
+
tests/test_observability.py,sha256=m0m-uIQrE9OJ3FFls_rVZJst3NeAFKRtNUZohFpIZE4,17829
|
|
66
|
+
tests/test_prompts.py,sha256=VzZAXr5iFO-hG8kRwRnG4wom2LlqOmZ-SeW4d3HQ7hc,42888
|
|
67
|
+
tests/test_resources.py,sha256=Z0Ex8WdRz-B3VZa1s0eAaDDGbhy7dRdqy1uFVOe2Qbo,12689
|
|
68
|
+
tests/test_safety.py,sha256=5IOBQbcH2r8tANQD7ymsR6pBc6O50IspcFsuwrnwh1M,8292
|
|
69
|
+
tests/test_server.py,sha256=lLvgbqutnivSgQMNrki0O48whBQt0UXjdwT047nf0nw,14415
|
|
70
|
+
tests/test_tools.py,sha256=g3moVSpiFgqC107M4tBAQ6xU600rlYMPhnknyYhnTIc,34792
|
|
71
|
+
kubectl_mcp_server-1.17.0.dist-info/METADATA,sha256=EUwLkB1T8qDphYWRwKMaXiuw6BYDnQjBa21DTvnoRCc,38116
|
|
72
|
+
kubectl_mcp_server-1.17.0.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
|
|
73
|
+
kubectl_mcp_server-1.17.0.dist-info/entry_points.txt,sha256=zeOxQGaNC4r58deEmqsLCU5hfMjF0VqFUt9P5wWsKEM,109
|
|
74
|
+
kubectl_mcp_server-1.17.0.dist-info/top_level.txt,sha256=o5IpfOGG-lqU8rVWJeK9aYC0r4f6qEX09QiBhZlYbkQ,23
|
|
75
|
+
kubectl_mcp_server-1.17.0.dist-info/RECORD,,
|
kubectl_mcp_tool/__init__.py
CHANGED
|
@@ -7,7 +7,7 @@ with Kubernetes clusters through natural language commands.
|
|
|
7
7
|
For more information, see: https://github.com/rohitg00/kubectl-mcp-server
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
|
-
__version__ = "1.
|
|
10
|
+
__version__ = "1.17.0"
|
|
11
11
|
|
|
12
12
|
from .mcp_server import MCPServer
|
|
13
13
|
from .diagnostics import run_diagnostics, check_kubectl_installation, check_cluster_connection
|
kubectl_mcp_tool/cli/cli.py
CHANGED
|
@@ -37,6 +37,7 @@ from .output import (
|
|
|
37
37
|
format_error,
|
|
38
38
|
format_success,
|
|
39
39
|
)
|
|
40
|
+
from ..safety import SafetyMode, set_safety_mode, get_mode_info
|
|
40
41
|
|
|
41
42
|
# Logging setup
|
|
42
43
|
log_file = os.environ.get("MCP_LOG_FILE")
|
|
@@ -56,18 +57,49 @@ logging.basicConfig(
|
|
|
56
57
|
logger = logging.getLogger("kubectl-mcp-cli")
|
|
57
58
|
|
|
58
59
|
|
|
59
|
-
async def serve_stdio(
|
|
60
|
-
|
|
60
|
+
async def serve_stdio(
|
|
61
|
+
read_only: bool = False,
|
|
62
|
+
disable_destructive: bool = False,
|
|
63
|
+
config_file: Optional[str] = None,
|
|
64
|
+
):
|
|
65
|
+
server = MCPServer(
|
|
66
|
+
"kubernetes",
|
|
67
|
+
read_only=read_only,
|
|
68
|
+
disable_destructive=disable_destructive,
|
|
69
|
+
config_file=config_file,
|
|
70
|
+
)
|
|
61
71
|
await server.serve_stdio()
|
|
62
72
|
|
|
63
73
|
|
|
64
|
-
async def serve_sse(
|
|
65
|
-
|
|
74
|
+
async def serve_sse(
|
|
75
|
+
host: str,
|
|
76
|
+
port: int,
|
|
77
|
+
read_only: bool = False,
|
|
78
|
+
disable_destructive: bool = False,
|
|
79
|
+
config_file: Optional[str] = None,
|
|
80
|
+
):
|
|
81
|
+
server = MCPServer(
|
|
82
|
+
"kubernetes",
|
|
83
|
+
read_only=read_only,
|
|
84
|
+
disable_destructive=disable_destructive,
|
|
85
|
+
config_file=config_file,
|
|
86
|
+
)
|
|
66
87
|
await server.serve_sse(host=host, port=port)
|
|
67
88
|
|
|
68
89
|
|
|
69
|
-
async def serve_http(
|
|
70
|
-
|
|
90
|
+
async def serve_http(
|
|
91
|
+
host: str,
|
|
92
|
+
port: int,
|
|
93
|
+
read_only: bool = False,
|
|
94
|
+
disable_destructive: bool = False,
|
|
95
|
+
config_file: Optional[str] = None,
|
|
96
|
+
):
|
|
97
|
+
server = MCPServer(
|
|
98
|
+
"kubernetes",
|
|
99
|
+
read_only=read_only,
|
|
100
|
+
disable_destructive=disable_destructive,
|
|
101
|
+
config_file=config_file,
|
|
102
|
+
)
|
|
71
103
|
await server.serve_http(host=host, port=port)
|
|
72
104
|
|
|
73
105
|
|
|
@@ -282,12 +314,16 @@ def cmd_info(args):
|
|
|
282
314
|
except Exception:
|
|
283
315
|
pass
|
|
284
316
|
|
|
317
|
+
# Get safety mode info
|
|
318
|
+
mode_info = get_mode_info()
|
|
319
|
+
|
|
285
320
|
print(format_server_info(
|
|
286
321
|
version=__version__,
|
|
287
322
|
tool_count=len(tools),
|
|
288
323
|
resource_count=len(resources),
|
|
289
324
|
prompt_count=len(prompts),
|
|
290
325
|
context=context,
|
|
326
|
+
safety_mode=mode_info,
|
|
291
327
|
as_json=getattr(args, 'json', False)
|
|
292
328
|
))
|
|
293
329
|
return ErrorCode.SUCCESS
|
|
@@ -407,6 +443,16 @@ def cmd_doctor(args):
|
|
|
407
443
|
except ImportError:
|
|
408
444
|
checks.append({"name": "fastmcp", "status": "error", "details": "fastmcp not installed"})
|
|
409
445
|
|
|
446
|
+
# Check safety mode
|
|
447
|
+
mode_info = get_mode_info()
|
|
448
|
+
mode = mode_info.get("mode", "normal")
|
|
449
|
+
if mode == "normal":
|
|
450
|
+
checks.append({"name": "safety_mode", "status": "ok", "version": mode, "details": "All operations allowed"})
|
|
451
|
+
elif mode == "read_only":
|
|
452
|
+
checks.append({"name": "safety_mode", "status": "warning", "version": mode, "details": "Write operations blocked"})
|
|
453
|
+
else:
|
|
454
|
+
checks.append({"name": "safety_mode", "status": "warning", "version": mode, "details": "Destructive operations blocked"})
|
|
455
|
+
|
|
410
456
|
print(format_doctor_results(checks, as_json=getattr(args, 'json', False)))
|
|
411
457
|
|
|
412
458
|
# Return error code if any critical checks failed
|
|
@@ -453,6 +499,9 @@ Environment Variables:
|
|
|
453
499
|
)
|
|
454
500
|
serve_parser.add_argument("--host", type=str, default="0.0.0.0", help="Host for SSE/HTTP (default: 0.0.0.0)")
|
|
455
501
|
serve_parser.add_argument("--port", type=int, default=8000, help="Port for SSE/HTTP (default: 8000)")
|
|
502
|
+
serve_parser.add_argument("--config", type=str, default=None, help="Path to TOML configuration file")
|
|
503
|
+
serve_parser.add_argument("--read-only", action="store_true", help="Enable read-only mode (block all write operations)")
|
|
504
|
+
serve_parser.add_argument("--disable-destructive", action="store_true", help="Disable destructive operations (allow create/update, block delete)")
|
|
456
505
|
|
|
457
506
|
# version command (existing)
|
|
458
507
|
subparsers.add_parser("version", help="Show version")
|
|
@@ -507,12 +556,37 @@ Environment Variables:
|
|
|
507
556
|
|
|
508
557
|
try:
|
|
509
558
|
if args.command == "serve":
|
|
559
|
+
# Log safety mode (actual mode is applied in MCPServer)
|
|
560
|
+
if args.read_only:
|
|
561
|
+
logger.info("Starting server in READ-ONLY mode")
|
|
562
|
+
elif args.disable_destructive:
|
|
563
|
+
logger.info("Starting server with destructive operations disabled")
|
|
564
|
+
|
|
565
|
+
if args.config:
|
|
566
|
+
logger.info(f"Loading configuration from: {args.config}")
|
|
567
|
+
|
|
510
568
|
if args.transport == "stdio":
|
|
511
|
-
asyncio.run(serve_stdio(
|
|
569
|
+
asyncio.run(serve_stdio(
|
|
570
|
+
read_only=args.read_only,
|
|
571
|
+
disable_destructive=args.disable_destructive,
|
|
572
|
+
config_file=args.config,
|
|
573
|
+
))
|
|
512
574
|
elif args.transport == "sse":
|
|
513
|
-
asyncio.run(serve_sse(
|
|
575
|
+
asyncio.run(serve_sse(
|
|
576
|
+
host=args.host,
|
|
577
|
+
port=args.port,
|
|
578
|
+
read_only=args.read_only,
|
|
579
|
+
disable_destructive=args.disable_destructive,
|
|
580
|
+
config_file=args.config,
|
|
581
|
+
))
|
|
514
582
|
elif args.transport in ("http", "streamable-http"):
|
|
515
|
-
asyncio.run(serve_http(
|
|
583
|
+
asyncio.run(serve_http(
|
|
584
|
+
host=args.host,
|
|
585
|
+
port=args.port,
|
|
586
|
+
read_only=args.read_only,
|
|
587
|
+
disable_destructive=args.disable_destructive,
|
|
588
|
+
config_file=args.config,
|
|
589
|
+
))
|
|
516
590
|
|
|
517
591
|
elif args.command == "version":
|
|
518
592
|
from .. import __version__
|
kubectl_mcp_tool/cli/output.py
CHANGED
|
@@ -266,6 +266,7 @@ def format_server_info(
|
|
|
266
266
|
resource_count: int,
|
|
267
267
|
prompt_count: int,
|
|
268
268
|
context: Optional[str] = None,
|
|
269
|
+
safety_mode: Optional[Dict[str, Any]] = None,
|
|
269
270
|
as_json: bool = False
|
|
270
271
|
) -> str:
|
|
271
272
|
info = {
|
|
@@ -276,6 +277,9 @@ def format_server_info(
|
|
|
276
277
|
"k8s_context": context,
|
|
277
278
|
}
|
|
278
279
|
|
|
280
|
+
if safety_mode:
|
|
281
|
+
info["safety_mode"] = safety_mode
|
|
282
|
+
|
|
279
283
|
if as_json:
|
|
280
284
|
return json.dumps(info, indent=2)
|
|
281
285
|
|
|
@@ -291,6 +295,16 @@ def format_server_info(
|
|
|
291
295
|
if context:
|
|
292
296
|
lines.append(f" {cyan('K8s Context:')} {context}")
|
|
293
297
|
|
|
298
|
+
if safety_mode:
|
|
299
|
+
mode = safety_mode.get("mode", "normal")
|
|
300
|
+
if mode == "normal":
|
|
301
|
+
mode_str = green(mode)
|
|
302
|
+
elif mode == "read_only":
|
|
303
|
+
mode_str = yellow(mode) + " (write operations blocked)"
|
|
304
|
+
else:
|
|
305
|
+
mode_str = yellow(mode) + " (destructive operations blocked)"
|
|
306
|
+
lines.append(f" {cyan('Safety Mode:')} {mode_str}")
|
|
307
|
+
|
|
294
308
|
return "\n".join(lines)
|
|
295
309
|
|
|
296
310
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"""Configuration management for kubectl-mcp-server.
|
|
2
|
+
|
|
3
|
+
This module provides TOML-based configuration with:
|
|
4
|
+
- Main config file support
|
|
5
|
+
- Drop-in directory for modular configuration
|
|
6
|
+
- SIGHUP reload for runtime updates
|
|
7
|
+
- Environment variable overrides
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from .loader import (
|
|
11
|
+
Config,
|
|
12
|
+
load_config,
|
|
13
|
+
get_config,
|
|
14
|
+
reload_config,
|
|
15
|
+
get_config_paths,
|
|
16
|
+
setup_sighup_handler,
|
|
17
|
+
register_reload_callback,
|
|
18
|
+
unregister_reload_callback,
|
|
19
|
+
)
|
|
20
|
+
from .schema import (
|
|
21
|
+
ServerConfig,
|
|
22
|
+
SafetyConfig,
|
|
23
|
+
BrowserConfig,
|
|
24
|
+
MetricsConfig,
|
|
25
|
+
LoggingConfig,
|
|
26
|
+
validate_config,
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
# Config loading
|
|
31
|
+
"Config",
|
|
32
|
+
"load_config",
|
|
33
|
+
"get_config",
|
|
34
|
+
"reload_config",
|
|
35
|
+
"get_config_paths",
|
|
36
|
+
"setup_sighup_handler",
|
|
37
|
+
"register_reload_callback",
|
|
38
|
+
"unregister_reload_callback",
|
|
39
|
+
# Config schemas
|
|
40
|
+
"ServerConfig",
|
|
41
|
+
"SafetyConfig",
|
|
42
|
+
"BrowserConfig",
|
|
43
|
+
"MetricsConfig",
|
|
44
|
+
"LoggingConfig",
|
|
45
|
+
"validate_config",
|
|
46
|
+
]
|