Purpose
Container-Host-AIops is the member of the AIops-tools family aimed at single-host container environments, with the goal of providing "governed AI operations" capabilities for non-orchestrated container hosts such as Docker Engine, Portainer, and Podman. It does not target cluster orchestrators, hypervisors, storage devices, backup products, or industrial edge scenarios. The project is a community-maintained open-source project under the MIT license, with no affiliation, endorsement, or sponsorship relationship with vendors such as Docker, Inc. or Portainer.io.
Key Capabilities
Three signature analyses:
- Restart-loop root cause analysis: Inspects container restart counts and exit codes, flags containers in crash loops (restart count above threshold, in restarting/dead state, or non-zero exit), and maps exit codes to likely causes and remediation actions (e.g., 137 indicates OOM/SIGKILL, 143 indicates SIGTERM, 139 indicates segmentation fault, 127 indicates entrypoint error, etc.), with log tails attached. Every ranking comes with concrete numbers rather than black-box conclusions.
- Resource pressure analysis: Takes a one-time CPU%/memory% sample for each running container and compares it against configured limits, flags containers that are "near" (at or above the 80% threshold) or "over" the limit, and gives recommendations (raise the limit, set a missing memory limit, scale out).
- Image and volume bloat analysis: Counts dangling images, dangling volumes, and build cache from system/df, and aggregates them into cleanup candidates and reclaimable bytes.
CLI commands:container-host-aiops Provides subcommands such as init, overview, container, image, volume, network, system, stack, pod, analyze, manage, secret, doctor, and mcp.
MCP server: Started via container-host-aiops mcp or container-host-aiops-mcp , with a total of 38 tools (29 read, 9 write), each wrapped in the @governed_tool governance layer.
Connection layer: Docker connects via unix socket or TCP host; Portainer connects via HTTPS with an X-API-Key token and can proxy the Docker API of managed endpoints; Podman connects via rootful/rootless service sockets (auto-detecting $XDG_RUNTIME_DIR/podman/podman.sock, then /run/podman/podman.sock), using the Docker-compatible layer plus native libpod endpoints. Local Docker/Podman sockets require no key; the socket file permissions are the boundary.
Encrypted credentials: Portainer API tokens are stored in encrypted storage ~/.container-host-aiops/secrets.enc(Fernet + scrypt) and are not written to disk in plaintext. Via CONTAINER_HOST_AIOPS_MASTER_PASSWORD Unlock via environment variables (MCP/CI) or interactive prompt (CLI).
Reversibility: Mutating writes first capture the real prior state and record a faithful inverse operation (stop ↔ start; update_container restores the previous CPU/memory limits). Irreversible operations (remove_container, prune_images, prune_volumes, recreate_stack) capture the prior state for auditing but declare no undo.
Safety mechanisms: Every state-changing CLI operation supports --dry-run and requires a second confirmation; every write-type MCP tool accepts a dry_run preview, and cleanup previews list what will be removed along with the reclaimable bytes.
Usage
As a Claude Code plugin: A single install provides both the skill and the MCP server. The MCP server is fetched via uv and pinned to the package version declared by the plugin, so audit lines can be traced back to the code that wrote them. Credentials still need to be configured via container-host-aiops init .
As an OpenClaw plugin: The same bundle is published on ClawHub, and a single install delivers both the skill and its MCP server. After installation, the OpenClaw gateway must be restarted to load the plugin. The MCP server is fetched via uv and pinned to that exact version, so uvx must be in PATH; otherwise the skill will still install but will report "Visible to model: no".
As a CLI or standalone MCP server: Run the MCP server over stdio. Note: exported environment variables can be read by all processes started by that shell and are recorded in shell history; on shared or long-running hosts, prefer interactive prompts, or inject from a secret manager for a single command.
Governance mechanisms
Every operation (MCP and CLI) passes through the @governed_tool governance layer. It only records, it does not authorize:
- Audit: Every call (arguments, result summary, status, duration, risk level, approver/reason provided by the operator) is recorded to
~/.container-host-aiops/audit.db(relocatable viaCONTAINER_HOST_AIOPS_HOME). CLI writes the same rows as the MCP path; there is no unaudited entry point. A real write requires a committed pending audit row; if storage is unavailable, it stops before contacting the platform. Reads and previews can continue with a warning; new audit rows store a result summary rather than the full response. - Runaway protection: As a safety backstop rather than an authorization gate, the same call repeatedly triggered in a tight loop trips a circuit breaker, preventing a stuck agent from consuming unlimited calls/time. Can be disabled via
CONTAINER_HOST_RUNAWAY_MAX=0; an optional hard cap is set viaCONTAINER_HOST_MAX_TOOL_CALLS/CONTAINER_HOST_MAX_TOOL_SECONDS. - Undo records: Reversible writes record an inverse descriptor based on the captured prior state.
- Risk level: A descriptive label on the audit row, derived from risk_level, kept consistent by tests with the [READ]/[WRITE] labels in the documentation; it is only a label, not a gate.
Applicable scenarios and limitations
Applicable scenarios: Daily operations and maintenance of single-host Docker/Portainer/Podman environments, troubleshooting (restart loops, resource pressure, disk bloat), and AI agent operations that require an audit trail.
Limitations:
- The tool does not decide whether a write is allowed; permissions are determined by the connected account or socket permissions; there is no read-only switch, policy file, or approval gate to configure.
- Capability coverage is a curated subset of the Docker Engine + Portainer + Podman (libpod) APIs.
- Verification status: Docker has been verified against a real Docker Engine 27.5.1 daemon (doctor, overview, three analyses, governed stop_container with audit and undo records); the Portainer and Podman API paths have only been verified via simulated tests and have not been run on a real server.
container-host-aiops doctoris the fastest real-time check on any platform. - Some tools depend on specific platforms: list_endpoints / list_stacks / stack_detail require a portainer target; list_compose_stacks is available on docker or podman; list_pods requires a podman target.
Category
This tool belongs to container operations and AI agent governance tools. There is no exact corresponding entry in the existing category table, so it is classified under "Other AI Tools".