Get started with Lens MCP Server#
In this guide, you will enable the Lens MCP Server and connect it to an MCP client. This takes about 5 minutes.
Prerequisites#
- A Plus, Pro, or Enterprise subscription plan. For details, see Lens Pricing .
- Lens Desktop installed and running.
- At least one Kubernetes cluster added to Lens Desktop.
- An MCP client installed and configured.
Step 1: Enable the MCP Server#
- Open Lens Desktop.
- Navigate to Settings > App.
- Toggle MCP Server on.
- Verify that the Lens CLI toggle is on. If it is off, toggle it on to add the CLI to your PATH.
Note
On Windows, the Lens CLI is automatically in the PATH. The Lens CLI toggle is required only on macOS and Linux.
Step 2: Configure your MCP client#
Add the following MCP server configuration to your MCP client:
{
"mcpServers": {
"lens": {
"command": "lens",
"args": ["mcp-server"]
}
}
}
Info
The configuration file path and format vary by client. For example, in Claude Code, add the configuration to ~/.claude/settings.json. Some MCP clients also let you add server configurations directly through their interface. Refer to your MCP client's documentation for the supported setup methods.
Note
After adding or modifying the MCP configuration, your MCP client may require a session restart to detect the new server.
Step 3: Verify the connection#
Ping the server#
- Open your MCP client.
- Ask the MCP client to ping the server. For example: "Ping the Lens MCP server."
- Verify that the response is
pong.
Tip
If you do not receive a pong response, restart your MCP client session and confirm that the Lens CLI is in your PATH.
List your clusters#
- Ask the MCP client to list your clusters. For example: "List all Kubernetes clusters in Lens."
- Verify that your clusters appear in the response with their connection status.
Expected output:
[
{
"name": "my-eks-cluster",
"connectionStatus": "disconnected"
},
{
"name": "minikube",
"connectionStatus": "connected"
}
]
Step 4: Run your first command#
Ask your MCP client to retrieve information from one of the clusters listed in Step 3.
Example prompt:
Show me all pods in the default namespace on minikube
The MCP client calls the Lens MCP Server, runs a read-only kubectl get pods command against the specified cluster, and returns the results.
Tip
Replace minikube with the name of any cluster from your Step 3 output.
Completed
You have connected your MCP client to Lens Desktop through the MCP Server. You can now inspect resources, troubleshoot clusters, and query Prometheus metrics using natural language.
Next steps#
- Kubernetes tools reference: All available cluster operations
- Prometheus tools reference: Query metrics, alerts, and targets
- Configure AWS EKS integration: Connect to all your EKS clusters automatically