# k8s AIops [Health: Active]

**Category:** ☁️ Cloud Platforms  
**Repository:** https://github.com/AIops-tools/K8s-AIops  
**GitHub Stars:** 0  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/k8s-aiops

## Description
Governed Kubernetes ops — 15 MCP tools with audit, budget, undo guards.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "k8s-aiops": {
    "command": "uvx",
    "args": ["k8s-aiops"],
    "env": {
      "K8S_AIOPS_CONFIG": "",
      "K8S_AIOPS_HOME": "",
      "K8S_AUDIT_APPROVED_BY": "",
      "K8S_AUDIT_RATIONALE": "",
      "KUBECONFIG": ""
    }
  }
}
```

**Requires environment variables:** `K8S_AIOPS_CONFIG`, `K8S_AIOPS_HOME`, `K8S_AUDIT_APPROVED_BY`, `K8S_AUDIT_RATIONALE`, `KUBECONFIG` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What k8s AIops does

k8s AIops provides Kubernetes operations for AI agents through MCP and a command-line interface. Its coverage includes pods, deployments, statefulsets, daemonsets, replicasets, jobs and cronjobs, services, ingresses, endpoints, configmaps, secrets by names and keys only, persistent volumes and claims, storage classes, nodes, namespaces, events, and rollout actions.

The package also includes cluster health reporting, pod and node descriptions, pod and node resource views, and read-only diagnostics. The pod-health and workload-readiness diagnostics produce root-cause findings ordered from the most serious issue first.

Operations are wrapped by a bundled governance layer. Each call is written to `~/.k8s-aiops/audit.db` by default, with audit data relocatable through `K8S_AIOPS_HOME`. Audit entries include a descriptive risk tier, and destructive operations capture prior state plus an inverse action when one is available.

## How it works

Authentication and authorization remain with Kubernetes. The server uses a selected kubeconfig context, so client certificates, bearer tokens, and EKS, GKE, or AKS exec plugins are handled by the kubeconfig rather than by a separate credential store. Named targets can map friendly names to kubeconfig contexts and optional default namespaces.

The governance layer is a safety and traceability mechanism, not an authorization policy. It does not provide a read-only mode, policy file, or approval gate. Kubernetes RBAC and the connected ServiceAccount determine whether an operation is permitted. A read-only RBAC context causes attempted writes to fail at the API server.

Write tools accept `dry_run=True` and return a preview without changing the cluster or recording an undo action. A runaway budget guard limits excessive activity. Audit rows contain outcome summaries instead of complete API responses, and API text is sanitized by removing control and format characters and applying truncation.

## Setup and configuration

Install the standalone package with `uv tool install k8s-aiops`, then run `k8s-aiops init` to register named kubeconfig targets. The current kubeconfig context can also be used directly with commands such as `k8s-aiops doctor` or `k8s-aiops pod list`.

A configuration file at `~/.k8s-aiops/config.yaml` can define targets with a name, context, optional namespace, and optional alternate kubeconfig path. Credentials are not stored in this file. Start the MCP transport with the `k8s-aiops mcp` command; a typical client configuration passes `K8S_AIOPS_CONFIG` in the server environment.

MCP clients may start servers with a clean environment. Set relevant variables, including `KUBECONFIG` for a non-default kubeconfig location and audit-related settings such as `K8S_AIOPS_HOME`, `K8S_AUDIT_APPROVED_BY`, and `K8S_AUDIT_RATIONALE`, in the client's environment block rather than relying on shell exports.

Claude Code can install the combined skill and MCP server through the AIops-tools marketplace. An OpenClaw plugin is also available; its MCP package is fetched with `uv`, so `uvx` must be available on `PATH`.

## Tools and capabilities

The MCP tool set covers common Kubernetes lifecycle and inspection tasks, including:

- Listing, inspecting, scaling, restarting, and deleting supported workloads.
- Managing services, ingresses, endpoints, configmaps, secrets metadata, storage resources, namespaces, nodes, and events.
- Checking rollout status and history, then undoing, pausing, resuming, or changing an image.
- Describing pods and nodes, viewing pod and node resource usage, and generating a cluster health summary.
- Running read-only pod-health and workload-readiness diagnostics.
- Previewing writes with dry-run responses and retaining audit and undo information for executed changes.

## Limitations and notes

Coverage focuses on common cluster operations and is not exhaustive. End-to-end verification has been performed against a live kind cluster, while the diagnostics and RCA tools have been mock-tested. The project is community-maintained and is not affiliated with or endorsed by Kubernetes, the Cloud Native Computing Foundation, or k3s/Rancher.

k8s AIops does not provide an encrypted secret store and does not save cluster credentials. Secret operations expose names and keys only. Real writes stop before contacting the platform if a required pending audit row cannot be committed; reads and previews can continue with a warning. Risk labels and budget controls do not replace Kubernetes authorization.

_Full upstream README: https://allmcps.com/mcp/k8s-aiops/readme_

