---
title: "Built-in Lens MCP Server for Any AI Assistant | Lens K8S IDE — Lens"
description: "The built-in Lens MCP Server gives Claude, Cursor, Windsurf or ChatGPT read-only access to every cluster in Lens: EKS, AKS, Teamwork spaces and local kubeconfigs."
url: https://lenshq.io/use-cases/lens-mcp-server/
---

Lens MCP Server

# Your Kubernetes MCP cannot see your clusters on EKS or Azure?

Try Lens MCP: every cluster Lens knows, in any MCP client.

[Start your free trial](https://lenshq.io/download/)

![Architecture diagram in three columns. Left: any MCP client, with the marks of Claude, ChatGPT, GitHub Copilot and Windsurf and two example prompts, list all Kubernetes clusters in Lens and connect to my production EKS cluster and check its pods. An animated two-way MCP arrow joins it to the centre: the Lens MCP Server bundled with Lens Desktop, listing its four Kubernetes tools, list-clusters, connect-cluster, disconnect-cluster and read-only kubectl, and its seven Prometheus tools, get-alerts, execute-query, execute-range-query, list-metrics, get-metric-metadata, get-label-values and get-targets, above a red gate stating that delete, apply, patch, scale, drain and cordon are blocked whatever the prompt says. Two-way arrows fan out to the right to the clusters it reaches: Amazon EKS and Azure AKS discovered through the Lens integrations, the local kubeconfig, and Lens Teamwork spaces](https://lenshq.io/images/use-cases/mcp-server.svg)

How Lens resolves it

## Reach, scope and safety other MCP servers do not have

A generic Kubernetes MCP server sees one kubeconfig and runs whatever the model asks. This one sees what Lens sees, lets the assistant pick its clusters, and cannot write.

![AWS](https://lenshq.io/images/brands/aws.svg)

![Azure](https://lenshq.io/images/brands/azure.svg)

![Lens Teamwork](https://lenshq.io/images/brands/lens-k8s-ide.svg)

### Every cluster, not one kubeconfig

One EKS integration with 50 clusters: the assistant reaches all 50. AKS and Teamwork spaces too.

### Eleven MCP tools

list-clusters, connect-cluster, disconnect-cluster and kubectl, plus seven Prometheus tools for alerts, metrics and PromQL.

### Read-only by design

An allow-list in the kubectl tool: get, describe, logs and top run. delete, apply, patch and scale are refused, whatever the prompt says.

Connect from your local AI agent

## Three steps, under five minutes

Lens generates the client configuration for you, pointing at the Lens CLI that ships inside Lens Desktop. Nothing to install separately.

![Claude Code using the Lens MCP Server: the kubectl tool is called with a clusterId and the command array get pods --all-namespaces, finds one pod in ImagePullBackOff, calls kubectl describe pod, and explains that the image tag is a typo for nginx:stable](https://lenshq.io/blog/lens-mcp-server/img-6.webp)

### 1. Turn it on

Preferences, Integrations, AI & Intelligence Integrations: Enable Lens MCP Server.

![Lens K8S IDE](https://lenshq.io/images/brands/lens-k8s-ide.svg)

### 2. Copy the config

Configure your MCP client generates the JSON snippet. Paste it into your client, for example .mcp.json.

![Claude](https://lenshq.io/images/brands/claude.svg)

![ChatGPT](https://lenshq.io/images/brands/openai.svg)

![GitHub Copilot](https://lenshq.io/images/brands/github-copilot.svg)

![Windsurf](https://lenshq.io/images/brands/windsurf.svg)

### 3. Ask your agent

Claude Desktop, Claude Code, Cursor, Windsurf, ChatGPT or any MCP client. Say: list all Kubernetes clusters in Lens.

Four Kubernetes tools

## Pick the clusters, then understand them with AI

Connect and disconnect scope what your assistant sees. kubectl runs get, describe, logs, top, events and the rest of the read-only allow-list; delete, apply, patch and scale are blocked.

### list-clusters

Every cluster Lens knows, with its connection status.

### connect-cluster

Connect by cluster ID. Your assistant scopes itself to it.

### disconnect-cluster

Drop a cluster to filter what the assistant investigates.

### kubectl

Read-only commands against a connected cluster, as an argument array.

Seven Prometheus tools

## Metrics in the same conversation

Through the Lens internal proxy, so the assistant reaches Prometheus wherever the cluster runs.

### prometheus-get-alerts

Firing alerts, for a health check without writing PromQL.

### prometheus-execute-query, -range-query

An instant or range PromQL query, returned as values or time series.

### prometheus-list-metrics

Available metric names, with filtering and pagination.

### prometheus-get-metric-metadata

Type, help text and unit, to know what a metric measures.

### prometheus-get-label-values

Namespaces, pods, jobs and other dimensions before you query.

### prometheus-get-targets

Scrape targets and their status, to diagnose monitoring coverage.

Where the clusters come from

## Beyond your kubeconfig

Configure an AWS EKS or Azure AKS integration in Lens and the MCP server can reach every cluster it discovers, plus the clusters shared with you in Lens Teamwork spaces.

EKS + AKS

clusters discovered through the Lens integrations, no kubeconfig written

[Lens documentation, How it works](https://docs.lenshq.io/k8slens/mcp-server/how-it-works/)

Teamwork

shared clusters from your organization's spaces

[Lens blog, Lens MCP Server](https://lenshq.io/blog/lens-mcp-server/)

Read-only

a poisoned tool description cannot delete anything

[Lens blog, MCP tool poisoning](https://lenshq.io/blog/mcp-security-tool-poisoning-threat-model/)

Free. No payment details needed.

## Try the MCP Server in the Lens 14-day trial

Every premium feature, unlocked for 14 days.

![Amazon Web Services](https://lenshq.io/images/brands/aws.svg)

### AWS EKS

Discover EKS clusters across your AWS accounts.

[Read the docs](https://docs.lenshq.io/k8slens/getting-started/add-clusters/add-aws-eks/)

![Microsoft Azure](https://lenshq.io/images/brands/azure.svg)

### Azure AKS

Discover AKS clusters across your Azure subscriptions.

[Read the docs](https://docs.lenshq.io/k8slens/getting-started/add-clusters/add-azure-aks/)

### Ask AI

Connect your own AI CLI to any Kubernetes object, with live cluster context.

[Read the docs](https://docs.lenshq.io/k8slens/ask-ai/)

### Lens MCP Server

Reach every cluster Lens knows from Claude, Codex or any MCP client.

[Read the docs](https://docs.lenshq.io/k8slens/mcp-server/)

![Argo CD](https://lenshq.io/images/brands/argo.svg)

### Argo CD

Sync and health for every Application, next to its pods.

[Read the docs](https://docs.lenshq.io/k8slens/argo-cd/)

![Flux](https://lenshq.io/images/brands/flux.svg)

### Flux CD

Reconciliation, drift and failures across every Flux resource.

[Read the docs](https://docs.lenshq.io/k8slens/flux-cd/)

### Security Center

Scan the images your cluster runs for CVEs and exposed secrets.

[Read the docs](https://docs.lenshq.io/k8slens/security-center/)

### Hotbar

Quick access to the clusters you open most.

[Read the docs](https://docs.lenshq.io/k8slens/using-lens/hotbar/)

### Advanced editor

Edit a live resource in diff mode, and revert in one click.

[Read the docs](https://docs.lenshq.io/k8slens/using-lens/advanced-editor/)

Download Lens Desktop and create your Lens ID from the app. Your 14 days start there. When the trial ends, your configuration is kept and the features lock until you upgrade.

[See plans](https://lenshq.io/pricing/) [Start your free trial](https://lenshq.io/download/)
