Kubernetes MCP Server (containers)
Go-native Kubernetes and OpenShift MCP server that talks to the API server directly, no kubectl required.
Labels are provisional (from the project README/docs, checked Nov 3, 2026). Not yet tested in our sandbox.
Read-only switch
Set read_only = true in a TOML file passed with --config. The project moved runtime settings from CLI flags to TOML; old --read-only style flags are documented as replaced.
Preset
- Pins
@0.1.1: the read-only switch needs 0.0.44 or later. - Added
--config /absolute/path/to/kubernetes-mcp-readonly.toml
- Replace
/absolute/path/to/with the real folder. Use an absolute path: a relative path is resolved from the client's working directory, which differs between Claude Code, Codex and Cursor. (Cursor and VS Code can use${workspaceFolder}/kubernetes-mcp-readonly.toml.) - Settings from environment variables and command-line flags beat the config file, so keep
read_onlyout of both. Keep the file in a folder of its own: releases 0.0.56 to 0.0.67 also load a conf.d folder next to it.
Claude Code
{
"mcpServers": {
"kubernetes": {
"command": "npx",
Removed: "args": ["-y", "kubernetes-mcp-server"]
"args": [
"-y", "kubernetes-mcp-server@0.1.1", "--config",
"/absolute/path/to/kubernetes-mcp-readonly.toml"
]
}
}
}Optional third layer: add "deny": ["mcp__kubernetes__<write tool>"] under permissions in .claude/settings.json.
read_only = true
# Optional: hide Secrets from the agent entirely
[[denied_resources]]
group = ""
version = "v1"
kind = "Secret"
Replace /absolute/path/to/ with the folder where you saved the file. Codex and Claude Code don't expand ${workspaceFolder}.
Codex
# Generated by redpresets.dev on 2026-11-03. Unverified preset. Also use a read-only credential. Not a security guarantee.
[mcp_servers.kubernetes]
command = "npx"
Removed: args = ["-y", "kubernetes-mcp-server"]
args = ["-y", "kubernetes-mcp-server@0.1.1", "--config", "/absolute/path/to/kubernetes-mcp-readonly.toml"]
default_tools_approval_mode = "writes"default_tools_approval_mode = "writes" asks before any tool the server does not mark read-only.
read_only = true
# Optional: hide Secrets from the agent entirely
[[denied_resources]]
group = ""
version = "v1"
kind = "Secret"
Replace /absolute/path/to/ with the folder where you saved the file. Codex and Claude Code don't expand ${workspaceFolder}.
Cursor
{
"mcpServers": {
"kubernetes": {
"type": "stdio",
"command": "npx",
Removed: "args": ["-y", "kubernetes-mcp-server"]
"args": [
"-y", "kubernetes-mcp-server@0.1.1", "--config",
"${env:workspaceFolder}/kubernetes-mcp-readonly.toml"
]
}
}
}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.
read_only = true
# Optional: hide Secrets from the agent entirely
[[denied_resources]]
group = ""
version = "v1"
kind = "Secret"
Lines marked + are what we added to the vendor's install command. Struck-through lines marked − are what they replaced; Copy leaves those out.
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
- Exposes pod exec and resource create/delete tools unless read-only is set.
- If you already pass
--config, addread_only = trueto that file instead. - Needs 0.0.44 or later: 0.0.43 and earlier read
--configbut ignoreread_only. We pin one exact release,kubernetes-mcp-server@0.1.1, sonpxcan't reuse an older cached copy. - 0.0.56 to 0.0.67 also load a
conf.dfolder next to the TOML file, and a file there can setread_only = false. On an exact pin below 0.0.68 we add--read-only, which beats it; 0.0.68 and later stop on--read-only, so we drop it there. A range orlatestthat can reach below 0.0.68 is denied until you pin one exact release.
Facts
- Vendor
- containers (Red Hat-led)
- License
- Apache-2.0
- GitHub stars
- 2.2k
- Latest release
- v0.1.1 (Oct 29, 2026)
- Last push
- Nov 3, 2026
- Status
- Active
- Last checked
- Nov 3, 2026
Sources
- Feature list (exec, run, delete) · checked Oct 27, 2026
- Runtime settings are TOML, `read_only`, `denied_resources` · checked Oct 27, 2026
- Container image quay.io/containers/kubernetes_mcp_server · checked Nov 2, 2026
- `read_only` in the TOML config first wired in v0.0.44 (2025-07-02); v0.0.43 StaticConfig has only denied_resources · checked Nov 3, 2026
- v0.0.68 CLI accepts only --version, --config and --config-dir · checked Nov 3, 2026
- Latest release v0.1.1, published 2026-10-29 · checked Nov 3, 2026
Spotted something wrong? Labels change when vendors change. Suggest a correction
Read-only alternatives in Kubernetes
MCP server for Argo CD applications: list, inspect, sync and manage apps.
MCP server shipped with the Flux Operator for GitOps reconciliation, debugging and diffs.
Kubernetes analyzer; k8sgpt serve --mcp exposes its cluster analysis over MCP.