What it doesBasics
- Four read-only MCP tools: kubectl_get_pod_status, kubectl_deploy_status, kubectl_cluster_health, and kubectl_resource_summary
- Thirty-nine kubectl-compatible CLI commands across configuration, inspection, deployment, debugging, and cluster-operation families
- Structured pod and deployment status
- Cluster health with optional node metrics
- Namespace or cluster-wide resource summaries
- Dynamic resource discovery and three MCP transports
First useBasics
- Confirm the intended cluster context and inspect a workload you are permitted to read.
- Check cluster health before narrowing to a deployment or pod.
- Use the direct CLI for detail beyond the four focused MCP tools.
- Restart the MCP Kubectl server process after kubeconfig, credential, or context changes.
Everyday tasksEveryday use
Diagnose deployment health
An agent must distinguish a workload problem from a cluster-wide problem.
- Call kubectl_cluster_health with include_metrics false using the intended context.
- Call kubectl_deploy_status with an explicit deployment and namespace.
- Call kubectl_get_pod_status for that namespace, then move to CLI detail only when required.
What you getThe agent narrows from cluster state to workload state without parsing a broad terminal table first.
How to check: Cluster, deployment, and pod status results record the diagnostic path.
Verify a local application after scaling
In an owned evaluation namespace, you want to see whether a web application continues serving after moving from one replica to two.
- Confirm the cluster context, namespace, workload identity and original replica count; check available capacity.
- Use the documented CLI scale operation to request two replicas for that evaluation deployment.
- Inspect rollout status and desired, updated, ready and available replicas, then check the application through its actual hostname and HTTPS route.
- Restore the original replica count when the evaluation ends and verify the application again.
What you getYou have checked both the requested replica change and the application response in the local environment.
How to check: Retain before-and-after replica state and the expected application response.
Inventory an unfamiliar namespace
An agent needs a bounded view before deciding which workload to inspect.
- Call kubectl_resource_summary with the namespace and resource_types explicitly set.
- Confirm an unexpected zero with a direct CLI get and authorization check for the same type and namespace.
What you getThe agent scopes subsequent inspection from a compact inventory.
How to check: The structured summary and direct verification output show both the initial signal and confirmation.
Settings to decideAdvanced
- Credentials and context
- KUBECONFIG resolves the first colon-separated path, then ~/.kube/config, then in-cluster credentials. Restart the MCP Kubectl server process after kubeconfig, credential, or context changes.
- Namespace semantics
- Pod and deployment tools default to namespace default. Resource summary without namespace is cluster-wide. Pass namespace explicitly whenever scope matters.
- CLI or MCP surface
- Use kubectl_get_pod_status, kubectl_deploy_status, kubectl_cluster_health, and kubectl_resource_summary for read-only composition. Use the CLI for broader inspection and operator-authorized mutation.
- MCP transport
- stdio is the editor-spawned default. Unix requires an explicit socket path. HTTP defaults to 127.0.0.1:8080. Reserve stdout exclusively for JSON-RPC in stdio mode.
- Environment and output
- KUBECONFIG selects credentials; EDITOR and VISUAL support edit workflows; RUST_LOG controls stderr tracing. CLI output formats are table, wide, json, yaml, and name.
- Compatibility and protection
- The client targets Kubernetes API 1.36 resources and kubectl 1.36.4 behavior. Each MCP call has a fixed 60-second protection timeout, and tool failures are reported in is_error.
- Optional metrics
- kubectl_cluster_health accepts include_metrics. With metrics-server installed, the result adds node_metrics.
CommandsAdvanced
Problems and fixesHelp
Good to knowHelp
- MCP Kubectl is installed separately from the MAIT image.
- The four MCP tools are read-only; apply, delete, drain, taint and exec run through the CLI.
- Your Kubernetes credentials, context, namespace and RBAC set its access.