kubeview-mcp 1.0.0
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/.prettierrc.json +11 -0
- package/CHANGELOG.md +55 -0
- package/LICENSE +21 -0
- package/README.md +251 -0
- package/RELEASE.md +154 -0
- package/TODO.md +0 -0
- package/bin/kubeview-mcp.js +274 -0
- package/bin/setup.js +368 -0
- package/dist/src/cli/cli.d.ts +3 -0
- package/dist/src/cli/cli.d.ts.map +1 -0
- package/dist/src/cli/cli.js +23 -0
- package/dist/src/cli/cli.js.map +1 -0
- package/dist/src/index.d.ts +8 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +45 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/kubernetes/BaseResourceOperations.d.ts +155 -0
- package/dist/src/kubernetes/BaseResourceOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/BaseResourceOperations.js +136 -0
- package/dist/src/kubernetes/BaseResourceOperations.js.map +1 -0
- package/dist/src/kubernetes/CircuitBreaker.d.ts +182 -0
- package/dist/src/kubernetes/CircuitBreaker.d.ts.map +1 -0
- package/dist/src/kubernetes/CircuitBreaker.js +369 -0
- package/dist/src/kubernetes/CircuitBreaker.js.map +1 -0
- package/dist/src/kubernetes/ConnectionManager.d.ts +60 -0
- package/dist/src/kubernetes/ConnectionManager.d.ts.map +1 -0
- package/dist/src/kubernetes/ConnectionManager.js +77 -0
- package/dist/src/kubernetes/ConnectionManager.js.map +1 -0
- package/dist/src/kubernetes/ConnectionPool.d.ts +183 -0
- package/dist/src/kubernetes/ConnectionPool.d.ts.map +1 -0
- package/dist/src/kubernetes/ConnectionPool.js +437 -0
- package/dist/src/kubernetes/ConnectionPool.js.map +1 -0
- package/dist/src/kubernetes/ErrorHandler.d.ts +172 -0
- package/dist/src/kubernetes/ErrorHandler.d.ts.map +1 -0
- package/dist/src/kubernetes/ErrorHandler.js +328 -0
- package/dist/src/kubernetes/ErrorHandler.js.map +1 -0
- package/dist/src/kubernetes/ErrorHandling.d.ts +148 -0
- package/dist/src/kubernetes/ErrorHandling.d.ts.map +1 -0
- package/dist/src/kubernetes/ErrorHandling.js +304 -0
- package/dist/src/kubernetes/ErrorHandling.js.map +1 -0
- package/dist/src/kubernetes/KubernetesClient.d.ts +162 -0
- package/dist/src/kubernetes/KubernetesClient.d.ts.map +1 -0
- package/dist/src/kubernetes/KubernetesClient.js +382 -0
- package/dist/src/kubernetes/KubernetesClient.js.map +1 -0
- package/dist/src/kubernetes/ResourceOperations.d.ts +69 -0
- package/dist/src/kubernetes/ResourceOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/ResourceOperations.js +99 -0
- package/dist/src/kubernetes/ResourceOperations.js.map +1 -0
- package/dist/src/kubernetes/RetryStrategy.d.ts +137 -0
- package/dist/src/kubernetes/RetryStrategy.d.ts.map +1 -0
- package/dist/src/kubernetes/RetryStrategy.js +277 -0
- package/dist/src/kubernetes/RetryStrategy.js.map +1 -0
- package/dist/src/kubernetes/RetryableOperation.d.ts +118 -0
- package/dist/src/kubernetes/RetryableOperation.d.ts.map +1 -0
- package/dist/src/kubernetes/RetryableOperation.js +233 -0
- package/dist/src/kubernetes/RetryableOperation.js.map +1 -0
- package/dist/src/kubernetes/index.d.ts +18 -0
- package/dist/src/kubernetes/index.d.ts.map +1 -0
- package/dist/src/kubernetes/index.js +28 -0
- package/dist/src/kubernetes/index.js.map +1 -0
- package/dist/src/kubernetes/resources/ConfigMapOperations.d.ts +60 -0
- package/dist/src/kubernetes/resources/ConfigMapOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/ConfigMapOperations.js +306 -0
- package/dist/src/kubernetes/resources/ConfigMapOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/CustomResourceOperations.d.ts +55 -0
- package/dist/src/kubernetes/resources/CustomResourceOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/CustomResourceOperations.js +363 -0
- package/dist/src/kubernetes/resources/CustomResourceOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/DeploymentOperations.d.ts +66 -0
- package/dist/src/kubernetes/resources/DeploymentOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/DeploymentOperations.js +234 -0
- package/dist/src/kubernetes/resources/DeploymentOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/IngressOperations.d.ts +60 -0
- package/dist/src/kubernetes/resources/IngressOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/IngressOperations.js +224 -0
- package/dist/src/kubernetes/resources/IngressOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/MetricOperations.d.ts +218 -0
- package/dist/src/kubernetes/resources/MetricOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/MetricOperations.js +893 -0
- package/dist/src/kubernetes/resources/MetricOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/NamespaceOperations.d.ts +38 -0
- package/dist/src/kubernetes/resources/NamespaceOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/NamespaceOperations.js +101 -0
- package/dist/src/kubernetes/resources/NamespaceOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/PersistentVolumeClaimOperations.d.ts +109 -0
- package/dist/src/kubernetes/resources/PersistentVolumeClaimOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/PersistentVolumeClaimOperations.js +383 -0
- package/dist/src/kubernetes/resources/PersistentVolumeClaimOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/PersistentVolumeOperations.d.ts +97 -0
- package/dist/src/kubernetes/resources/PersistentVolumeOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/PersistentVolumeOperations.js +321 -0
- package/dist/src/kubernetes/resources/PersistentVolumeOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/PodOperations.d.ts +99 -0
- package/dist/src/kubernetes/resources/PodOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/PodOperations.js +333 -0
- package/dist/src/kubernetes/resources/PodOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/SecretOperations.d.ts +71 -0
- package/dist/src/kubernetes/resources/SecretOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/SecretOperations.js +254 -0
- package/dist/src/kubernetes/resources/SecretOperations.js.map +1 -0
- package/dist/src/kubernetes/resources/ServiceOperations.d.ts +64 -0
- package/dist/src/kubernetes/resources/ServiceOperations.d.ts.map +1 -0
- package/dist/src/kubernetes/resources/ServiceOperations.js +232 -0
- package/dist/src/kubernetes/resources/ServiceOperations.js.map +1 -0
- package/dist/src/kubernetes/utils/ResourceUtils.d.ts +238 -0
- package/dist/src/kubernetes/utils/ResourceUtils.d.ts.map +1 -0
- package/dist/src/kubernetes/utils/ResourceUtils.js +439 -0
- package/dist/src/kubernetes/utils/ResourceUtils.js.map +1 -0
- package/dist/src/plugins/ArgoCDToolsPlugin.d.ts +45 -0
- package/dist/src/plugins/ArgoCDToolsPlugin.d.ts.map +1 -0
- package/dist/src/plugins/ArgoCDToolsPlugin.js +155 -0
- package/dist/src/plugins/ArgoCDToolsPlugin.js.map +1 -0
- package/dist/src/plugins/ArgoToolsPlugin.d.ts +45 -0
- package/dist/src/plugins/ArgoToolsPlugin.d.ts.map +1 -0
- package/dist/src/plugins/ArgoToolsPlugin.js +149 -0
- package/dist/src/plugins/ArgoToolsPlugin.js.map +1 -0
- package/dist/src/plugins/HelmToolsPlugin.d.ts +41 -0
- package/dist/src/plugins/HelmToolsPlugin.d.ts.map +1 -0
- package/dist/src/plugins/HelmToolsPlugin.js +146 -0
- package/dist/src/plugins/HelmToolsPlugin.js.map +1 -0
- package/dist/src/plugins/KubernetesToolsPlugin.d.ts +44 -0
- package/dist/src/plugins/KubernetesToolsPlugin.d.ts.map +1 -0
- package/dist/src/plugins/KubernetesToolsPlugin.js +159 -0
- package/dist/src/plugins/KubernetesToolsPlugin.js.map +1 -0
- package/dist/src/plugins/SamplePlugin.d.ts +12 -0
- package/dist/src/plugins/SamplePlugin.d.ts.map +1 -0
- package/dist/src/plugins/SamplePlugin.js +51 -0
- package/dist/src/plugins/SamplePlugin.js.map +1 -0
- package/dist/src/plugins/index.d.ts +5 -0
- package/dist/src/plugins/index.d.ts.map +1 -0
- package/dist/src/plugins/index.js +5 -0
- package/dist/src/plugins/index.js.map +1 -0
- package/dist/src/server/MCPServer.d.ts +93 -0
- package/dist/src/server/MCPServer.d.ts.map +1 -0
- package/dist/src/server/MCPServer.js +398 -0
- package/dist/src/server/MCPServer.js.map +1 -0
- package/dist/src/tools/argo/ArgoCronListTool.d.ts +10 -0
- package/dist/src/tools/argo/ArgoCronListTool.d.ts.map +1 -0
- package/dist/src/tools/argo/ArgoCronListTool.js +70 -0
- package/dist/src/tools/argo/ArgoCronListTool.js.map +1 -0
- package/dist/src/tools/argo/ArgoGetTool.d.ts +10 -0
- package/dist/src/tools/argo/ArgoGetTool.d.ts.map +1 -0
- package/dist/src/tools/argo/ArgoGetTool.js +80 -0
- package/dist/src/tools/argo/ArgoGetTool.js.map +1 -0
- package/dist/src/tools/argo/ArgoListTool.d.ts +10 -0
- package/dist/src/tools/argo/ArgoListTool.d.ts.map +1 -0
- package/dist/src/tools/argo/ArgoListTool.js +133 -0
- package/dist/src/tools/argo/ArgoListTool.js.map +1 -0
- package/dist/src/tools/argo/ArgoLogsTool.d.ts +10 -0
- package/dist/src/tools/argo/ArgoLogsTool.d.ts.map +1 -0
- package/dist/src/tools/argo/ArgoLogsTool.js +117 -0
- package/dist/src/tools/argo/ArgoLogsTool.js.map +1 -0
- package/dist/src/tools/argo/BaseTool.d.ts +60 -0
- package/dist/src/tools/argo/BaseTool.d.ts.map +1 -0
- package/dist/src/tools/argo/BaseTool.js +51 -0
- package/dist/src/tools/argo/BaseTool.js.map +1 -0
- package/dist/src/tools/argo/index.d.ts +7 -0
- package/dist/src/tools/argo/index.d.ts.map +1 -0
- package/dist/src/tools/argo/index.js +6 -0
- package/dist/src/tools/argo/index.js.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppGetTool.d.ts +10 -0
- package/dist/src/tools/argocd/ArgoCDAppGetTool.d.ts.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppGetTool.js +97 -0
- package/dist/src/tools/argocd/ArgoCDAppGetTool.js.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppHistoryTool.d.ts +10 -0
- package/dist/src/tools/argocd/ArgoCDAppHistoryTool.d.ts.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppHistoryTool.js +80 -0
- package/dist/src/tools/argocd/ArgoCDAppHistoryTool.js.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppListTool.d.ts +10 -0
- package/dist/src/tools/argocd/ArgoCDAppListTool.d.ts.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppListTool.js +128 -0
- package/dist/src/tools/argocd/ArgoCDAppListTool.js.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppLogsTool.d.ts +10 -0
- package/dist/src/tools/argocd/ArgoCDAppLogsTool.d.ts.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppLogsTool.js +143 -0
- package/dist/src/tools/argocd/ArgoCDAppLogsTool.js.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppResourcesTool.d.ts +10 -0
- package/dist/src/tools/argocd/ArgoCDAppResourcesTool.d.ts.map +1 -0
- package/dist/src/tools/argocd/ArgoCDAppResourcesTool.js +123 -0
- package/dist/src/tools/argocd/ArgoCDAppResourcesTool.js.map +1 -0
- package/dist/src/tools/argocd/BaseTool.d.ts +71 -0
- package/dist/src/tools/argocd/BaseTool.d.ts.map +1 -0
- package/dist/src/tools/argocd/BaseTool.js +62 -0
- package/dist/src/tools/argocd/BaseTool.js.map +1 -0
- package/dist/src/tools/argocd/index.d.ts +8 -0
- package/dist/src/tools/argocd/index.d.ts.map +1 -0
- package/dist/src/tools/argocd/index.js +7 -0
- package/dist/src/tools/argocd/index.js.map +1 -0
- package/dist/src/tools/helm/BaseTool.d.ts +51 -0
- package/dist/src/tools/helm/BaseTool.d.ts.map +1 -0
- package/dist/src/tools/helm/BaseTool.js +42 -0
- package/dist/src/tools/helm/BaseTool.js.map +1 -0
- package/dist/src/tools/helm/HelmGetHooksTool.d.ts +10 -0
- package/dist/src/tools/helm/HelmGetHooksTool.d.ts.map +1 -0
- package/dist/src/tools/helm/HelmGetHooksTool.js +38 -0
- package/dist/src/tools/helm/HelmGetHooksTool.js.map +1 -0
- package/dist/src/tools/helm/HelmGetManifestTool.d.ts +10 -0
- package/dist/src/tools/helm/HelmGetManifestTool.d.ts.map +1 -0
- package/dist/src/tools/helm/HelmGetManifestTool.js +38 -0
- package/dist/src/tools/helm/HelmGetManifestTool.js.map +1 -0
- package/dist/src/tools/helm/HelmGetNotesTool.d.ts +10 -0
- package/dist/src/tools/helm/HelmGetNotesTool.d.ts.map +1 -0
- package/dist/src/tools/helm/HelmGetNotesTool.js +38 -0
- package/dist/src/tools/helm/HelmGetNotesTool.js.map +1 -0
- package/dist/src/tools/helm/HelmGetResourcesTool.d.ts +13 -0
- package/dist/src/tools/helm/HelmGetResourcesTool.d.ts.map +1 -0
- package/dist/src/tools/helm/HelmGetResourcesTool.js +124 -0
- package/dist/src/tools/helm/HelmGetResourcesTool.js.map +1 -0
- package/dist/src/tools/helm/HelmGetValuesTool.d.ts +10 -0
- package/dist/src/tools/helm/HelmGetValuesTool.d.ts.map +1 -0
- package/dist/src/tools/helm/HelmGetValuesTool.js +54 -0
- package/dist/src/tools/helm/HelmGetValuesTool.js.map +1 -0
- package/dist/src/tools/helm/HelmHistoryTool.d.ts +10 -0
- package/dist/src/tools/helm/HelmHistoryTool.d.ts.map +1 -0
- package/dist/src/tools/helm/HelmHistoryTool.js +49 -0
- package/dist/src/tools/helm/HelmHistoryTool.js.map +1 -0
- package/dist/src/tools/helm/HelmListTool.d.ts +10 -0
- package/dist/src/tools/helm/HelmListTool.d.ts.map +1 -0
- package/dist/src/tools/helm/HelmListTool.js +107 -0
- package/dist/src/tools/helm/HelmListTool.js.map +1 -0
- package/dist/src/tools/helm/HelmListWithResourcesTool.d.ts +14 -0
- package/dist/src/tools/helm/HelmListWithResourcesTool.d.ts.map +1 -0
- package/dist/src/tools/helm/HelmListWithResourcesTool.js +175 -0
- package/dist/src/tools/helm/HelmListWithResourcesTool.js.map +1 -0
- package/dist/src/tools/helm/HelmStatusTool.d.ts +10 -0
- package/dist/src/tools/helm/HelmStatusTool.d.ts.map +1 -0
- package/dist/src/tools/helm/HelmStatusTool.js +54 -0
- package/dist/src/tools/helm/HelmStatusTool.js.map +1 -0
- package/dist/src/tools/helm/index.d.ts +12 -0
- package/dist/src/tools/helm/index.d.ts.map +1 -0
- package/dist/src/tools/helm/index.js +11 -0
- package/dist/src/tools/helm/index.js.map +1 -0
- package/dist/src/tools/kubernetes/BaseTool.d.ts +48 -0
- package/dist/src/tools/kubernetes/BaseTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/BaseTool.js +55 -0
- package/dist/src/tools/kubernetes/BaseTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetConfigMapTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetConfigMapTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetConfigMapTool.js +28 -0
- package/dist/src/tools/kubernetes/GetConfigMapTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetContainerLogsTool.d.ts +15 -0
- package/dist/src/tools/kubernetes/GetContainerLogsTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetContainerLogsTool.js +119 -0
- package/dist/src/tools/kubernetes/GetContainerLogsTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetDeploymentsTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetDeploymentsTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetDeploymentsTool.js +30 -0
- package/dist/src/tools/kubernetes/GetDeploymentsTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetEventsTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetEventsTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetEventsTool.js +123 -0
- package/dist/src/tools/kubernetes/GetEventsTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetIngressTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetIngressTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetIngressTool.js +35 -0
- package/dist/src/tools/kubernetes/GetIngressTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetMetricsTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetMetricsTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetMetricsTool.js +40 -0
- package/dist/src/tools/kubernetes/GetMetricsTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetNamespacesTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetNamespacesTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetNamespacesTool.js +33 -0
- package/dist/src/tools/kubernetes/GetNamespacesTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetPersistentVolumeClaimsTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetPersistentVolumeClaimsTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetPersistentVolumeClaimsTool.js +92 -0
- package/dist/src/tools/kubernetes/GetPersistentVolumeClaimsTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetPersistentVolumesTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetPersistentVolumesTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetPersistentVolumesTool.js +88 -0
- package/dist/src/tools/kubernetes/GetPersistentVolumesTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetPodMetricsTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetPodMetricsTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetPodMetricsTool.js +100 -0
- package/dist/src/tools/kubernetes/GetPodMetricsTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetPodsTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetPodsTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetPodsTool.js +35 -0
- package/dist/src/tools/kubernetes/GetPodsTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetResourceTool.d.ts +12 -0
- package/dist/src/tools/kubernetes/GetResourceTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetResourceTool.js +79 -0
- package/dist/src/tools/kubernetes/GetResourceTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetSecretsTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetSecretsTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetSecretsTool.js +49 -0
- package/dist/src/tools/kubernetes/GetSecretsTool.js.map +1 -0
- package/dist/src/tools/kubernetes/GetServicesTool.d.ts +11 -0
- package/dist/src/tools/kubernetes/GetServicesTool.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/GetServicesTool.js +35 -0
- package/dist/src/tools/kubernetes/GetServicesTool.js.map +1 -0
- package/dist/src/tools/kubernetes/index.d.ts +17 -0
- package/dist/src/tools/kubernetes/index.d.ts.map +1 -0
- package/dist/src/tools/kubernetes/index.js +16 -0
- package/dist/src/tools/kubernetes/index.js.map +1 -0
- package/dist/src/utils/CliUtils.d.ts +24 -0
- package/dist/src/utils/CliUtils.d.ts.map +1 -0
- package/dist/src/utils/CliUtils.js +159 -0
- package/dist/src/utils/CliUtils.js.map +1 -0
- package/dist/tests/__mocks__/@kubernetes/client-node.d.ts +34 -0
- package/dist/tests/__mocks__/@kubernetes/client-node.d.ts.map +1 -0
- package/dist/tests/__mocks__/@kubernetes/client-node.js +20 -0
- package/dist/tests/__mocks__/@kubernetes/client-node.js.map +1 -0
- package/dist/tests/argo/ArgoGetTool.test.d.ts +2 -0
- package/dist/tests/argo/ArgoGetTool.test.d.ts.map +1 -0
- package/dist/tests/argo/ArgoGetTool.test.js +141 -0
- package/dist/tests/argo/ArgoGetTool.test.js.map +1 -0
- package/dist/tests/helm/BaseTool.test.d.ts +2 -0
- package/dist/tests/helm/BaseTool.test.d.ts.map +1 -0
- package/dist/tests/helm/BaseTool.test.js +241 -0
- package/dist/tests/helm/BaseTool.test.js.map +1 -0
- package/dist/tests/index.test.d.ts +2 -0
- package/dist/tests/index.test.d.ts.map +1 -0
- package/dist/tests/index.test.js +7 -0
- package/dist/tests/index.test.js.map +1 -0
- package/dist/tests/kubernetes/ConfigMapOperations.test.d.ts +2 -0
- package/dist/tests/kubernetes/ConfigMapOperations.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/ConfigMapOperations.test.js +460 -0
- package/dist/tests/kubernetes/ConfigMapOperations.test.js.map +1 -0
- package/dist/tests/kubernetes/ConnectionManager.test.d.ts +2 -0
- package/dist/tests/kubernetes/ConnectionManager.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/ConnectionManager.test.js +97 -0
- package/dist/tests/kubernetes/ConnectionManager.test.js.map +1 -0
- package/dist/tests/kubernetes/ConnectionPool.test.d.ts +2 -0
- package/dist/tests/kubernetes/ConnectionPool.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/ConnectionPool.test.js +328 -0
- package/dist/tests/kubernetes/ConnectionPool.test.js.map +1 -0
- package/dist/tests/kubernetes/DeploymentOperations.test.d.ts +2 -0
- package/dist/tests/kubernetes/DeploymentOperations.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/DeploymentOperations.test.js +196 -0
- package/dist/tests/kubernetes/DeploymentOperations.test.js.map +1 -0
- package/dist/tests/kubernetes/ErrorHandling.test.d.ts +2 -0
- package/dist/tests/kubernetes/ErrorHandling.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/ErrorHandling.test.js +329 -0
- package/dist/tests/kubernetes/ErrorHandling.test.js.map +1 -0
- package/dist/tests/kubernetes/GetPodMetricsTool.test.d.ts +2 -0
- package/dist/tests/kubernetes/GetPodMetricsTool.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/GetPodMetricsTool.test.js +150 -0
- package/dist/tests/kubernetes/GetPodMetricsTool.test.js.map +1 -0
- package/dist/tests/kubernetes/KubernetesClient.test.d.ts +2 -0
- package/dist/tests/kubernetes/KubernetesClient.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/KubernetesClient.test.js +371 -0
- package/dist/tests/kubernetes/KubernetesClient.test.js.map +1 -0
- package/dist/tests/kubernetes/MetricOperations.parsing.test.d.ts +2 -0
- package/dist/tests/kubernetes/MetricOperations.parsing.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/MetricOperations.parsing.test.js +49 -0
- package/dist/tests/kubernetes/MetricOperations.parsing.test.js.map +1 -0
- package/dist/tests/kubernetes/NamespaceOperations.test.d.ts +2 -0
- package/dist/tests/kubernetes/NamespaceOperations.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/NamespaceOperations.test.js +115 -0
- package/dist/tests/kubernetes/NamespaceOperations.test.js.map +1 -0
- package/dist/tests/kubernetes/PodOperations.test.d.ts +2 -0
- package/dist/tests/kubernetes/PodOperations.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/PodOperations.test.js +209 -0
- package/dist/tests/kubernetes/PodOperations.test.js.map +1 -0
- package/dist/tests/kubernetes/RetryStrategy.test.d.ts +2 -0
- package/dist/tests/kubernetes/RetryStrategy.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/RetryStrategy.test.js +419 -0
- package/dist/tests/kubernetes/RetryStrategy.test.js.map +1 -0
- package/dist/tests/kubernetes/ServiceOperations.test.d.ts +2 -0
- package/dist/tests/kubernetes/ServiceOperations.test.d.ts.map +1 -0
- package/dist/tests/kubernetes/ServiceOperations.test.js +159 -0
- package/dist/tests/kubernetes/ServiceOperations.test.js.map +1 -0
- package/dist/tests/plugins/KubernetesToolsPlugin.test.d.ts +2 -0
- package/dist/tests/plugins/KubernetesToolsPlugin.test.d.ts.map +1 -0
- package/dist/tests/plugins/KubernetesToolsPlugin.test.js +153 -0
- package/dist/tests/plugins/KubernetesToolsPlugin.test.js.map +1 -0
- package/dist/tests/server/MCPServer.integration.test.d.ts +2 -0
- package/dist/tests/server/MCPServer.integration.test.d.ts.map +1 -0
- package/dist/tests/server/MCPServer.integration.test.js +244 -0
- package/dist/tests/server/MCPServer.integration.test.js.map +1 -0
- package/dist/tests/server/MCPServer.test.d.ts +2 -0
- package/dist/tests/server/MCPServer.test.d.ts.map +1 -0
- package/dist/tests/server/MCPServer.test.js +257 -0
- package/dist/tests/server/MCPServer.test.js.map +1 -0
- package/package.json +85 -0
- package/src/cli/cli.ts +25 -0
- package/src/cli/run-command.js +391 -0
- package/src/index.ts +46 -0
- package/src/kubernetes/BaseResourceOperations.ts +286 -0
- package/src/kubernetes/CircuitBreaker.ts +485 -0
- package/src/kubernetes/ConnectionManager.ts +114 -0
- package/src/kubernetes/ConnectionPool.ts +551 -0
- package/src/kubernetes/ErrorHandler.ts +436 -0
- package/src/kubernetes/ErrorHandling.ts +401 -0
- package/src/kubernetes/KubernetesClient.ts +500 -0
- package/src/kubernetes/README.md +349 -0
- package/src/kubernetes/ResourceOperations.ts +116 -0
- package/src/kubernetes/RetryStrategy.ts +365 -0
- package/src/kubernetes/RetryableOperation.ts +313 -0
- package/src/kubernetes/docs/ResourceOperations.md +606 -0
- package/src/kubernetes/index.ts +116 -0
- package/src/kubernetes/resources/ConfigMapOperations.ts +367 -0
- package/src/kubernetes/resources/CustomResourceOperations.ts +392 -0
- package/src/kubernetes/resources/DeploymentOperations.ts +294 -0
- package/src/kubernetes/resources/IngressOperations.ts +277 -0
- package/src/kubernetes/resources/MetricOperations.ts +1159 -0
- package/src/kubernetes/resources/NamespaceOperations.ts +129 -0
- package/src/kubernetes/resources/PersistentVolumeClaimOperations.ts +516 -0
- package/src/kubernetes/resources/PersistentVolumeOperations.ts +438 -0
- package/src/kubernetes/resources/PodOperations.ts +417 -0
- package/src/kubernetes/resources/SecretOperations.ts +304 -0
- package/src/kubernetes/resources/ServiceOperations.ts +283 -0
- package/src/kubernetes/utils/ResourceUtils.ts +553 -0
- package/src/plugins/ArgoCDToolsPlugin.ts +189 -0
- package/src/plugins/ArgoToolsPlugin.ts +180 -0
- package/src/plugins/HelmToolsPlugin.ts +180 -0
- package/src/plugins/KubernetesToolsPlugin.ts +198 -0
- package/src/plugins/SamplePlugin.ts +60 -0
- package/src/plugins/index.ts +4 -0
- package/src/server/MCPServer.ts +500 -0
- package/src/tools/argo/ArgoCronListTool.ts +78 -0
- package/src/tools/argo/ArgoGetTool.ts +91 -0
- package/src/tools/argo/ArgoListTool.ts +143 -0
- package/src/tools/argo/ArgoLogsTool.ts +131 -0
- package/src/tools/argo/BaseTool.ts +69 -0
- package/src/tools/argo/index.ts +6 -0
- package/src/tools/argocd/ArgoCDAppGetTool.ts +109 -0
- package/src/tools/argocd/ArgoCDAppHistoryTool.ts +91 -0
- package/src/tools/argocd/ArgoCDAppListTool.ts +144 -0
- package/src/tools/argocd/ArgoCDAppLogsTool.ts +162 -0
- package/src/tools/argocd/ArgoCDAppResourcesTool.ts +139 -0
- package/src/tools/argocd/BaseTool.ts +83 -0
- package/src/tools/argocd/index.ts +7 -0
- package/src/tools/helm/BaseTool.ts +60 -0
- package/src/tools/helm/HelmGetHooksTool.ts +44 -0
- package/src/tools/helm/HelmGetManifestTool.ts +44 -0
- package/src/tools/helm/HelmGetNotesTool.ts +44 -0
- package/src/tools/helm/HelmGetResourcesTool.ts +140 -0
- package/src/tools/helm/HelmGetValuesTool.ts +62 -0
- package/src/tools/helm/HelmHistoryTool.ts +56 -0
- package/src/tools/helm/HelmListTool.ts +107 -0
- package/src/tools/helm/HelmListWithResourcesTool.ts +194 -0
- package/src/tools/helm/HelmStatusTool.ts +62 -0
- package/src/tools/helm/index.ts +11 -0
- package/src/tools/kubernetes/BaseTool.ts +76 -0
- package/src/tools/kubernetes/GetConfigMapTool.ts +33 -0
- package/src/tools/kubernetes/GetContainerLogsTool.ts +140 -0
- package/src/tools/kubernetes/GetDeploymentsTool.ts +33 -0
- package/src/tools/kubernetes/GetEventsTool.ts +133 -0
- package/src/tools/kubernetes/GetIngressTool.ts +39 -0
- package/src/tools/kubernetes/GetMetricsTool.ts +53 -0
- package/src/tools/kubernetes/GetNamespacesTool.ts +36 -0
- package/src/tools/kubernetes/GetPersistentVolumeClaimsTool.ts +113 -0
- package/src/tools/kubernetes/GetPersistentVolumesTool.ts +107 -0
- package/src/tools/kubernetes/GetPodMetricsTool.ts +113 -0
- package/src/tools/kubernetes/GetPodsTool.ts +39 -0
- package/src/tools/kubernetes/GetResourceTool.ts +90 -0
- package/src/tools/kubernetes/GetSecretsTool.ts +55 -0
- package/src/tools/kubernetes/GetServicesTool.ts +39 -0
- package/src/tools/kubernetes/index.ts +16 -0
- package/src/utils/CliUtils.ts +207 -0
- package/tsconfig.json +36 -0
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { execSync, spawn } from 'child_process';
|
|
6
|
+
import fs from 'fs';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
|
|
11
|
+
// Colors for console output
|
|
12
|
+
const colors = {
|
|
13
|
+
green: '\x1b[32m',
|
|
14
|
+
yellow: '\x1b[33m',
|
|
15
|
+
red: '\x1b[31m',
|
|
16
|
+
blue: '\x1b[34m',
|
|
17
|
+
cyan: '\x1b[36m',
|
|
18
|
+
reset: '\x1b[0m'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
class KubeMCPCLI {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.projectRoot = path.resolve(__dirname, '..');
|
|
24
|
+
this.setupScript = path.join(this.projectRoot, 'bin', 'setup.js');
|
|
25
|
+
this.cliScript = path.join(this.projectRoot, 'dist', 'src', 'cli', 'cli.js');
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
log(message, color = colors.reset) {
|
|
29
|
+
console.error(`${color}${message}${colors.reset}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
error(message) {
|
|
33
|
+
console.error(`${colors.red}${message}${colors.reset}`);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
info(message) {
|
|
37
|
+
this.log(message, colors.blue);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
// Check if project is built and build if necessary
|
|
41
|
+
ensureBuild() {
|
|
42
|
+
const distDir = path.join(this.projectRoot, 'dist');
|
|
43
|
+
const indexPathFlat = path.join(distDir, 'index.js');
|
|
44
|
+
const indexPathNested = path.join(distDir, 'src', 'index.js');
|
|
45
|
+
|
|
46
|
+
// Check if project is built
|
|
47
|
+
if (!fs.existsSync(distDir) || (!fs.existsSync(indexPathFlat) && !fs.existsSync(indexPathNested))) {
|
|
48
|
+
this.log('🔧 Building kubeview-mcp...', colors.yellow);
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
// Install dependencies if node_modules doesn't exist
|
|
52
|
+
const nodeModulesPath = path.join(this.projectRoot, 'node_modules');
|
|
53
|
+
if (!fs.existsSync(nodeModulesPath)) {
|
|
54
|
+
this.log('📦 Installing dependencies...', colors.blue);
|
|
55
|
+
execSync('npm install', { cwd: this.projectRoot, stdio: 'inherit' });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// Build the project
|
|
59
|
+
execSync('npm run build', { cwd: this.projectRoot, stdio: 'inherit' });
|
|
60
|
+
this.log('✅ Build completed successfully', colors.green);
|
|
61
|
+
} catch (buildError) {
|
|
62
|
+
this.error('❌ Build failed:');
|
|
63
|
+
console.error(buildError);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Display help information
|
|
70
|
+
displayHelp() {
|
|
71
|
+
this.log('Kube MCP - Kubernetes MCP Server', colors.cyan);
|
|
72
|
+
console.log('\nA Kubernetes MCP server for Claude Desktop and Cursor IDE');
|
|
73
|
+
console.log('\nUsage:');
|
|
74
|
+
console.log(' kubeview-mcp <command> [options]');
|
|
75
|
+
console.log('');
|
|
76
|
+
console.log('Commands:');
|
|
77
|
+
console.log(' setup [target] Setup configuration for Claude Desktop and/or Cursor IDE');
|
|
78
|
+
console.log(' Targets: claude, cursor, both (default)');
|
|
79
|
+
console.log(' serve Start the MCP server (default if no command specified)');
|
|
80
|
+
console.log(' build Build the project');
|
|
81
|
+
console.log(' test Run tests');
|
|
82
|
+
console.log(' lint Run linter');
|
|
83
|
+
console.log(' help Show this help message');
|
|
84
|
+
console.log(' version Show version information');
|
|
85
|
+
console.log('');
|
|
86
|
+
console.log('Setup Examples:');
|
|
87
|
+
console.log(' kubeview-mcp setup # Setup both Claude and Cursor');
|
|
88
|
+
console.log(' kubeview-mcp setup claude # Setup Claude Desktop only');
|
|
89
|
+
console.log(' kubeview-mcp setup cursor # Setup Cursor IDE only');
|
|
90
|
+
console.log('');
|
|
91
|
+
console.log('Server Examples:');
|
|
92
|
+
console.log(' kubeview-mcp # Start MCP server');
|
|
93
|
+
console.log(' kubeview-mcp serve # Start MCP server explicitly');
|
|
94
|
+
console.log('');
|
|
95
|
+
console.log('Development Examples:');
|
|
96
|
+
console.log(' kubeview-mcp build # Build the project');
|
|
97
|
+
console.log(' kubeview-mcp test # Run tests');
|
|
98
|
+
console.log(' kubeview-mcp lint # Run linter');
|
|
99
|
+
console.log('');
|
|
100
|
+
console.log('For more information, visit: https://github.com/your-org/kubeview-mcp');
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Display version information
|
|
104
|
+
displayVersion() {
|
|
105
|
+
try {
|
|
106
|
+
const packageJsonPath = path.join(this.projectRoot, 'package.json');
|
|
107
|
+
const packageContent = fs.readFileSync(packageJsonPath, 'utf8');
|
|
108
|
+
const packageJson = JSON.parse(packageContent);
|
|
109
|
+
this.log(`Kube MCP v${packageJson.version}`, colors.cyan);
|
|
110
|
+
console.log(`Description: ${packageJson.description}`);
|
|
111
|
+
console.log(`License: ${packageJson.license}`);
|
|
112
|
+
console.log(`Node.js: ${process.version}`);
|
|
113
|
+
console.log(`Platform: ${process.platform} ${process.arch}`);
|
|
114
|
+
} catch {
|
|
115
|
+
this.error('Could not read package.json');
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Run setup command
|
|
120
|
+
runSetup(target = 'both') {
|
|
121
|
+
this.info(`Running setup for: ${target}`);
|
|
122
|
+
try {
|
|
123
|
+
const setupProcess = spawn('node', [this.setupScript, target], {
|
|
124
|
+
stdio: 'inherit',
|
|
125
|
+
cwd: this.projectRoot
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
setupProcess.on('close', (code) => {
|
|
129
|
+
if (code === 0) {
|
|
130
|
+
this.log('\n✓ Setup completed successfully', colors.green);
|
|
131
|
+
} else {
|
|
132
|
+
this.error(`Setup failed with exit code ${code}`);
|
|
133
|
+
process.exit(code);
|
|
134
|
+
}
|
|
135
|
+
});
|
|
136
|
+
|
|
137
|
+
setupProcess.on('error', (error) => {
|
|
138
|
+
this.error(`Setup failed: ${error.message}`);
|
|
139
|
+
process.exit(1);
|
|
140
|
+
});
|
|
141
|
+
} catch (error) {
|
|
142
|
+
this.error(`Failed to run setup: ${error.message}`);
|
|
143
|
+
process.exit(1);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Run MCP server using the built index.js file
|
|
148
|
+
async runServer(_args = []) {
|
|
149
|
+
this.ensureBuild();
|
|
150
|
+
|
|
151
|
+
const distDir = path.join(this.projectRoot, 'dist');
|
|
152
|
+
const indexPathFlat = path.join(distDir, 'index.js');
|
|
153
|
+
const indexPathNested = path.join(distDir, 'src', 'index.js');
|
|
154
|
+
|
|
155
|
+
try {
|
|
156
|
+
// Determine the correct index path after build
|
|
157
|
+
const finalIndexPath = fs.existsSync(indexPathFlat) ? indexPathFlat : indexPathNested;
|
|
158
|
+
|
|
159
|
+
// Debug: Check if the file actually exists
|
|
160
|
+
if (!fs.existsSync(finalIndexPath)) {
|
|
161
|
+
this.error(`❌ Built file not found at either location:`);
|
|
162
|
+
this.log(` - Flat: ${indexPathFlat}`, colors.red);
|
|
163
|
+
this.log(` - Nested: ${indexPathNested}`, colors.red);
|
|
164
|
+
|
|
165
|
+
// List what files do exist
|
|
166
|
+
const distContents = fs.existsSync(distDir) ? fs.readdirSync(distDir) : ['dist directory not found'];
|
|
167
|
+
this.log(`📂 Contents of dist/: ${distContents.join(', ')}`, colors.blue);
|
|
168
|
+
|
|
169
|
+
const srcDir = path.join(distDir, 'src');
|
|
170
|
+
if (fs.existsSync(srcDir)) {
|
|
171
|
+
const srcContents = fs.readdirSync(srcDir);
|
|
172
|
+
this.log(`📂 Contents of dist/src/: ${srcContents.join(', ')}`, colors.blue);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
process.exit(1);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
this.log(`🚀 Starting kubeview-mcp from: ${finalIndexPath}`, colors.green);
|
|
179
|
+
const { main } = await import(`file://${finalIndexPath}`);
|
|
180
|
+
await main();
|
|
181
|
+
} catch (runError) {
|
|
182
|
+
this.error('❌ Failed to start kubeview-mcp:');
|
|
183
|
+
console.error(runError);
|
|
184
|
+
process.exit(1);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// Run npm script
|
|
189
|
+
runNpmScript(script, args = []) {
|
|
190
|
+
this.info(`Running: npm run ${script}`);
|
|
191
|
+
try {
|
|
192
|
+
const command = args.length > 0 ? `npm run ${script} -- ${args.join(' ')}` : `npm run ${script}`;
|
|
193
|
+
execSync(command, {
|
|
194
|
+
cwd: this.projectRoot,
|
|
195
|
+
stdio: 'inherit'
|
|
196
|
+
});
|
|
197
|
+
} catch (error) {
|
|
198
|
+
this.error(`Failed to run npm script: ${script}`);
|
|
199
|
+
process.exit(error.status || 1);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// Main command router
|
|
204
|
+
async run() {
|
|
205
|
+
const args = process.argv.slice(2);
|
|
206
|
+
|
|
207
|
+
if (args.length === 0) {
|
|
208
|
+
// Default to running the server
|
|
209
|
+
await this.runServer();
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const command = args[0].toLowerCase();
|
|
214
|
+
const commandArgs = args.slice(1);
|
|
215
|
+
|
|
216
|
+
switch (command) {
|
|
217
|
+
case 'setup':
|
|
218
|
+
this.runSetup(commandArgs[0] || 'both');
|
|
219
|
+
break;
|
|
220
|
+
|
|
221
|
+
case 'serve':
|
|
222
|
+
case 'server':
|
|
223
|
+
case 'start':
|
|
224
|
+
await this.runServer(commandArgs);
|
|
225
|
+
break;
|
|
226
|
+
|
|
227
|
+
case 'build':
|
|
228
|
+
this.runNpmScript('build', commandArgs);
|
|
229
|
+
break;
|
|
230
|
+
|
|
231
|
+
case 'test':
|
|
232
|
+
this.runNpmScript('test', commandArgs);
|
|
233
|
+
break;
|
|
234
|
+
|
|
235
|
+
case 'lint':
|
|
236
|
+
this.runNpmScript('lint', commandArgs);
|
|
237
|
+
break;
|
|
238
|
+
|
|
239
|
+
case 'format':
|
|
240
|
+
this.runNpmScript('format', commandArgs);
|
|
241
|
+
break;
|
|
242
|
+
|
|
243
|
+
case 'typecheck':
|
|
244
|
+
this.runNpmScript('typecheck', commandArgs);
|
|
245
|
+
break;
|
|
246
|
+
|
|
247
|
+
case 'help':
|
|
248
|
+
case '--help':
|
|
249
|
+
case '-h':
|
|
250
|
+
this.displayHelp();
|
|
251
|
+
break;
|
|
252
|
+
|
|
253
|
+
case 'version':
|
|
254
|
+
case '--version':
|
|
255
|
+
case '-v':
|
|
256
|
+
this.displayVersion();
|
|
257
|
+
break;
|
|
258
|
+
|
|
259
|
+
default:
|
|
260
|
+
// For any other command, pass it directly to the MCP CLI
|
|
261
|
+
this.ensureBuild();
|
|
262
|
+
await this.runServer(args);
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
// Run the CLI
|
|
269
|
+
const cli = new KubeMCPCLI();
|
|
270
|
+
cli.run().catch((err) => {
|
|
271
|
+
console.error(`${colors.red}❌ Unexpected error:${colors.reset}`);
|
|
272
|
+
console.error(err);
|
|
273
|
+
process.exit(1);
|
|
274
|
+
});
|
package/bin/setup.js
ADDED
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { fileURLToPath } from 'url';
|
|
6
|
+
import os from 'os';
|
|
7
|
+
|
|
8
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
9
|
+
const __dirname = path.dirname(__filename);
|
|
10
|
+
|
|
11
|
+
// Colors for console output
|
|
12
|
+
const colors = {
|
|
13
|
+
green: '\x1b[32m',
|
|
14
|
+
yellow: '\x1b[33m',
|
|
15
|
+
red: '\x1b[31m',
|
|
16
|
+
blue: '\x1b[34m',
|
|
17
|
+
cyan: '\x1b[36m',
|
|
18
|
+
reset: '\x1b[0m'
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
class SetupManager {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.projectRoot = path.resolve(__dirname, '..');
|
|
24
|
+
this.defaultKubeconfig = path.join(os.homedir(), '.kube', 'config');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
log(message, color = colors.reset) {
|
|
28
|
+
console.log(`${color}${message}${colors.reset}`);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
error(message, error = null) {
|
|
32
|
+
console.error(`${colors.red}${message}${colors.reset}`, error || '');
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
success(message) {
|
|
36
|
+
this.log(`✓ ${message}`, colors.green);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
warning(message) {
|
|
40
|
+
this.log(`⚠️ ${message}`, colors.yellow);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
info(message) {
|
|
44
|
+
this.log(message, colors.blue);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Get platform-specific config path
|
|
48
|
+
getConfigPath(appName, configFileName) {
|
|
49
|
+
const platform = os.platform();
|
|
50
|
+
const home = os.homedir();
|
|
51
|
+
|
|
52
|
+
// Define platform-specific base paths
|
|
53
|
+
const platformPaths = {
|
|
54
|
+
'darwin': {
|
|
55
|
+
'Claude': path.join(home, 'Library', 'Application Support', 'Claude'),
|
|
56
|
+
'Cursor': path.join(home, '.cursor')
|
|
57
|
+
},
|
|
58
|
+
'win32': {
|
|
59
|
+
'Claude': path.join(home, 'AppData', 'Roaming', 'Claude'),
|
|
60
|
+
'Cursor': path.join(home, 'AppData', 'Roaming', 'Cursor')
|
|
61
|
+
},
|
|
62
|
+
'linux': {
|
|
63
|
+
'Claude': path.join(home, '.config', 'Claude'),
|
|
64
|
+
'Cursor': path.join(home, '.cursor')
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
if (!platformPaths[platform]) {
|
|
69
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (!platformPaths[platform][appName]) {
|
|
73
|
+
throw new Error(`Unsupported app: ${appName} on platform: ${platform}`);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return path.join(platformPaths[platform][appName], configFileName);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
// Get Claude Desktop config path
|
|
80
|
+
getClaudeConfigPath() {
|
|
81
|
+
return this.getConfigPath('Claude', 'claude_desktop_config.json');
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Get Cursor config path (global)
|
|
85
|
+
getCursorConfigPath() {
|
|
86
|
+
return this.getConfigPath('Cursor', 'mcp.json');
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Ensure directory exists
|
|
90
|
+
ensureDirectoryExists(dirPath) {
|
|
91
|
+
if (!fs.existsSync(dirPath)) {
|
|
92
|
+
this.log(`Creating directory: ${dirPath}`, colors.yellow);
|
|
93
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
94
|
+
return true;
|
|
95
|
+
}
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// Load or create config file
|
|
100
|
+
loadConfig(configPath) {
|
|
101
|
+
const defaultConfig = { mcpServers: {} };
|
|
102
|
+
|
|
103
|
+
if (fs.existsSync(configPath)) {
|
|
104
|
+
this.log(`Found existing config at ${configPath}, updating...`, colors.yellow);
|
|
105
|
+
try {
|
|
106
|
+
const content = fs.readFileSync(configPath, 'utf8');
|
|
107
|
+
const config = JSON.parse(content);
|
|
108
|
+
|
|
109
|
+
// Ensure mcpServers exists
|
|
110
|
+
if (!config.mcpServers) {
|
|
111
|
+
config.mcpServers = {};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return config;
|
|
115
|
+
} catch (error) {
|
|
116
|
+
this.error(`Error reading existing config at ${configPath}:`, error);
|
|
117
|
+
process.exit(1);
|
|
118
|
+
}
|
|
119
|
+
} else {
|
|
120
|
+
this.log(`Creating new config at ${configPath}...`, colors.yellow);
|
|
121
|
+
return defaultConfig;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Save config file
|
|
126
|
+
saveConfig(configPath, config, indent = 2) {
|
|
127
|
+
try {
|
|
128
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, indent));
|
|
129
|
+
this.success(`Successfully configured kubeview-mcp in ${configPath}`);
|
|
130
|
+
return true;
|
|
131
|
+
} catch (error) {
|
|
132
|
+
this.error(`Error writing config file ${configPath}:`, error);
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Check if kubeconfig exists
|
|
138
|
+
validateKubeconfig(kubeconfigPath) {
|
|
139
|
+
if (!fs.existsSync(kubeconfigPath)) {
|
|
140
|
+
this.warning(`Kubeconfig file not found at ${kubeconfigPath}`);
|
|
141
|
+
this.log(' Make sure your kubeconfig is properly configured.');
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// Create MCP server configuration
|
|
148
|
+
createMcpServerConfig() {
|
|
149
|
+
return {
|
|
150
|
+
command: 'npx',
|
|
151
|
+
args: ['-y', 'https://github.com/mikhae1/kubeview-mcp'],
|
|
152
|
+
env: {
|
|
153
|
+
KUBECONFIG: process.env.KUBECONFIG || this.defaultKubeconfig
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
// Generic setup method for any IDE
|
|
159
|
+
setupIde(ideName, configPathGetter, jsonIndent = 2, showPlatformNotes = false) {
|
|
160
|
+
this.info(`Setting up ${ideName} configuration...`);
|
|
161
|
+
|
|
162
|
+
const configPath = configPathGetter.call(this);
|
|
163
|
+
const configDir = path.dirname(configPath);
|
|
164
|
+
|
|
165
|
+
this.log(`Platform detected: ${os.platform()}`, colors.yellow);
|
|
166
|
+
this.log(`${ideName} config path: ${configPath}`, colors.yellow);
|
|
167
|
+
|
|
168
|
+
// Ensure directory exists
|
|
169
|
+
this.ensureDirectoryExists(configDir);
|
|
170
|
+
|
|
171
|
+
// Load existing config or create new one
|
|
172
|
+
const config = this.loadConfig(configPath);
|
|
173
|
+
|
|
174
|
+
// Add or update kubeview-mcp configuration
|
|
175
|
+
config.mcpServers['kubeview-mcp'] = this.createMcpServerConfig();
|
|
176
|
+
|
|
177
|
+
// Save configuration
|
|
178
|
+
if (this.saveConfig(configPath, config, jsonIndent)) {
|
|
179
|
+
this.displayInfo(ideName, config);
|
|
180
|
+
if (showPlatformNotes) {
|
|
181
|
+
this.displayPlatformNotes(ideName);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
// Setup Claude Desktop
|
|
187
|
+
setupClaude() {
|
|
188
|
+
this.setupIde('Claude Desktop', this.getClaudeConfigPath, 2, true);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Setup Cursor IDE
|
|
192
|
+
setupCursor() {
|
|
193
|
+
this.setupIde('Cursor IDE global', this.getCursorConfigPath, 4, true);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// Generic display configuration info
|
|
197
|
+
displayInfo(ideName, config) {
|
|
198
|
+
const serverConfig = config.mcpServers['kubeview-mcp'];
|
|
199
|
+
|
|
200
|
+
console.log(`\n${ideName} Configuration:`);
|
|
201
|
+
console.log(` Project root: ${this.projectRoot}`);
|
|
202
|
+
console.log(` Entry point: ${serverConfig.args[0]}`);
|
|
203
|
+
console.log(` Kubeconfig: ${serverConfig.env.KUBECONFIG}`);
|
|
204
|
+
|
|
205
|
+
if (serverConfig.env.LOG_LEVEL) {
|
|
206
|
+
console.log(` Log level: ${serverConfig.env.LOG_LEVEL}`);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
this.validateKubeconfig(serverConfig.env.KUBECONFIG);
|
|
210
|
+
|
|
211
|
+
const appName = ideName.split(' ')[0]; // Extract first word for app name
|
|
212
|
+
this.log(`\nNext steps for ${appName}:`, colors.yellow);
|
|
213
|
+
console.log('1. Build the project: npm run build');
|
|
214
|
+
console.log(`2. Restart ${ideName.includes('Desktop') ? 'Claude Desktop application' : 'Cursor IDE'}`);
|
|
215
|
+
console.log('3. Test with: "List all pods in the default namespace"');
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Legacy method for backward compatibility - now uses generic method
|
|
219
|
+
displayClaudeInfo(config) {
|
|
220
|
+
this.displayInfo('Claude Desktop', config);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Legacy method for backward compatibility - now uses generic method
|
|
224
|
+
displayCursorInfo(config) {
|
|
225
|
+
this.displayInfo('Cursor IDE Global', config);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
// Generic platform-specific notes display
|
|
229
|
+
displayPlatformNotes(ideName) {
|
|
230
|
+
const appName = ideName.split(' ')[0].toLowerCase(); // Extract first word and make lowercase
|
|
231
|
+
const title = appName === 'claude' ? 'Platform-specific notes:' : `Platform-specific notes for ${ideName}:`;
|
|
232
|
+
|
|
233
|
+
this.log(`\n${title}`, colors.blue);
|
|
234
|
+
|
|
235
|
+
const platform = os.platform();
|
|
236
|
+
const platformMessages = this.getPlatformMessages(appName, platform);
|
|
237
|
+
|
|
238
|
+
platformMessages.forEach(message => console.log(`• ${message}`));
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// Get platform-specific messages for different apps
|
|
242
|
+
getPlatformMessages(appName, platform) {
|
|
243
|
+
const messages = {
|
|
244
|
+
claude: {
|
|
245
|
+
darwin: [
|
|
246
|
+
'On macOS, make sure Claude Desktop is downloaded from the official website',
|
|
247
|
+
'You may need to grant permissions for Claude to access your files'
|
|
248
|
+
],
|
|
249
|
+
win32: [
|
|
250
|
+
'On Windows, ensure Claude Desktop has proper permissions',
|
|
251
|
+
'You may need to run as administrator for the first setup'
|
|
252
|
+
],
|
|
253
|
+
linux: [
|
|
254
|
+
'On Linux, ensure the .config directory has proper permissions',
|
|
255
|
+
'Some distributions may require additional setup steps'
|
|
256
|
+
]
|
|
257
|
+
},
|
|
258
|
+
cursor: {
|
|
259
|
+
darwin: [
|
|
260
|
+
'Global configuration stored in ~/.cursor/mcp.json',
|
|
261
|
+
'Make sure Cursor IDE has proper permissions to access your files',
|
|
262
|
+
'You may need to restart Cursor completely for changes to take effect'
|
|
263
|
+
],
|
|
264
|
+
win32: [
|
|
265
|
+
'Global configuration stored in %APPDATA%/Cursor/mcp.json',
|
|
266
|
+
'Ensure Cursor IDE has proper permissions',
|
|
267
|
+
'You may need to run as administrator for the first setup'
|
|
268
|
+
],
|
|
269
|
+
linux: [
|
|
270
|
+
'Global configuration stored in ~/.cursor/mcp.json',
|
|
271
|
+
'Ensure the .cursor directory has proper permissions',
|
|
272
|
+
'Some distributions may require additional setup steps'
|
|
273
|
+
]
|
|
274
|
+
}
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
return messages[appName]?.[platform] || [`Generic setup notes for ${appName} on ${platform}`];
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
// Legacy method for backward compatibility
|
|
281
|
+
displayClaudePlatformNotes() {
|
|
282
|
+
this.displayPlatformNotes('Claude Desktop');
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
// Legacy method for backward compatibility
|
|
286
|
+
displayCursorPlatformNotes() {
|
|
287
|
+
this.displayPlatformNotes('Cursor IDE');
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
// Display usage help
|
|
291
|
+
displayHelp() {
|
|
292
|
+
this.log('Kube MCP Setup Tool', colors.blue);
|
|
293
|
+
console.log('\nUsage:');
|
|
294
|
+
console.log(' npm start setup [target]');
|
|
295
|
+
console.log(' node bin/setup.js [target]');
|
|
296
|
+
console.log('\nTargets:');
|
|
297
|
+
console.log(' claude - Setup Claude Desktop configuration');
|
|
298
|
+
console.log(' cursor - Setup Cursor IDE configuration');
|
|
299
|
+
console.log(' both - Setup both Claude and Cursor (default)');
|
|
300
|
+
console.log(' help - Show this help message');
|
|
301
|
+
console.log('\nExamples:');
|
|
302
|
+
console.log(' npm start setup claude');
|
|
303
|
+
console.log(' npm start setup cursor');
|
|
304
|
+
console.log(' npm start setup both');
|
|
305
|
+
console.log(' npm start setup');
|
|
306
|
+
|
|
307
|
+
console.log('\nZero-install via npx:\n');
|
|
308
|
+
console.log('npx https://github.com/mikhae1/kubeview-mcp\n');
|
|
309
|
+
console.log('Add the following to your mcp.json (e.g. ~/.cursor/mcp.json):\n');
|
|
310
|
+
console.log(`{
|
|
311
|
+
"mcpServers": {
|
|
312
|
+
"kubeview-mcp": {
|
|
313
|
+
"command": "npx",
|
|
314
|
+
"args": ["https://github.com/mikhae1/kubeview-mcp"],
|
|
315
|
+
"env": {
|
|
316
|
+
"KUBECONFIG": "$HOME/.kube/config"
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}`);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
// Main setup method
|
|
324
|
+
run(target = 'both') {
|
|
325
|
+
this.log(`Kube MCP Setup Tool`, colors.cyan);
|
|
326
|
+
console.log();
|
|
327
|
+
|
|
328
|
+
switch (target.toLowerCase()) {
|
|
329
|
+
case 'claude':
|
|
330
|
+
this.setupClaude();
|
|
331
|
+
break;
|
|
332
|
+
case 'cursor':
|
|
333
|
+
this.setupCursor();
|
|
334
|
+
break;
|
|
335
|
+
case 'both':
|
|
336
|
+
this.setupClaude();
|
|
337
|
+
console.log('\n' + '='.repeat(50) + '\n');
|
|
338
|
+
this.setupCursor();
|
|
339
|
+
break;
|
|
340
|
+
case 'help':
|
|
341
|
+
case '--help':
|
|
342
|
+
case '-h':
|
|
343
|
+
this.displayHelp();
|
|
344
|
+
break;
|
|
345
|
+
default:
|
|
346
|
+
this.error(`Unknown target: ${target}`);
|
|
347
|
+
this.displayHelp();
|
|
348
|
+
process.exit(1);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
// Parse command line arguments
|
|
354
|
+
const args = process.argv.slice(2);
|
|
355
|
+
let target = 'both';
|
|
356
|
+
|
|
357
|
+
if (args.length > 0) {
|
|
358
|
+
// Handle both "setup claude" and just "claude" formats
|
|
359
|
+
if (args[0] === 'setup' && args[1]) {
|
|
360
|
+
target = args[1];
|
|
361
|
+
} else {
|
|
362
|
+
target = args[0];
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
// Run setup
|
|
367
|
+
const setup = new SetupManager();
|
|
368
|
+
setup.run(target);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../../../src/cli/cli.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { main } from '../index.js';
|
|
3
|
+
function isMainModule() {
|
|
4
|
+
try {
|
|
5
|
+
// Check if this file is being executed directly
|
|
6
|
+
// This works for both direct execution and npx
|
|
7
|
+
const mainFile = process.argv[1];
|
|
8
|
+
return Boolean(mainFile &&
|
|
9
|
+
(mainFile.endsWith('cli.js') ||
|
|
10
|
+
mainFile.endsWith('cli.ts') ||
|
|
11
|
+
mainFile.includes('kubeview-mcp')));
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
if (isMainModule()) {
|
|
18
|
+
main().catch((error) => {
|
|
19
|
+
console.error('Unhandled error:', error);
|
|
20
|
+
process.exit(1);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/cli/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAEnC,SAAS,YAAY;IACnB,IAAI,CAAC;QACH,gDAAgD;QAChD,+CAA+C;QAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACjC,OAAO,OAAO,CACZ,QAAQ;YACN,CAAC,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAC1B,QAAQ,CAAC,QAAQ,CAAC,QAAQ,CAAC;gBAC3B,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CACvC,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,IAAI,YAAY,EAAE,EAAE,CAAC;IACnB,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACrB,OAAO,CAAC,KAAK,CAAC,kBAAkB,EAAE,KAAK,CAAC,CAAC;QACzC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG;AAQH,eAAO,MAAM,OAAO,UAAU,CAAC;AAE/B,wBAAsB,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CA+B1C"}
|