kube-observer-mcp
Provides read-only Kubernetes inventory tools for listing nodes and pods, including node status, versions, OS/architecture, and pod phase, ready counts, and restart counts.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@kube-observer-mcpshow me the nodes in the cluster"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
kube-observer-mcp
An open-source MCP server providing concise, read-only Kubernetes inventory tools for AI agents.
The first release exposes two typed tools:
list_nodes: node name, Ready condition, Kubernetes version, OS, architecture.list_pods(namespace): pod name, namespace, phase, ready container count, restart count.
It deliberately does not expose arbitrary kubectl, shell execution, Secrets,
container environment, or mutation operations. The default Kubernetes RBAC only
grants get and list on Nodes and Pods.
The multi-stage, lockfile-driven container is about 57 MB, uses the slim Debian
Python runtime, runs as UID 10001, drops Linux capabilities, uses a read-only
root filesystem with a bounded /tmp, and exposes a /health endpoint for
container and Kubernetes probes. The base remains Debian slim because the
Kubernetes and cryptography dependencies have well-tested wheels there; Alpine
could introduce native-build complexity for little practical size gain. GHCR
releases include BuildKit provenance and an SBOM attestation.
Architecture
flowchart LR
Kagent[Kagent Agent] --> Remote[MCP Streamable HTTP]
Remote --> Server[kube-observer-mcp]
Server --> KubeAPI[Kubernetes API]
Server --> Tools[Read-only tool group]
Server --> Prompts[Reusable MCP prompts]
Server --> Resources[Capability resource]Tool groups are registered explicitly in src/kube_observer_mcp/tools/registry.py.
Only read_only is registered by default. Future write-capable groups should
be separate modules, require explicit enablement, and ship with distinct
least-privilege RBAC and tests. MCP prompts provide reusable workflows; they do
not grant permissions.
Related MCP server: mcp-k8s-context-server
Requirements
Python 3.11+
uvDocker for image builds
A Kubernetes cluster for deployment
Local Development
Install dependencies and run tests:
uv sync --extra dev
uv run pytestRun locally against an explicit kubeconfig:
KUBECONFIG=/path/to/kubeconfig uv run kube-observer-mcpThe Streamable HTTP endpoint listens on 0.0.0.0:8000/mcp. Use the official
MCP Inspector or another
MCP client to list and call list_nodes and list_pods. For the homelab, the
private repo's K3d kubeconfig can be supplied without copying it into this repo:
KUBECONFIG=/absolute/path/to/homelab/.kube/noel-lab.yaml uv run kube-observer-mcpFor a local tool check from Python:
uv run python - <<'PY'
import asyncio
from mcp import Client
async def main():
async with Client("http://127.0.0.1:8000/mcp") as client:
print(await client.list_tools())
print(await client.call_tool("list_nodes", {}))
print(await client.call_tool("list_pods", {"namespace": "kagent"}))
asyncio.run(main())
PYThe repository's unit tests use mock Kubernetes objects and require no cluster. The K3d homelab integration check also confirmed that the tools return only the requested summary fields for Nodes and Pods.
Kubernetes Deployment
Images are published to GitHub Container Registry when a version tag is pushed.
The workflow runs tests first and publishes multi-platform linux/amd64 and
linux/arm64 images. From the repository root:
git tag v0.1.0
git push origin v0.1.0The image will be tagged as 0.1.0, 0.1, the commit SHA, and latest. On
first publication, open the package's GitHub settings and set its visibility to
Public if this repository's deployment is meant to be public. Check the image
name in deploy/kubernetes/deployment.yaml before changing it for a fork.
Apply the server namespace, ServiceAccount, and read-only RBAC:
kubectl apply -f deploy/kubernetes/rbac.yaml
kubectl apply -f deploy/kubernetes/deployment.yaml
kubectl rollout status deployment/kube-observer-mcp -n kube-observer-mcpRegister the server and example Agent with Kagent:
kubectl apply -f deploy/kagent/remote-mcp-server.yaml
kubectl apply -f deploy/kagent/agent-homelab-inventory.yamlThe MCP endpoint is a ClusterIP service, not exposed publicly. Keep network access restricted to trusted in-cluster clients. Review the RBAC manifest and cluster boundary before deploying into production.
The Kagent integration manifests live separately in deploy/kagent/. They
register a RemoteMCPServer in Kagent's namespace and provide an example Agent
that selects only list_nodes and list_pods.
Extending The Server
Add new read-only tools in a focused module under
src/kube_observer_mcp/tools/, then explicitly register that module in the
tool-group registry. The create_server(tool_groups=...) factory takes an
explicit group list; main() uses only read_only. Unknown groups fail closed.
Add unit tests for response shape and error handling.
Reusable workflows belong in src/kube_observer_mcp/prompts.py; MCP resources
belong beside server construction and should expose only intentionally public
metadata. Prompts are guidance, not authorization. Kubernetes RBAC remains the
enforcement boundary. Never add a generic command-execution tool. A future
mutation feature must be an explicit separate tool group with separate RBAC,
human approval, tests, and documentation.
The server currently exposes MCP prompt templates as reusable workflows; these are not the same as a model-vendor-specific “Agent Skills” package. A future skills adapter can be added separately without coupling tool authorization to prompt content.
License
MIT. See LICENSE.
This server cannot be deployed
Maintenance
Related MCP Connectors
Provides read access to your GKE and Kubernetes resources.
Provides capabilities that let LLM agents perform a range of infrastructure management tasks.
Discover Frontier inference capabilities and read sanitized usage through read-only tools.
Fail-closed policy guardrails for AI agents running kubectl, terraform, helm, and argocd.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables AI agents to inspect and operate a Kubernetes cluster safely, with read-only mode and namespace allowlist for mutations.102MIT
- FlicenseNot gradedqualityCmaintenanceProvides a read-only interface to Kubernetes clusters, enabling LLMs to list pods, get pod status and logs, fetch deployment manifests, and perform pod health analysis with resource trend tracking.-
- FlicenseNot gradedqualityBmaintenanceProvides read-only Kubernetes cluster operations via MCP, enabling LLMs to query nodes, pods, logs, events, and watch real-time status for troubleshooting.2-
- AlicenseNot gradedqualityCmaintenanceLets AI agents inspect Kubernetes clusters in plain English, exposing read-only tools for pods, deployments, services, events, and logs, with mock and real backend support.MIT