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,45 @@
|
|
|
1
|
+
import { MCPPlugin, MCPServer } from '../server/MCPServer.js';
|
|
2
|
+
/**
|
|
3
|
+
* Plugin that registers Argo tools with the MCP server
|
|
4
|
+
*/
|
|
5
|
+
export declare class ArgoToolsPlugin implements MCPPlugin {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
private commands;
|
|
9
|
+
private logger?;
|
|
10
|
+
private commandMap;
|
|
11
|
+
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* Check if plugin is disabled via environment variable
|
|
14
|
+
*/
|
|
15
|
+
private static isDisabled;
|
|
16
|
+
/**
|
|
17
|
+
* Create the list of all available tool instances
|
|
18
|
+
* This is the single source of truth for all tools in the plugin
|
|
19
|
+
*/
|
|
20
|
+
private static createToolInstances;
|
|
21
|
+
/**
|
|
22
|
+
* Get all command names from the tool instances
|
|
23
|
+
*/
|
|
24
|
+
static getCommandNames(): string[];
|
|
25
|
+
/**
|
|
26
|
+
* Create a Winston logger for CLI usage only if LOG_LEVEL is set
|
|
27
|
+
*/
|
|
28
|
+
private static createLogger;
|
|
29
|
+
/**
|
|
30
|
+
* Static method to directly execute a command from CLI without starting the MCP server
|
|
31
|
+
* @param commandName The name of the command to execute
|
|
32
|
+
* @param params Parameters for the command
|
|
33
|
+
* @returns The result of the command execution
|
|
34
|
+
*/
|
|
35
|
+
static executeCommand(commandName: string, params: Record<string, any>): Promise<any>;
|
|
36
|
+
initialize(server: MCPServer): Promise<void>;
|
|
37
|
+
/**
|
|
38
|
+
* Get a function that executes a specific tool by name
|
|
39
|
+
* @param toolName The name of the tool to execute
|
|
40
|
+
* @returns A function that takes parameters and executes the tool, or undefined if the tool doesn't exist
|
|
41
|
+
*/
|
|
42
|
+
getToolFunction(toolName: string): ((params: any) => Promise<any>) | undefined;
|
|
43
|
+
shutdown(): Promise<void>;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=ArgoToolsPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArgoToolsPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/ArgoToolsPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAW9D;;GAEG;AACH,qBAAa,eAAgB,YAAW,SAAS;IAC/C,IAAI,SAAgB;IACpB,OAAO,SAAW;IAElB,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,MAAM,CAAC,CAAsB;IACrC,OAAO,CAAC,UAAU,CAAwC;;IAI1D;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,UAAU;IAIzB;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAIlC;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM,EAAE;IAIlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAgB3B;;;;;OAKG;WACU,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAoCrF,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAmDlD;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IAYxE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAIhC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import winston from 'winston';
|
|
2
|
+
import { validateArgoCLI, ArgoListTool, ArgoLogsTool, ArgoCronListTool, ArgoGetTool, } from '../tools/argo/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Plugin that registers Argo tools with the MCP server
|
|
5
|
+
*/
|
|
6
|
+
export class ArgoToolsPlugin {
|
|
7
|
+
name = 'argo-tools';
|
|
8
|
+
version = '0.1.0';
|
|
9
|
+
commands = [];
|
|
10
|
+
logger;
|
|
11
|
+
commandMap = new Map();
|
|
12
|
+
constructor() { }
|
|
13
|
+
/**
|
|
14
|
+
* Check if plugin is disabled via environment variable
|
|
15
|
+
*/
|
|
16
|
+
static isDisabled() {
|
|
17
|
+
return process.env.DISABLE_ARGO_PLUGIN === 'true' || process.env.DISABLE_ARGO_PLUGIN === '1';
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create the list of all available tool instances
|
|
21
|
+
* This is the single source of truth for all tools in the plugin
|
|
22
|
+
*/
|
|
23
|
+
static createToolInstances() {
|
|
24
|
+
return [new ArgoListTool(), new ArgoLogsTool(), new ArgoCronListTool(), new ArgoGetTool()];
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get all command names from the tool instances
|
|
28
|
+
*/
|
|
29
|
+
static getCommandNames() {
|
|
30
|
+
return this.createToolInstances().map((tool) => tool.tool.name);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Create a Winston logger for CLI usage only if LOG_LEVEL is set
|
|
34
|
+
*/
|
|
35
|
+
static createLogger() {
|
|
36
|
+
if (!process.env.LOG_LEVEL) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
return winston.createLogger({
|
|
40
|
+
level: process.env.LOG_LEVEL,
|
|
41
|
+
format: winston.format.combine(winston.format.timestamp(), winston.format.json()),
|
|
42
|
+
transports: [
|
|
43
|
+
new winston.transports.Console({
|
|
44
|
+
stderrLevels: ['error', 'warn', 'info', 'verbose', 'debug', 'silly'],
|
|
45
|
+
format: winston.format.combine(winston.format.colorize(), winston.format.simple()),
|
|
46
|
+
}),
|
|
47
|
+
],
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Static method to directly execute a command from CLI without starting the MCP server
|
|
52
|
+
* @param commandName The name of the command to execute
|
|
53
|
+
* @param params Parameters for the command
|
|
54
|
+
* @returns The result of the command execution
|
|
55
|
+
*/
|
|
56
|
+
static async executeCommand(commandName, params) {
|
|
57
|
+
const plugin = new ArgoToolsPlugin();
|
|
58
|
+
// Initialize commands using the centralized method
|
|
59
|
+
plugin.commands = this.createToolInstances();
|
|
60
|
+
// Create map of commands
|
|
61
|
+
for (const command of plugin.commands) {
|
|
62
|
+
plugin.commandMap.set(command.tool.name, command);
|
|
63
|
+
}
|
|
64
|
+
const command = plugin.commandMap.get(commandName);
|
|
65
|
+
if (!command) {
|
|
66
|
+
throw new Error(`Unknown tool: ${commandName}`);
|
|
67
|
+
}
|
|
68
|
+
const logger = this.createLogger();
|
|
69
|
+
if (logger) {
|
|
70
|
+
logger.info(`Executing Argo command: ${commandName}`, { params });
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
// Execute the command
|
|
74
|
+
const result = await command.execute(params);
|
|
75
|
+
if (logger) {
|
|
76
|
+
logger.debug(`Command ${commandName} completed successfully`);
|
|
77
|
+
}
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
if (logger) {
|
|
82
|
+
logger.error(`Command ${commandName} failed`, { error });
|
|
83
|
+
}
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
async initialize(server) {
|
|
88
|
+
this.logger = server.getLogger();
|
|
89
|
+
try {
|
|
90
|
+
// Check if plugin is disabled
|
|
91
|
+
if (ArgoToolsPlugin.isDisabled()) {
|
|
92
|
+
this.logger.info('ArgoToolsPlugin is disabled via environment variable');
|
|
93
|
+
this.commands = [];
|
|
94
|
+
this.commandMap.clear();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
// Validate Argo CLI - only register tools if validation succeeds
|
|
98
|
+
try {
|
|
99
|
+
await validateArgoCLI();
|
|
100
|
+
this.logger.info('Argo CLI validation successful');
|
|
101
|
+
// Initialize commands using the centralized method
|
|
102
|
+
this.commands = ArgoToolsPlugin.createToolInstances();
|
|
103
|
+
// Create a map of command names to command instances
|
|
104
|
+
for (const command of this.commands) {
|
|
105
|
+
this.commandMap.set(command.tool.name, command);
|
|
106
|
+
}
|
|
107
|
+
// Register each command with the server
|
|
108
|
+
for (const command of this.commands) {
|
|
109
|
+
server.registerTool(command.tool, async (params) => {
|
|
110
|
+
return command.execute(params);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
this.logger.info(`ArgoToolsPlugin initialized with ${this.commands.length} tools. Argo CLI ready.`);
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
this.logger.warn('Argo CLI not found. Argo tools will not be registered.', {
|
|
117
|
+
error: error instanceof Error ? error.message : String(error),
|
|
118
|
+
});
|
|
119
|
+
// Don't register any tools if argo CLI is not available
|
|
120
|
+
this.commands = [];
|
|
121
|
+
this.commandMap.clear();
|
|
122
|
+
this.logger.info('ArgoToolsPlugin initialized with 0 tools (Argo CLI not available).');
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch (error) {
|
|
126
|
+
this.logger.error('Failed to initialize ArgoToolsPlugin', error);
|
|
127
|
+
throw error; // Rethrow to allow MCPServer to catch it if needed
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Get a function that executes a specific tool by name
|
|
132
|
+
* @param toolName The name of the tool to execute
|
|
133
|
+
* @returns A function that takes parameters and executes the tool, or undefined if the tool doesn't exist
|
|
134
|
+
*/
|
|
135
|
+
getToolFunction(toolName) {
|
|
136
|
+
const command = this.commandMap.get(toolName);
|
|
137
|
+
if (!command) {
|
|
138
|
+
return undefined;
|
|
139
|
+
}
|
|
140
|
+
return async (params) => {
|
|
141
|
+
return command.execute(params);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
async shutdown() {
|
|
145
|
+
// No specific cleanup needed for Argo CLI operations
|
|
146
|
+
this.logger?.info('ArgoToolsPlugin shutting down...');
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=ArgoToolsPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ArgoToolsPlugin.js","sourceRoot":"","sources":["../../../src/plugins/ArgoToolsPlugin.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAEL,eAAe,EACf,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,WAAW,GACZ,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,OAAO,eAAe;IAC1B,IAAI,GAAG,YAAY,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAEV,QAAQ,GAAmB,EAAE,CAAC;IAC9B,MAAM,CAAuB;IAC7B,UAAU,GAA8B,IAAI,GAAG,EAAE,CAAC;IAE1D,gBAAe,CAAC;IAEhB;;OAEG;IACK,MAAM,CAAC,UAAU;QACvB,OAAO,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,MAAM,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,GAAG,CAAC;IAC/F,CAAC;IAED;;;OAGG;IACK,MAAM,CAAC,mBAAmB;QAChC,OAAO,CAAC,IAAI,YAAY,EAAE,EAAE,IAAI,YAAY,EAAE,EAAE,IAAI,gBAAgB,EAAE,EAAE,IAAI,WAAW,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED;;OAEG;IACH,MAA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,CAAC,CAAC;YACjE,MAAM,KAAK,CAAC,CAAC,mDAAmD;QAClE,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,eAAe,CAAC,QAAgB;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAE9C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,KAAK,EAAE,MAAW,EAAE,EAAE;YAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,qDAAqD;QACrD,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kCAAkC,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { MCPPlugin, MCPServer } from '../server/MCPServer.js';
|
|
2
|
+
/**
|
|
3
|
+
* Plugin that registers Helm tools with the MCP server
|
|
4
|
+
*/
|
|
5
|
+
export declare class HelmToolsPlugin implements MCPPlugin {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
private commands;
|
|
9
|
+
private logger?;
|
|
10
|
+
private commandMap;
|
|
11
|
+
constructor();
|
|
12
|
+
/**
|
|
13
|
+
* Create the list of all available tool instances
|
|
14
|
+
* This is the single source of truth for all tools in the plugin
|
|
15
|
+
*/
|
|
16
|
+
private static createToolInstances;
|
|
17
|
+
/**
|
|
18
|
+
* Get all command names from the tool instances
|
|
19
|
+
*/
|
|
20
|
+
static getCommandNames(): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Create a Winston logger for CLI usage only if LOG_LEVEL is set
|
|
23
|
+
*/
|
|
24
|
+
private static createLogger;
|
|
25
|
+
/**
|
|
26
|
+
* Static method to directly execute a command from CLI without starting the MCP server
|
|
27
|
+
* @param commandName The name of the command to execute
|
|
28
|
+
* @param params Parameters for the command
|
|
29
|
+
* @returns The result of the command execution
|
|
30
|
+
*/
|
|
31
|
+
static executeCommand(commandName: string, params: Record<string, any>): Promise<any>;
|
|
32
|
+
initialize(server: MCPServer): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Get a function that executes a specific tool by name
|
|
35
|
+
* @param toolName The name of the tool to execute
|
|
36
|
+
* @returns A function that takes parameters and executes the tool, or undefined if the tool doesn't exist
|
|
37
|
+
*/
|
|
38
|
+
getToolFunction(toolName: string): ((params: any) => Promise<any>) | undefined;
|
|
39
|
+
shutdown(): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=HelmToolsPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelmToolsPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/HelmToolsPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAgB9D;;GAEG;AACH,qBAAa,eAAgB,YAAW,SAAS;IAC/C,IAAI,SAAgB;IACpB,OAAO,SAAW;IAElB,OAAO,CAAC,QAAQ,CAAsB;IACtC,OAAO,CAAC,MAAM,CAAC,CAAsB;IACrC,OAAO,CAAC,UAAU,CAAwC;;IAI1D;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAclC;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM,EAAE;IAIlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAgB3B;;;;;OAKG;WACU,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;IAoCrF,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IA2ClD;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IAYxE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAIhC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import winston from 'winston';
|
|
2
|
+
import { validateHelmCLI, HelmListTool, HelmGetValuesTool, HelmGetManifestTool, HelmGetNotesTool, HelmGetHooksTool, HelmStatusTool, HelmHistoryTool, HelmGetResourcesTool, HelmListWithResourcesTool, } from '../tools/helm/index.js';
|
|
3
|
+
/**
|
|
4
|
+
* Plugin that registers Helm tools with the MCP server
|
|
5
|
+
*/
|
|
6
|
+
export class HelmToolsPlugin {
|
|
7
|
+
name = 'helm-tools';
|
|
8
|
+
version = '0.1.0';
|
|
9
|
+
commands = [];
|
|
10
|
+
logger;
|
|
11
|
+
commandMap = new Map();
|
|
12
|
+
constructor() { }
|
|
13
|
+
/**
|
|
14
|
+
* Create the list of all available tool instances
|
|
15
|
+
* This is the single source of truth for all tools in the plugin
|
|
16
|
+
*/
|
|
17
|
+
static createToolInstances() {
|
|
18
|
+
return [
|
|
19
|
+
new HelmListTool(),
|
|
20
|
+
new HelmGetValuesTool(),
|
|
21
|
+
new HelmGetManifestTool(),
|
|
22
|
+
new HelmGetNotesTool(),
|
|
23
|
+
new HelmGetHooksTool(),
|
|
24
|
+
new HelmStatusTool(),
|
|
25
|
+
new HelmHistoryTool(),
|
|
26
|
+
new HelmGetResourcesTool(),
|
|
27
|
+
new HelmListWithResourcesTool(),
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get all command names from the tool instances
|
|
32
|
+
*/
|
|
33
|
+
static getCommandNames() {
|
|
34
|
+
return this.createToolInstances().map((tool) => tool.tool.name);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Create a Winston logger for CLI usage only if LOG_LEVEL is set
|
|
38
|
+
*/
|
|
39
|
+
static createLogger() {
|
|
40
|
+
if (!process.env.LOG_LEVEL) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
return winston.createLogger({
|
|
44
|
+
level: process.env.LOG_LEVEL,
|
|
45
|
+
format: winston.format.combine(winston.format.timestamp(), winston.format.json()),
|
|
46
|
+
transports: [
|
|
47
|
+
new winston.transports.Console({
|
|
48
|
+
stderrLevels: ['error', 'warn', 'info', 'verbose', 'debug', 'silly'],
|
|
49
|
+
format: winston.format.combine(winston.format.colorize(), winston.format.simple()),
|
|
50
|
+
}),
|
|
51
|
+
],
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Static method to directly execute a command from CLI without starting the MCP server
|
|
56
|
+
* @param commandName The name of the command to execute
|
|
57
|
+
* @param params Parameters for the command
|
|
58
|
+
* @returns The result of the command execution
|
|
59
|
+
*/
|
|
60
|
+
static async executeCommand(commandName, params) {
|
|
61
|
+
const plugin = new HelmToolsPlugin();
|
|
62
|
+
// Initialize commands using the centralized method
|
|
63
|
+
plugin.commands = this.createToolInstances();
|
|
64
|
+
// Create map of commands
|
|
65
|
+
for (const command of plugin.commands) {
|
|
66
|
+
plugin.commandMap.set(command.tool.name, command);
|
|
67
|
+
}
|
|
68
|
+
const command = plugin.commandMap.get(commandName);
|
|
69
|
+
if (!command) {
|
|
70
|
+
throw new Error(`Unknown tool: ${commandName}`);
|
|
71
|
+
}
|
|
72
|
+
const logger = this.createLogger();
|
|
73
|
+
if (logger) {
|
|
74
|
+
logger.info(`Executing Helm command: ${commandName}`, { params });
|
|
75
|
+
}
|
|
76
|
+
try {
|
|
77
|
+
// Execute the command
|
|
78
|
+
const result = await command.execute(params);
|
|
79
|
+
if (logger) {
|
|
80
|
+
logger.debug(`Command ${commandName} completed successfully`);
|
|
81
|
+
}
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
if (logger) {
|
|
86
|
+
logger.error(`Command ${commandName} failed`, { error });
|
|
87
|
+
}
|
|
88
|
+
throw error;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
async initialize(server) {
|
|
92
|
+
this.logger = server.getLogger();
|
|
93
|
+
try {
|
|
94
|
+
// Validate Helm CLI - only register tools if validation succeeds
|
|
95
|
+
try {
|
|
96
|
+
await validateHelmCLI();
|
|
97
|
+
this.logger.info('Helm CLI validation successful');
|
|
98
|
+
// Initialize commands using the centralized method
|
|
99
|
+
this.commands = HelmToolsPlugin.createToolInstances();
|
|
100
|
+
// Create a map of command names to command instances
|
|
101
|
+
for (const command of this.commands) {
|
|
102
|
+
this.commandMap.set(command.tool.name, command);
|
|
103
|
+
}
|
|
104
|
+
// Register each command with the server
|
|
105
|
+
for (const command of this.commands) {
|
|
106
|
+
server.registerTool(command.tool, async (params) => {
|
|
107
|
+
return command.execute(params);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
this.logger.info(`HelmToolsPlugin initialized with ${this.commands.length} tools. Helm CLI ready.`);
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
this.logger.warn('Helm CLI not found. Helm tools will not be registered.', {
|
|
114
|
+
error: error instanceof Error ? error.message : String(error),
|
|
115
|
+
});
|
|
116
|
+
// Don't register any tools if helm CLI is not available
|
|
117
|
+
this.commands = [];
|
|
118
|
+
this.commandMap.clear();
|
|
119
|
+
this.logger.info('HelmToolsPlugin initialized with 0 tools (Helm CLI not available).');
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
this.logger.error('Failed to initialize HelmToolsPlugin', error);
|
|
124
|
+
throw error; // Rethrow to allow MCPServer to catch it if needed
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Get a function that executes a specific tool by name
|
|
129
|
+
* @param toolName The name of the tool to execute
|
|
130
|
+
* @returns A function that takes parameters and executes the tool, or undefined if the tool doesn't exist
|
|
131
|
+
*/
|
|
132
|
+
getToolFunction(toolName) {
|
|
133
|
+
const command = this.commandMap.get(toolName);
|
|
134
|
+
if (!command) {
|
|
135
|
+
return undefined;
|
|
136
|
+
}
|
|
137
|
+
return async (params) => {
|
|
138
|
+
return command.execute(params);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
async shutdown() {
|
|
142
|
+
// No specific cleanup needed for Helm CLI operations
|
|
143
|
+
this.logger?.info('HelmToolsPlugin shutting down...');
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=HelmToolsPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HelmToolsPlugin.js","sourceRoot":"","sources":["../../../src/plugins/HelmToolsPlugin.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAEL,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,wBAAwB,CAAC;AAEhC;;GAEG;AACH,MAAM,OAAO,eAAe;IAC1B,IAAI,GAAG,YAAY,CAAC;IACpB,OAAO,GAAG,OAAO,CAAC;IAEV,QAAQ,GAAmB,EAAE,CAAC;IAC9B,MAAM,CAAuB;IAC7B,UAAU,GAA8B,IAAI,GAAG,EAAE,CAAC;IAE1D,gBAAe,CAAC;IAEhB;;;OAGG;IACK,MAAM,CAAC,mBAAmB;QAChC,OAAO;YACL,IAAI,YAAY,EAAE;YAClB,IAAI,iBAAiB,EAAE;YACvB,IAAI,mBAAmB,EAAE;YACzB,IAAI,gBAAgB,EAAE;YACtB,IAAI,gBAAgB,EAAE;YACtB,IAAI,cAAc,EAAE;YACpB,IAAI,eAAe,EAAE;YACrB,IAAI,oBAAoB,EAAE;YAC1B,IAAI,yBAAyB,EAAE;SAChC,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,MAAM,CAAC,eAAe;QACpB,OAAO,IAAI,CAAC,mBAAmB,EAAE,CAAC,G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E;YAC3B,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACjC,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,qDAAqD;QACrD,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,kCAAkC,CAAC,CAAC;IACxD,CAAC;CACF"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { MCPPlugin, MCPServer } from '../server/MCPServer.js';
|
|
2
|
+
import { KubernetesClientConfig } from '../kubernetes/KubernetesClient.js';
|
|
3
|
+
/**
|
|
4
|
+
* Plugin that registers Kubernetes tools with the MCP server
|
|
5
|
+
*/
|
|
6
|
+
export declare class KubernetesToolsPlugin implements MCPPlugin {
|
|
7
|
+
private config?;
|
|
8
|
+
name: string;
|
|
9
|
+
version: string;
|
|
10
|
+
private commands;
|
|
11
|
+
private logger?;
|
|
12
|
+
private commandMap;
|
|
13
|
+
constructor(config?: KubernetesClientConfig | undefined);
|
|
14
|
+
/**
|
|
15
|
+
* Create the list of all available tool instances
|
|
16
|
+
* This is the single source of truth for all tools in the plugin
|
|
17
|
+
*/
|
|
18
|
+
private static createToolInstances;
|
|
19
|
+
/**
|
|
20
|
+
* Get all command names from the tool instances
|
|
21
|
+
*/
|
|
22
|
+
static getCommandNames(): string[];
|
|
23
|
+
/**
|
|
24
|
+
* Create a Winston logger for CLI usage only if LOG_LEVEL is set
|
|
25
|
+
*/
|
|
26
|
+
private static createLogger;
|
|
27
|
+
/**
|
|
28
|
+
* Static method to directly execute a command from CLI without starting the MCP server
|
|
29
|
+
* @param commandName The name of the command to execute
|
|
30
|
+
* @param params Parameters for the command
|
|
31
|
+
* @returns The result of the command execution
|
|
32
|
+
*/
|
|
33
|
+
static executeCommand(commandName: string, params: Record<string, any>): Promise<any>;
|
|
34
|
+
private createNewClient;
|
|
35
|
+
initialize(server: MCPServer): Promise<void>;
|
|
36
|
+
/**
|
|
37
|
+
* Get a function that executes a specific tool by name
|
|
38
|
+
* @param toolName The name of the tool to execute
|
|
39
|
+
* @returns A function that takes parameters and executes the tool, or undefined if the tool doesn't exist
|
|
40
|
+
*/
|
|
41
|
+
getToolFunction(toolName: string): ((params: any) => Promise<any>) | undefined;
|
|
42
|
+
shutdown(): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=KubernetesToolsPlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KubernetesToolsPlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/KubernetesToolsPlugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAoB,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAoB7F;;GAEG;AACH,qBAAa,qBAAsB,YAAW,SAAS;IAQzC,OAAO,CAAC,MAAM,CAAC;IAP3B,IAAI,SAAsB;IAC1B,OAAO,SAAW;IAElB,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,MAAM,CAAC,CAAsB;IACrC,OAAO,CAAC,UAAU,CAAoC;gBAElC,MAAM,CAAC,EAAE,sBAAsB,YAAA;IAEnD;;;OAGG;IACH,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAmBlC;;OAEG;IACH,MAAM,CAAC,eAAe,IAAI,MAAM,EAAE;IAIlC;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,YAAY;IAgB3B;;;;;OAKG;WACU,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC;YAoC7E,eAAe;IAmBvB,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IA6BlD;;;;OAIG;IACH,eAAe,CAAC,QAAQ,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC,GAAG,SAAS;IAcxE,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhC"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
// TODO: All commands should be imported from the tools/kubernetes/index.ts file
|
|
2
|
+
import { KubernetesClient } from '../kubernetes/KubernetesClient.js';
|
|
3
|
+
import winston from 'winston';
|
|
4
|
+
import { GetPodsTool, GetPodMetricsTool, GetServicesTool, GetIngressTool, GetDeploymentsTool, GetResourceTool, GetContainerLogsTool, GetEventsTool, GetNamespacesTool, GetMetricsTool, GetConfigMapTool, GetSecretsTool, GetPersistentVolumesTool, GetPersistentVolumeClaimsTool, } from '../tools/kubernetes/index.js';
|
|
5
|
+
/**
|
|
6
|
+
* Plugin that registers Kubernetes tools with the MCP server
|
|
7
|
+
*/
|
|
8
|
+
export class KubernetesToolsPlugin {
|
|
9
|
+
config;
|
|
10
|
+
name = 'kubernetes-tools';
|
|
11
|
+
version = '0.1.0';
|
|
12
|
+
commands = [];
|
|
13
|
+
logger;
|
|
14
|
+
commandMap = new Map();
|
|
15
|
+
constructor(config) {
|
|
16
|
+
this.config = config;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create the list of all available tool instances
|
|
20
|
+
* This is the single source of truth for all tools in the plugin
|
|
21
|
+
*/
|
|
22
|
+
static createToolInstances() {
|
|
23
|
+
return [
|
|
24
|
+
new GetPodsTool(),
|
|
25
|
+
new GetPodMetricsTool(),
|
|
26
|
+
new GetServicesTool(),
|
|
27
|
+
new GetIngressTool(),
|
|
28
|
+
new GetDeploymentsTool(),
|
|
29
|
+
new GetResourceTool(),
|
|
30
|
+
new GetContainerLogsTool(),
|
|
31
|
+
new GetEventsTool(),
|
|
32
|
+
new GetNamespacesTool(),
|
|
33
|
+
new GetMetricsTool(),
|
|
34
|
+
new GetConfigMapTool(),
|
|
35
|
+
new GetSecretsTool(),
|
|
36
|
+
new GetPersistentVolumesTool(),
|
|
37
|
+
new GetPersistentVolumeClaimsTool(),
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get all command names from the tool instances
|
|
42
|
+
*/
|
|
43
|
+
static getCommandNames() {
|
|
44
|
+
return this.createToolInstances().map((tool) => tool.tool.name);
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Create a Winston logger for CLI usage only if LOG_LEVEL is set
|
|
48
|
+
*/
|
|
49
|
+
static createLogger() {
|
|
50
|
+
if (!process.env.LOG_LEVEL) {
|
|
51
|
+
return undefined;
|
|
52
|
+
}
|
|
53
|
+
return winston.createLogger({
|
|
54
|
+
level: process.env.LOG_LEVEL,
|
|
55
|
+
format: winston.format.combine(winston.format.timestamp(), winston.format.json()),
|
|
56
|
+
transports: [
|
|
57
|
+
new winston.transports.Console({
|
|
58
|
+
stderrLevels: ['error', 'warn', 'info', 'verbose', 'debug', 'silly'],
|
|
59
|
+
format: winston.format.combine(winston.format.colorize(), winston.format.simple()),
|
|
60
|
+
}),
|
|
61
|
+
],
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Static method to directly execute a command from CLI without starting the MCP server
|
|
66
|
+
* @param commandName The name of the command to execute
|
|
67
|
+
* @param params Parameters for the command
|
|
68
|
+
* @returns The result of the command execution
|
|
69
|
+
*/
|
|
70
|
+
static async executeCommand(commandName, params) {
|
|
71
|
+
const plugin = new KubernetesToolsPlugin();
|
|
72
|
+
// Initialize commands using the centralized method
|
|
73
|
+
plugin.commands = this.createToolInstances();
|
|
74
|
+
// Create map of commands
|
|
75
|
+
for (const command of plugin.commands) {
|
|
76
|
+
plugin.commandMap.set(command.tool.name, command);
|
|
77
|
+
}
|
|
78
|
+
const command = plugin.commandMap.get(commandName);
|
|
79
|
+
if (!command) {
|
|
80
|
+
throw new Error(`Unknown tool: ${commandName}`);
|
|
81
|
+
}
|
|
82
|
+
const logger = this.createLogger();
|
|
83
|
+
// Initialize Kubernetes client with optional logger
|
|
84
|
+
const client = new KubernetesClient(logger ? { logger } : {});
|
|
85
|
+
// Always refresh the current context to ensure we're using the latest kubeconfig
|
|
86
|
+
await client.refreshCurrentContext();
|
|
87
|
+
const connected = await client.testConnection();
|
|
88
|
+
if (!connected) {
|
|
89
|
+
throw new Error('Failed to connect to Kubernetes cluster');
|
|
90
|
+
}
|
|
91
|
+
try {
|
|
92
|
+
// Execute the command
|
|
93
|
+
return await command.execute(params, client);
|
|
94
|
+
}
|
|
95
|
+
finally {
|
|
96
|
+
// No cleanup needed since connection pooling was removed
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async createNewClient() {
|
|
100
|
+
try {
|
|
101
|
+
const client = new KubernetesClient(this.config);
|
|
102
|
+
// Always refresh the current context to ensure we're using the latest kubeconfig
|
|
103
|
+
await client.refreshCurrentContext();
|
|
104
|
+
const connected = await client.testConnection();
|
|
105
|
+
if (!connected) {
|
|
106
|
+
throw new Error('Failed to connect to Kubernetes cluster');
|
|
107
|
+
}
|
|
108
|
+
this.logger?.info('New Kubernetes client created and connected successfully');
|
|
109
|
+
return client;
|
|
110
|
+
}
|
|
111
|
+
catch (error) {
|
|
112
|
+
this.logger?.error('Failed to create new Kubernetes client', error);
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
async initialize(server) {
|
|
117
|
+
this.logger = server.getLogger();
|
|
118
|
+
try {
|
|
119
|
+
// Initialize commands using the centralized method
|
|
120
|
+
this.commands = KubernetesToolsPlugin.createToolInstances();
|
|
121
|
+
// Create a map of command names to command instances
|
|
122
|
+
for (const command of this.commands) {
|
|
123
|
+
this.commandMap.set(command.tool.name, command);
|
|
124
|
+
}
|
|
125
|
+
// Register each command with the server
|
|
126
|
+
for (const command of this.commands) {
|
|
127
|
+
server.registerTool(command.tool, async (params) => {
|
|
128
|
+
const client = await this.createNewClient();
|
|
129
|
+
return command.execute(params, client);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
this.logger.info(`KubernetesToolsPlugin initialized with ${this.commands.length} tools. Client will connect on first use.`);
|
|
133
|
+
}
|
|
134
|
+
catch (error) {
|
|
135
|
+
this.logger.error('Failed to initialize KubernetesToolsPlugin', error);
|
|
136
|
+
throw error; // Rethrow to allow MCPServer to catch it if needed
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Get a function that executes a specific tool by name
|
|
141
|
+
* @param toolName The name of the tool to execute
|
|
142
|
+
* @returns A function that takes parameters and executes the tool, or undefined if the tool doesn't exist
|
|
143
|
+
*/
|
|
144
|
+
getToolFunction(toolName) {
|
|
145
|
+
const command = this.commandMap.get(toolName);
|
|
146
|
+
if (!command) {
|
|
147
|
+
return undefined;
|
|
148
|
+
}
|
|
149
|
+
return async (params) => {
|
|
150
|
+
const client = await this.createNewClient();
|
|
151
|
+
// Context refresh is already handled in createNewClient()
|
|
152
|
+
return command.execute(params, client);
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
async shutdown() {
|
|
156
|
+
// No need to explicitly close the client as it's handled by the server
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=KubernetesToolsPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"KubernetesToolsPlugin.js","sourceRoot":"","sources":["../../../src/plugins/KubernetesToolsPlugin.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAGhF,OAAO,EAAE,gBAAgB,EAA0B,MAAM,mCAAmC,CAAC;AAC7F,OAAO,OAAO,MAAM,SAAS,CAAC;AAC9B,OAAO,EAEL,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,oBAAoB,EACpB,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,6BAA6B,GAC9B,MAAM,8BAA8B,CAAC;AAEtC;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAQZ;IAPpB,IAAI,GAAG,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AC,QAAQ,EAAE,CAAC;gBACpC,MAAM,CAAC,YAAY,CAAC,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAW,EAAE,EAAE;oBACtD,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;oBAC5C,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBACzC,CAAC,CAAC,CAAC;YACL,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,IAAI,CACd,0CAA0C,IAAI,CAAC,QAAQ,CAAC,MAAM,2CAA2C,CAC1G,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,4CAA4C,EAAE,KAAK,CAAC,CAAC;YACvE,MAAM,KAAK,CAAC,CAAC,mDAAmD;QAClE,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,eAAe,CAAC,QAAgB;QAC9B,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAE9C,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,OAAO,SAAS,CAAC;QACnB,CAAC;QAED,OAAO,KAAK,EAAE,MAAW,EAAE,EAAE;YAC3B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,eAAe,EAAE,CAAC;YAC5C,0DAA0D;YAC1D,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACzC,CAAC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,uEAAuE;IACzE,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MCPPlugin, MCPServer } from '../server/MCPServer.js';
|
|
2
|
+
/**
|
|
3
|
+
* Sample plugin demonstrating how to extend MCP server functionality
|
|
4
|
+
*/
|
|
5
|
+
export declare class SamplePlugin implements MCPPlugin {
|
|
6
|
+
name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
initialize(server: MCPServer): Promise<void>;
|
|
9
|
+
shutdown(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare function createSamplePlugin(): SamplePlugin;
|
|
12
|
+
//# sourceMappingURL=SamplePlugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SamplePlugin.d.ts","sourceRoot":"","sources":["../../../src/plugins/SamplePlugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAG9D;;GAEG;AACH,qBAAa,YAAa,YAAW,SAAS;IAC5C,IAAI,SAAmB;IACvB,OAAO,SAAW;IAEZ,UAAU,CAAC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAwC5C,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;CAIhC;AAGD,wBAAgB,kBAAkB,IAAI,YAAY,CAEjD"}
|