home / mcp / kubectl-mcp-server mcp server
A Model Context Protocol (MCP) server for Kubernetes. Install: npx kubectl-mcp-server or pip install kubectl-mcp-server
Configuration
View docs{
"mcpServers": {
"rohitg00-kubectl-mcp-server": {
"command": "npx",
"args": [
"-y",
"kubectl-mcp-server"
],
"env": {
"MCP_DEBUG": "false",
"KUBECONFIG": "$HOME/.kube/config",
"MCP_LOG_FILE": "/var/log/mcp.log",
"MCP_AUTH_ISSUER": "https://idp.example.com",
"MCP_AUTH_ENABLED": "true",
"MCP_AUTH_AUDIENCE": "kubectl-mcp-server",
"MCP_AUTH_JWKS_URI": "https://idp.example.com/.well-known/jwks.json",
"MCP_BROWSER_ENABLED": "false",
"MCP_AUTH_REQUIRED_SCOPES": "mcp:tools"
}
}
}
}You can control and automate your Kubernetes infrastructure through natural language conversations with an AI assistant using kubectl-mcp-server. This server translates your spoken or typed requests into kubectl actions, enabling pod debugging, deployments, cost optimization, security audits, Helm operations, and dashboards without memorizing commands.
You interact with a compatible AI assistant to manage clusters. Start conversations like: ask why a pod is crashing, deploy a service, optimize costs, audit security, or view dashboards. The MCP server handles translating your natural language requests into Kubernetes operations, returning results, metrics, and actionable guidance.
Choose a convenient way to run the MCP server on your machine or in your environment. You can run directly without installation or install a runtime locally.
# Quick Start with npx (Zero Install)
# Run directly without installation - works instantly!
npx -y kubectl-mcp-server
# Or install globally for faster startup
npm install -g kubectl-mcp-server
# Or install with pip (Python)
# Standard installation
pip install kubectl-mcp-server
# With interactive UI dashboards (recommended)
pip install kubectl-mcp-server[ui]Prerequisites you will need before running the MCP server: Node.js 14+ for npx usage, Python 3.9+ for pip usage, and kubectl installed and configured to access your Kubernetes cluster.
# Prerequisites check
kubectl cluster-info
python --version
node --version
npm --versionList and retrieve pod information, logs, and health status across namespaces.
Fetch and display pod logs with filtering and search capabilities.
Retrieve events for one or more pods to diagnose issues.
Assess pod health and readiness with actionable diagnostics.
Execute commands inside a running container within a pod.
Clean up terminated or unused pods to reclaim resources.
Query and explain current pod conditions and statuses.
Access previous container logs for crash analysis.
List deployments and their statuses across namespaces.
Create a new deployment with recommended defaults.
Scale a deployment to the desired number of replicas.
Manage Kubernetes rollouts for deployments.
Restart a deployment to trigger a fresh rollout.
List StatefulSets and their pod statuses.
List DaemonSets and their pod statuses.
List Jobs and their completion status.
List ReplicaSets and their scale information.
List services and their endpoints.
Retrieve Ingress resources and routing details.
Show endpoints for services.
Diagnose network reachability across cluster components.
Verify DNS resolution for services and pods.
Trace a service call path from ingress to pods.
List Persistent Volumes and their status.
List Persistent Volume Claims and usage.
Show available storage classes and defaults.
Retrieve Kubernetes ConfigMaps and their data (masked when needed).
Retrieve Secrets with data masked for security.
Show resource quotas across namespaces.
Show limit ranges for resource management.
List nodes with health and capacity details.
List all namespaces and their statuses.
Get high-level cluster information.
Show Kubernetes version information.
Perform a cluster health check and summarize results.
Query node resource metrics.
Query pod resource metrics.
List RBAC roles in the cluster.
List cluster roles.
List service accounts across namespaces.
Audit RBAC permissions for potential over-privilege.
Scan secrets for potential leakage or misconfigurations.
Display pod security context and policies.
List admission webhooks and their configurations.
List CustomResourceDefinitions.
List Kubernetes priority classes.
List Helm releases.
Show Helm release status.
Show Helm release history.
Retrieve Helm release values.
Show Helm release manifest.
Show Helm release notes.
Show Helm release hooks.
Show all Helm release details.
Install a Helm chart into a namespace.
Upgrade an existing Helm chart release.
Uninstall a Helm chart release.
Rollback a Helm release to a previous revision.
Run Helm chart tests.
Render Helm templates without installation.
Render and apply Helm templates.
Create a new Helm chart skeleton.
Lint a Helm chart for best practices.
Package a Helm chart for distribution.
Pull a Helm chart from a repository.
List chart dependencies.
Update chart dependencies.
Build chart dependencies.
Show Helm version information.
Show or set Helm environment details.
Show the current kubectl context.
Switch to a different Kubernetes context.
List all available contexts.
List contexts from kubeconfig.
Diagnose crashes with logs and events.
Detect pods stuck in Pending state.
List pods evicted from nodes.
Compare resources across namespaces.
Apply a manifest to a resource.
Create a resource from manifest or inline content.
Describe a resource in detail.
Patch a resource with JSON or strategic merge.
Delete a Kubernetes resource.
Copy files to or from containers.
Back up a resource state.
Add or update labels on a resource.
Add annotations to a resource.
Taint or untaint a node.
Wait for a specific condition on a resource.
List HorizontalPodAutoscalers.
List PodDisruptionBudgets.
Execute generic kubectl operations not covered by other tools.
Explain a Kubernetes resource or field.
List API resources available in the cluster.
Port-forward to a pod for local access.
Show current resource usage across the cluster.
Manage node lifecycle and maintenance tasks.
UI tool to view pod logs with filtering.
UI dashboard showing real-time pod and node status.
UI to view resource YAML with syntax highlighting.
UI overview of cluster health and usage.
UI timeline of events with filters.
Export cluster dashboards as images.
List GitOps-managed apps.
Get details of a GitOps app.
Synchronize GitOps app state.
Show status of a GitOps app.
List GitOps sources.
Get details of a GitOps source.
Detect GitOps engine in use.
List Cert-Manager certificates.
Get a specific certificate.
List Cert-Manager issuers.
Get a specific issuer.
Renew a certificate.
Explain certificate status.
List certificate challenges.
List certificate requests.
Detect certificate issues.
List policy resources (Kyverno/Gatekeeper).
Get a specific policy.
List policy violations.
Explain policy denial decisions.
Audit policy compliance.
Detect policy violations.
List Velero backups.
Get backup details.
Create a Velero backup.
Delete a Velero backup.
List Velero restores.
Create a Velero restore.
Get a Velero restore.
List Velero backup locations.
List Velero backup schedules.
Create a Velero backup schedule.
Detect Velero backups in use.
List KEDA ScaledObjects.
Get a specific ScaledObject.
List KEDA ScaledJobs.
List KEDA TriggerAuth resources.
Get a TriggerAuth resource.
List KEDA HPAs.
Detect KEDA usage.
List Cilium NetworkPolicies.
Get a Cilium policy.
List Cilium endpoints.
List Cilium identities.
List Cilium nodes.
Show Cilium status.
Query Hubble observable flows.
Detect Cilium networking setup.
List Argo Rollouts.
Get rollout details.
Show rollout status.
Promote a rollout.
Abort a rollout.
Retry a rollout.
Restart a rollout.
List analysis runs for Rollouts.
List Flagger canaries.
Get a canary.
Detect rollout state.
List Cluster API clusters.
Get a Cluster API cluster.
List Cluster API machines.
Get a specific machine.
List MachineDeployments.
Scale a MachineDeployment.
List MachineSets.
List MachineHealthChecks.
List ClusterClass resources.
Get kubeconfig for a cluster.
Detect Cluster API usage.
List KubeVirt virtual machines.
Get details of a VM.
Start a VM.
Stop a VM.
Restart a VM.
Pause a VM.
Unpause a VM.
Migrate a VM.
List KubeVirt data sources.
List instance types for VMs.
List data volumes.
Detect KubeVirt presence.
List Istio VirtualServices.
Get a VirtualService.
List DestinationRules.
List Gateways.
List PeerAuthentications.
List AuthorizationPolicies.
Check Istio proxy status.
Analyze Istio configuration.
Check Istio sidecar status.
Detect Istio setup.
Detect vCluster presence.
List vCluster clusters.
Check vCluster status.
Fetch kubeconfig for a vCluster.
Fetch vCluster logs.
Create a vCluster.
Delete a vCluster.
Pause a vCluster.
Resume a vCluster.
Connect to a vCluster.
Disconnect from a vCluster.
Upgrade a vCluster.
Describe a vCluster.
Start vCluster platform.
Detect kind (Kubernetes in Docker) usage.
Show kind version.
List kind clusters.
Get nodes of a kind cluster.
Get kubeconfig for a kind cluster.
Export logs from kind cluster.
Get cluster information for kind.
Show node labels for kind clusters.
Create a new kind cluster.
Delete a kind cluster.
Delete all kind clusters.
Load image into kind cluster.
Load image from archive into kind cluster.
Build node image for kind cluster.
Set kubeconfig for kind.