Governed Docker + Portainer container-host ops: reads, RCA analyses, guarded writes. 34 tools.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent — or use 1-click editor setup below.
💡 Paste into ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows)
Disclaimer: Community-maintained open-source project. Not affiliated with, endorsed by, or sponsored by Docker, Inc., Portainer.io, or any container-platform vendor. "Docker", "Portainer" and all product/trademark names belong to their respective owners. MIT licensed.
Governed AI-ops for non-orchestrator container hosts — the Docker Engine API (over a local unix socket or a TCP host), Portainer (its management API, which also proxies Docker), and Podman (a rootful/rootless service socket speaking the Docker-compatible API plus libpod-native endpoints) — with a built-in governance harness: a unified audit log over both MCP and CLI, a runaway/budget safety guard, and undo-token recording. It records every operation; it does not decide whether a write is permitted — that is the agent's or the account's call. Multi-platform by construction: a registry keyed by platform means a per-target platform field (docker / portainer / podman) selects the API shape, and another host family could be added later without touching the ops/CLI/MCP layers. Exercised against a live Docker Engine 27.5.1 daemon (doctor, overview, the three flagship analyses, and a governed stop_container with audit + undo recorded); the Portainer and Podman API paths are covered by the mock suite only.
Three flagship signature analyses, plus the guarded reads and writes around them:
system/df, totalled into prune candidates with reclaimable bytes.container-host-aiops ...): init, overview, container, image, volume, network, system, stack, pod, analyze, manage, secret, doctor, mcp.container-host-aiops mcp or container-host-aiops-mcp): 38 tools (29 read, 9 write), every one wrapped with the bundled @governed_tool harness.httpx.HTTPTransport(uds=...)) or a TCP host; Portainer over HTTPS with an X-API-Key token that also proxies the Docker API of a managed endpoint; Podman over its rootful/rootless service socket (autodetected: $XDG_RUNTIME_DIR/podman/podman.sock first, then /run/podman/podman.sock) speaking the Docker-compat layer (paths reused wholesale) plus libpod-native endpoints. A local Docker/Podman socket needs no secret — the socket's file permissions are the boundary.~/.container-host-aiops/secrets.enc (Fernet + scrypt) — never plaintext on disk. Unlock with a master password from CONTAINER_HOST_AIOPS_MASTER_PASSWORD (MCP/CI) or an interactive prompt (CLI).stop↔start; update_container restores prior CPU/memory limits). Irreversible ops (remove_container, prune_images, prune_volumes, recreate_stack) capture the before-state for audit but declare no undo.--dry-run and requires double confirmation; every write MCP tool takes a dry_run preview — and prune previews list what would be removed + reclaimable bytes before doing it.It delivers container-host operations — reads and writes — accurately and efficiently, and records every one of them. It does not decide whether a write is allowed to happen. That is the agent's judgement, or the permission of the account you connect it with: point it at a Docker socket mounted read-only, or a Portainer account without write scope, and the writes fail at the server — the place that actually owns the permission.
So there is no read-only switch, no policy file, no approval gate to configure.
The one thing the tool guarantees is that nothing is silent: every call, over
MCP and over the CLI alike, lands an audit row in
~/.container-host-aiops/audit.db, and destructive writes still capture their
before-state and record an inverse where one exists.
Each tool declares a
risk_level, kept in agreement with its[READ]/[WRITE]documentation tag by a test, and carried into the audit row as a descriptive tier — so a reviewer can see at a glance that a row was a high-risk delete. It is a label, not a gate.
| Domain | Tools | Count | R/W |
|---|---|---|---|
| Overview | overview | 1 | read |
| Containers | list_containers, inspect_container, container_logs, container_stats, container_top, container_restart_summary | 6 | read |
| Images | list_images, inspect_image, dangling_images, image_disk_usage | 4 | read |
| Volumes | list_volumes, inspect_volume, dangling_volumes | 3 | read |
| Networks | list_networks, inspect_network | 2 | read |
| System | system_info, system_version, system_df, system_events | 4 | read |
| Stacks | list_endpoints, list_stacks, stack_detail (Portainer), list_compose_stacks (docker+podman) | 4 | read |
| Pods (Podman) | list_pods | 1 | read |
| Analyses (flagship) | restart_loop_rca, resource_pressure_analysis, image_and_volume_bloat | 3 | read |
| Writes | remove_container, prune_images, prune_volumes, recreate_stack | 4 | write (high) |
restart_container, stop_container, start_container, update_container | 4 | write (medium) |
The three analyses accept injected data for offline analysis, or pull live from a configured target. list_endpoints/list_stacks/stack_detail require a portainer target; list_compose_stacks (Compose project rollup by the com.docker.compose.project label, with per-stack health) works on docker or podman; list_pods requires a podman target (Docker/Portainer have no pod concept).
| Capability | docker | portainer | podman |
|---|---|---|---|
| Container / image / volume / network / system reads | ✅ | ✅ (proxied) | ✅ (compat) |
| Flagship analyses (restart-loop RCA, resource pressure, bloat) | ✅ | ✅ | ✅ (compat) |
| Lifecycle + prune writes (stop/start/restart/remove/update/prune) | ✅ | ✅ | ✅ (compat) |
Compose-stack rollup (list_compose_stacks) | ✅ | ✅ (proxied) | ✅ |
Portainer endpoints / stacks / recreate_stack | — | ✅ | — |
Podman pods (list_pods, libpod) | — | — | ✅ |
Run as an MCP server (stdio):
Every operation — MCP and CLI — passes through the bundled @governed_tool
harness. It records; it does not authorize (see above).
~/.container-host-aiops/audit.db (relocatable via CONTAINER_HOST_AIOPS_HOME). The CLI writes the same row the MCP path does — there is no unaudited entry point.CONTAINER_HOST_RUNAWAY_MAX=0; optional hard ceilings via CONTAINER_HOST_MAX_TOOL_CALLS / CONTAINER_HOST_MAX_TOOL_SECONDS.risk_level; it gates nothing.This is the container-host member of the AIops-tools family (governed AI-ops with audit + budget + undo), for single-host Docker / Portainer / Podman. It is deliberately NOT for a cluster orchestrator, a hypervisor, a storage appliance, a backup product, or OT / industrial edge — those are separate tools/lines.
Coverage is intentionally a curated subset of the Docker Engine + Portainer + Podman (libpod) APIs. Missing a call, or want another container host family? Open an issue or PR — contributions welcome.
doctor and
overview connected over the local socket, the restart-loop and image/volume
bloat analyses were run against real crash-looping containers and real reclaimable
data, and a governed stop_container wrote a row to the audit DB and recorded a
working undo descriptor.container-host-aiops doctor is the
fastest live check on any platform.Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/container-host-aiops)<a href="https://allmcps.com/mcp/container-host-aiops"><img src="https://allmcps.com/api/badge/container-host-aiops?style=directory" alt="Container Host AIops on AllMCPs" /></a>