How the Lens MCP Server works#
Cluster access beyond kubeconfig#
Most Kubernetes MCP servers only work with your local kubeconfig. The Lens MCP Server provides the same cluster access as Lens K8S IDE. If you configure an AWS EKS integration that gives you access to 50 clusters, the MCP server can interact with all of them.
| Cluster source | Description |
|---|---|
| Local kubeconfig | Clusters in your ~/.kube/config |
| AWS EKS integration | Clusters discovered via your AWS account |
| Azure AKS integration | Clusters discovered via your Azure subscription |
| Google GKE integration | Clusters discovered via your Google Cloud projects |
| Lens Teamwork Spaces | Shared clusters from your organization |
Cluster connections#
list-clusters returns every cluster Lens knows, with its connection status. connect-cluster and disconnect-cluster connect Lens to a cluster or disconnect it, the same as opening or disconnecting the cluster in Lens. The kubectl tool connects a cluster by itself when a command targets one that is not connected.
See Kubernetes tools for the tool reference and parameters.
What the server can change#
Your AI tool prepares changes to your cluster, and you decide whether to apply them:
- The
kubectltool runs read-only commands, and refuses commands such asapply,delete, orscale. - The YAML editor, the create-resource editor, and the Helm dialogs apply nothing until you confirm.
- A command typed in a Lens terminal waits for you to press Enter.
Some Lens tools change Lens itself without asking, such as port forwards, cost settings, and hotbar pins. When Let AI tools see and drive Lens is on, your AI tool also clicks and types in Lens. See What changes and what waits for you.
Reliability notes#
- Large responses. Lens cuts a tool response at 64 KB, so that one response does not fill the context of your AI tool. The limit is fixed. A cut response ends with
[OUTPUT TRUNCATED ...]and a hint to narrow the query, such as a namespace or a label selector. Your AI tool reads the hint and runs a narrower query.