Skip to main content

PlatformOps AI

Read-only, model-agnostic MCP tools and CLI workflows for evidence-grounded platform operations.

PlatformOps AI helps operators investigate Kubernetes workloads without giving an AI model unrestricted infrastructure access. It collects structured evidence from official APIs, applies deterministic diagnosis rules, and returns operator-readable reports with evidence and limitations.

The current release focuses on Kubernetes. The architecture is designed to grow into observability, CI/CD, GitOps, source control, and approval-gated remediation.

Install

pip install platformops-ai

Requirements:

  • Python 3.11+
  • Kubernetes access through kubeconfig or an in-cluster service account

Confirm your Kubernetes context first:

kubectl config current-context
kubectl get nodes

Quick Start

List cluster nodes:

platformops k8s nodes

Investigate a namespace with pod status, events, and bounded log excerpts:

platformops k8s investigate --namespace jenkins --allowed-namespaces jenkins

Generate a deterministic diagnosis report:

platformops diagnose k8s --namespace jenkins --allowed-namespaces jenkins

Use JSON output when you want machine-readable evidence:

platformops --output json diagnose k8s --namespace jenkins --allowed-namespaces jenkins

What It Can Diagnose

v0.2.0 includes deterministic Kubernetes diagnosis rules for:

  • CrashLoopBackOff-style restarts
  • ImagePullBackOff and image pull failures
  • Pending or unschedulable pods
  • readiness failures
  • restarted but currently ready pods
  • empty namespaces
  • policy and provider errors

Example output:

Status: warning
Namespace 'jenkins' needs attention.

Findings
- [warning] jenkins-0 restarted but is currently ready
  jenkins-0 is currently ready (2/2) but has 4 restart(s).

Recommended next actions
- Compare restart timestamps with node restarts, upgrades, or deploys
- Inspect previous logs if the restart is recent or recurring

CLI Reference

Kubernetes inventory:

platformops k8s nodes
platformops k8s namespaces
platformops k8s pods --namespace default

Kubernetes evidence:

platformops k8s pod POD_NAME --namespace default
platformops k8s events --namespace default
platformops k8s events --namespace default --pod POD_NAME
platformops k8s logs POD_NAME --namespace default --tail-lines 100

Kubernetes investigation and diagnosis:

platformops k8s investigate --namespace default --allowed-namespaces default
platformops diagnose k8s --namespace default --allowed-namespaces default

Connection options:

platformops k8s --context my-context nodes
platformops k8s --provider fake nodes
platformops k8s --provider fixture --fixture tests/scenarios/crashloopbackoff.json investigate --namespace platformops-demo

Safety option:

--allowed-namespaces default,jenkins,monitoring

When set, PlatformOps only returns namespace-scoped evidence from the allowed namespaces.

MCP Server

PlatformOps also ships an MCP server:

platformops-mcp-k8s

Example MCP client configuration:

{
  "mcpServers": {
    "platformops-kubernetes": {
      "command": "platformops-mcp-k8s",
      "env": {
        "PLATFORMOPS_K8S_PROVIDER": "api",
        "PLATFORMOPS_K8S_ALLOWED_NAMESPACES": "default,jenkins"
      }
    }
  }
}

Available MCP tools:

  • get_nodes()
  • list_namespaces()
  • list_pods(namespace=None)
  • get_pod(namespace, name)
  • list_events(namespace, pod_name=None)
  • get_pod_logs(namespace, name, container=None, tail_lines=100)
  • investigate_namespace(namespace, tail_lines=50)
  • diagnose_namespace(namespace, tail_lines=80)

The MCP server does not require an LLM API key. It exposes tools and evidence to an MCP-capable host; the host owns model selection.

Configuration

Environment variables:

PLATFORMOPS_K8S_PROVIDER=api
PLATFORMOPS_K8S_ALLOWED_NAMESPACES=default,jenkins
PLATFORMOPS_K8S_CONTEXT=
PLATFORMOPS_K8S_IN_CLUSTER=false

Provider modes:

  • api: use the real Kubernetes API through kubeconfig or in-cluster config
  • fake: use deterministic built-in sample data
  • fixture: use a local JSON fixture file

Security Model

PlatformOps AI is read-only in v0.x.

It does not support:

  • arbitrary shell commands
  • arbitrary kubectl commands
  • create, update, patch, or delete operations
  • automatic restarts, scaling, rollbacks, or deployments

It does support:

  • official Kubernetes API reads
  • namespace allowlists
  • bounded log reads
  • structured evidence envelopes
  • deterministic diagnosis without an LLM

Do not commit kubeconfigs, service-account tokens, .env files, LLM keys, private certificates, or sensitive logs.

Local Development

git clone https://github.com/FAHID-KHAN/platformops-ai.git
cd platformops-ai
python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest

Run with fixture data:

platformops k8s --provider fixture \
  --fixture tests/scenarios/crashloopbackoff.json \
  investigate --namespace platformops-demo \
  --allowed-namespaces platformops-demo

Project Status

Current release: v0.2.1 - Kubernetes Diagnosis

Roadmap:

  • v0.3.0: Prometheus and observability correlation
  • v0.4.0: Jenkins and ArgoCD read-only delivery investigation
  • v0.5.0: orchestrated investigation experiments
  • v1.0.0: approval-gated remediation

Documentation

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

platformops_ai-0.2.1.tar.gz (36.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

platformops_ai-0.2.1-py3-none-any.whl (26.2 kB view details)

Uploaded Python 3

File details

Details for the file platformops_ai-0.2.1.tar.gz.

File metadata

  • Download URL: platformops_ai-0.2.1.tar.gz
  • Upload date:
  • Size: 36.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for platformops_ai-0.2.1.tar.gz
Algorithm Hash digest
SHA256 e67fdbdcf63af0d230ebd2af7f0d28fb7c52c57c1795234806b4ba54c42ae1f3
MD5 0be70c1aae8b82f63f36c87f68d7df63
BLAKE2b-256 4dbf7695bebdd37550ae65d5c57ff7f17ce57d23c2fe88f43724b70356da1225

See more details on using hashes here.

File details

Details for the file platformops_ai-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: platformops_ai-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 26.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for platformops_ai-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fcde8831a819b27f090412cefbec4b693a652d23aef5330344671532de32dcb8
MD5 58d1eed9272c806a0e36f93f568fb566
BLAKE2b-256 d6ed6bd2eba2f00cd1b977a34847d8c95149e02bc6cb7137597efa1529e811d9

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

This release

0.2.1 This release

2 files

0.2.0

2 files

0.1.4

2 files

0.1.3

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page