K8s Lens
v0.1.0MCP server for natural-language Kubernetes operations across single or multi-cluster environments.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
health
Check the server health and connectivity to the Kubernetes cluster. Returns the server status, configured context, and default namespace.
get_resources
Query Kubernetes resources with flexible filters. Supports pods, deployments, services, nodes, and more. Filter by namespace, status, labels, or field selectors. Example prompts: 'Show me all pods with status CrashLoopBackOff in namespace staging', 'List all deployments in the default namespace', 'Get nodes with label zone=us-east-1'.
| Parameter | Type | Description |
|---|---|---|
resource_type * | string | Resource type, e.g. 'pods', 'deployments', 'services', 'nodes' |
contexts | array | Kubernetes contexts to query. If empty, uses the default context. |
field_selector | Raw field selector string | |
labels | Label selector as key-value pairs | |
limit | integer | Maximum results to return |
namespace | Namespace to query. Omit for all namespaces. | |
status | Filter by status phase, e.g. 'Running', 'Pending', 'CrashLoopBackOff' |
analyze_pod
Perform deep root-cause analysis on a failing or misbehaving pod. Correlates pod status, recent events, container logs, resource limits, and node conditions to diagnose the issue. Example prompts: 'Why is my-pod failing?', 'Why does my-pod keep restarting?', 'Diagnose pod my-pod in namespace production'.
| Parameter | Type | Description |
|---|---|---|
pod_name * | string | Name of the pod to analyze |
container | Specific container for multi-container pods | |
namespace | Pod namespace | |
tail_lines | integer | Number of log lines to fetch |
compare_deployments
Diff two Kubernetes resources (e.g., Deployments) across namespaces or clusters. Strips volatile metadata (UIDs, resourceVersions, timestamps) and returns a structured diff showing added, removed, and changed fields. Example prompts: 'Diff the nginx deployment between staging and prod', 'Compare the api deployment in dev vs production'.
| Parameter | Type | Description |
|---|---|---|
name * | string | Name of the resource |
namespace_a * | string | Namespace of first resource |
namespace_b * | string | Namespace of second resource |
context_a | Context for first resource | |
context_b | Context for second resource | |
resource_kind | string | Kind of resource to diff |
generate_manifest
Generate best-practice Kubernetes YAML manifests from a natural language description. Supports Deployments, Services, Ingresses, and ConfigMaps. Returns valid, ready-to-apply YAML with sensible defaults for replicas, resource requests, probes, and labels. Example prompts: 'Create a basic nginx deployment with 2 replicas and a LoadBalancer service', 'Generate a Redis deployment with a ClusterIP service on port 6379'.
| Parameter | Type | Description |
|---|---|---|
description * | string | Natural language description of desired resources |
kind | Specific kind: Deployment, Service, Ingress, ConfigMap | |
namespace | Target namespace |
compare_helm_releases
Diff Helm releases across namespaces or clusters. Compares rendered manifests and values to detect drift. Example prompts: 'Diff the nginx Helm release between staging and prod', 'Compare the api release values in dev vs production'.
| Parameter | Type | Description |
|---|---|---|
namespace_a * | string | Namespace of first release |
namespace_b * | string | Namespace of second release |
release_name * | string | Name of the Helm release to compare |
context_a | Context for first release | |
context_b | Context for second release |
advise_resources
Scan the cluster for resource optimization opportunities. Identifies idle pods, over-provisioned CPU/memory, missing HPAs, and orphaned PVCs. Example prompts: 'Find waste in the cluster', 'Which pods are over-provisioned?', 'Show me idle resources'.
| Parameter | Type | Description |
|---|---|---|
namespace | Namespace to scope to. Omit for all namespaces. |