create_namespaceLABSCO SUMMARY
Cluster operations in the language you would use to describe them.
The coverage goes past reading: it will cordon and drain a node, port-forward a service, roll a deployment and apply a manifest — and where it has no specific tool, raw YAML gets you to any resource kind including your own CRDs.
What it is
A Go binary that exposes Kubernetes operations as MCP tools against your current kubectl context. It covers the resource types you touch day to day plus the escape hatch of applying raw YAML, so anything it does not model directly is still reachable.
What you get
- Workloads — pods with log streaming, deployments, jobs and cronjobs: create, list, describe, update, delete
- Networking — services, and ingress with HTTP/HTTPS routing and TLS configuration
- Configuration — configmaps, secrets and namespaces, full create through delete
- Cluster operations — switch, list, rename and delete contexts; list, cordon, uncordon and drain nodes; cluster health with node and pod metrics
- Storage — persistent volumes and claims, plus storage classes
- Security — roles, role bindings, cluster roles, cluster role bindings and service accounts, read-side
- Utilities — port forwarding to pods and services, with sessions you can start, stop and list
- Escape hatches —
apply_yamlanddelete_yamlfor multi-document raw YAML or JSON of any kind including CRDs, custom resource operations, event listing filtered by namespace, type or involved object, andlist_api_resourcesfor API discovery
Requirements
Access to a cluster configured for kubectl — it uses ~/.kube/config and the current context by default, or -kubeconfig and -context to point elsewhere. Install with go install github.com/basebandit/kai/cmd/kai@latest, or pull the multi-arch image cyclon/kai:v1.0.0. Defaults to stdio; -transport also accepts streamable-http and the deprecated sse-legacy, with -sse-addr setting the listen address and -tls-cert/-tls-key enabling HTTPS. -request-timeout caps Kubernetes API calls, default 30s. Running inside the cluster uses -in-cluster and the pod's service account, whose RBAC decides what the tools can actually do — the checked-in kagent example grants cluster-admin and says plainly that it is test-only.
Setup effort
One command — go install github.com/basebandit/kai/cmd/kai@latest
USE CASES
Finding out why something is broken
List the pods, read the logs, and filter the events by the object involved — three steps in one conversation instead of three terminal commands.
Deploying without writing the YAML
Describe the deployment you want and let it create it, or paste a manifest and apply it as-is.
Taking a node out for maintenance
Cordon it, drain it with the daemonset handling you want, and uncordon when the work is done.
Reaching a service from your laptop
Start a port-forward session, use it, then list and stop sessions rather than losing track of background processes.
Auditing who can do what
Read roles, bindings and service accounts to see the permissions actually in effect in a namespace.
Working with your own resource kinds
Discover the API resources and CRDs the cluster exposes, then list, read or delete the custom resources behind them.
102 tools
Listed in project code.
get_namespacelist_namespacesdelete_namespaceupdate_namespacecreate_podlist_podsget_poddelete_podstream_logslist_deploymentsdescribe_deploymentcreate_deploymentget_deploymentupdate_deploymentdelete_deploymentscale_deploymentrollout_status_deploymentrollout_history_deploymentrollout_undo_deploymentrollout_restart_deploymentrollout_pause_deploymentrollout_resume_deploymentlist_servicesget_servicecreate_servicedelete_serviceupdate_servicepatch_servicelist_contextsget_current_contextswitch_contextload_kubeconfigdelete_contextrename_contextdescribe_contextcreate_configmapget_configmaplist_configmapsdelete_configmapupdate_configmapcreate_secretget_secretlist_secretsdelete_secretupdate_secretcreate_jobget_joblist_jobsdelete_jobupdate_jobcreate_cronjobget_cronjoblist_cronjobsdelete_cronjobupdate_cronjobsuspend_cronjobresume_cronjobcreate_ingressget_ingresslist_ingressesupdate_ingressdelete_ingressstart_port_forwardstop_port_forwardlist_port_forwardslist_eventslist_nodesget_nodecordon_nodeuncordon_nodedrain_nodecluster_healthnode_metricspod_metricslist_persistent_volumesget_persistent_volumedelete_persistent_volumecreate_persistent_volume_claimlist_persistent_volume_claimsget_persistent_volume_claimdelete_persistent_volume_claimlist_storage_classesget_storage_classlist_rolesget_rolelist_role_bindingsget_role_bindinglist_cluster_rolesget_cluster_rolelist_cluster_role_bindingsget_cluster_role_bindinglist_service_accountsget_service_accountlist_crdsget_crdlist_custom_resourcesget_custom_resourcedelete_custom_resourcelist_api_resourcesapply_yamldelete_yamlBEFORE YOU INSTALL
What to know first
Tools you get
102 tools registered in the project's code.
Requires
go on PATH
INSTALLATION
Connect your client
Server setup
go install github.com/basebandit/kai/cmd/kai@latestMCP Clients
Claude Desktop, Cursor
{
"mcpServers": {
"kubernetes": {
"command": "<YOUR_PATH_TO_KAI>"
}
}
}Continue
{
"experimental": {
"modelContextProtocolServers": [
{
"transport": {
"type": "stdio",
"command": "<YOUR_PATH_TO_KAI>"
}
}
]
}
}