K8sGPT (MCP mode)

Kubernetes analyzer; `k8sgpt serve --mcp` exposes its cluster analysis over MCP.

By defaultRead-only
With our presetSame: read-only is built in
Flagsegresssecrets

Labels are provisional (from the project README/docs, checked Oct 27, 2026). Not yet tested in our sandbox.

Read-only switch

MCP.md lists 12 tools: cluster analysis and reads (resources, logs, events) plus add-filters, remove-filters and config, which change K8sGPT's own settings, not the cluster. get-resource can read Secrets. Claude Code: consider denying mcp__k8sgpt__get-resource and mcp__k8sgpt__config.

Preset

Read-onlyThe docs say it only reads, so there's no flag to add. Not sandbox-tested yet.
  • Matched by name only. K8sGPT (MCP mode) is documented as read-only, but a fork or another server with the same name might not be. So Codex still prompts and Claude Code asks.

Claude Code

.mcp.json
{
  "mcpServers": {
    "k8sgpt": {
      "command": "k8sgpt",
      "args": ["serve", "--mcp"]
    }
  }
}
.claude/settings.json
{
  "permissions": {
    "ask": ["mcp__k8sgpt"]
  }
}

ask makes Claude Code prompt before every tool from this server.

Codex

~/.codex/config.toml
# Generated by redpresets.dev on 2026-11-03. Unverified preset. Also use a read-only credential. Not a security guarantee.

[mcp_servers.k8sgpt]
command = "k8sgpt"
args = ["serve", "--mcp"]
default_tools_approval_mode = "prompt"

default_tools_approval_mode = "prompt" asks before every tool call.

Cursor

.cursor/mcp.json
{
  "mcpServers": {
    "k8sgpt": {
      "type": "stdio",
      "command": "k8sgpt",
      "args": ["serve", "--mcp"]
    }
  }
}

Don't add write tools to mcpAllowlist in .cursor/permissions.json. Leave them on approval. Cursor's docs say the allowlist is not a security boundary.

Credential layer

Bind the kubeconfig/service account the agent uses to a read-only ClusterRole (e.g. the built-in view role). view excludes Secrets; do not grant get secrets to agents.

Gotchas

  • K8sGPT can send cluster findings to an LLM backend. Check where data goes (egress).

Facts

Vendor
k8sgpt-ai (CNCF sandbox)
Source
k8sgpt-ai/k8sgpt
License
Apache-2.0
GitHub stars
8.3k
Latest release
v0.4.41 (Oct 21, 2026)
Last push
Oct 27, 2026
Status
Active
Last checked
Oct 27, 2026

Sources

Spotted something wrong? Labels change when vendors change. Suggest a correction

Read-only alternatives in Kubernetes