Container Host AIops

io.github.AIops-tools由 GitHub 帳號 AIops-tools 發布v0.14.0更新於 Oct 30, 2026

Governed Docker + Portainer container-host ops: reads, RCA analyses, guarded writes. 38 tools.

發布方自己的服務:Host.al: .al domains and servers in Albania

概覽

AI 產生的概覽

針對單機 Docker、Portainer 與 Podman 的受治理 AI 維運伺服器,提供 38 個工具進行讀取、根因分析,以及具稽核與復原紀錄的寫入操作。

可以做什麼
  • 檢視容器、映像、磁碟區、網路與系統狀態(清單、詳情、日誌、統計、行程、事件、磁碟用量)
  • 執行三項重點分析:重啟迴圈根因(含結束碼對應)、資源壓力與上限比較、映像與磁碟區膨脹及可回收空間
  • 彙整 Compose 專案堆疊,在 Portainer 上列出端點與堆疊,在 Podman 上列出 pod
  • 執行生命週期寫入:啟動、停止、重啟、更新上限、移除容器、清理映像與磁碟區、重建堆疊
  • 每次寫入都支援 dry_run 預覽,可逆操作會記錄反向描述
  • 將每次 MCP 與 CLI 呼叫連同風險等級、耗時與結果摘要寫入本機稽核資料庫
適用情境
適合讓助理診斷並操作單台 Docker、Portainer 或 Podman 主機,例如排查崩潰迴圈、資源壓力與磁碟膨脹,同時希望寫入操作留有稽核與復原資訊。不適用於叢集編排器、虛擬化管理程式或備份產品。
執行需求
以 Python 套件形式在本機執行(uv tool install 或 pipx),透過 stdio 通訊。需要可存取的 Docker unix socket 或 TCP 主機、Podman 服務 socket,或帶 X-API-Key 權杖的 Portainer HTTPS 端點。Portainer 權杖加密儲存,需以 CONTAINER_HOST_AIOPS_MASTER_PASSWORD 或互動式提示解鎖;本機 socket 不需密鑰。另有選用變數可調整失控保護與稽核位置。
安裝前請注意
其中 9 個工具為寫入操作,包括高風險的 remove_container、prune_images、prune_volumes 與 recreate_stack;沒有唯讀開關或核准關卡,權限只能靠唯讀掛載 socket 或受限的 Portainer 帳號控制。主密碼用於解鎖已儲存的 Portainer 權杖,匯出後同一個 shell 啟動的其他行程也讀得到。稽核紀錄與復原資料寫入本機資料庫。Portainer 與 Podman 路徑僅經模擬測試,未在真實伺服器上驗證。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Container Host AIops,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Container Host AIops

Audit availability: Real writes require a committed pending audit row and stop before contacting the platform if storage is unavailable. Reads and previews may continue with a warning; new audit rows store outcome summaries rather than full responses.

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.

What it does

Three flagship signature analyses, plus the guarded reads and writes around them:

  • Restart-loop RCA — inspect containers for restart count + exit code, flag the crash-looping ones (restartCount over threshold, or restarting/dead, or a non-zero exit), and map each to a likely cause + action from the exit code (137 OOM/SIGKILL, 143 SIGTERM, 139 segfault, 127 bad entrypoint, …), with a tail of logs. Every ranking carries its numbers, not a black-box verdict.
  • Resource-pressure analysis — a one-shot CPU%/memory% sample per running container vs its configured limits, flagging each "near" (≥ 80% of a threshold) or "over", with a recommendation (raise a limit, set a missing memory limit, scale out).
  • Image & volume bloat — dangling images + dangling volumes + build cache from system/df, totalled into prune candidates with reclaimable bytes.

What works

  • CLI (container-host-aiops ...): init, overview, container, image, volume, network, system, stack, pod, analyze, manage, secret, doctor, mcp.
  • MCP server (container-host-aiops mcp or container-host-aiops-mcp): 38 tools (29 read, 9 write), every one wrapped with the bundled @governed_tool harness.
  • Connection layer: Docker over a unix socket (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.
  • Encrypted credentials: the Portainer API token lives in an encrypted store ~/.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).
  • Reversibility: mutating writes fetch the real before-state first and record a faithful inverse (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.
  • Safety: every state-changing CLI op supports --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.

What this tool does, and does not, decide

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.

Capability matrix (38 MCP tools)

DomainToolsCountR/W
Overviewoverview1read
Containerslist_containers, inspect_container, container_logs, container_stats, container_top, container_restart_summary6read
Imageslist_images, inspect_image, dangling_images, image_disk_usage4read
Volumeslist_volumes, inspect_volume, dangling_volumes3read
Networkslist_networks, inspect_network2read
Systemsystem_info, system_version, system_df, system_events4read
Stackslist_endpoints, list_stacks, stack_detail (Portainer), list_compose_stacks (docker+podman)4read
Pods (Podman)list_pods1read
Analyses (flagship)restart_loop_rca, resource_pressure_analysis, image_and_volume_bloat3read
Writesremove_container, prune_images, prune_volumes, recreate_stack4write (high)
restart_container, stop_container, start_container, update_container4write (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).

Platform support matrix

Capabilitydockerportainerpodman
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)——✅

Quick start

As a Claude Code plugin

One install gives an agent both the skill and the MCP server:

/plugin marketplace add AIops-tools/marketplace/plugin install container-host-aiops@aiops-tools

The MCP server is fetched with uv and pinned to the package version this plugin declares, so an audit row can be traced back to the code that wrote it. Credentials are still configured with container-host-aiops init — see below.

As an OpenClaw plugin

The same bundle is published on ClawHub, where one install delivers the skill and its MCP server together:

bash
openclaw plugins install clawhub:@zw008/container-host-aiopsopenclaw skills info container-host-aiops          # expect: Visible to model: yes

Restart the OpenClaw gateway afterwards so it loads the plugin. The MCP server is fetched with uv, pinned to this exact release, so uvx has to be on PATH — without it the skill still installs but reports Visible to model: no. Credentials are configured exactly as below.

As a CLI or standalone MCP server

bash
uv tool install container-host-aiops          # or: pipx install container-host-aiopscontainer-host-aiops init                      # wizard: add a Docker/Podman socket or Portainer targetcontainer-host-aiops doctor                    # verify config, secrets, connectivitycontainer-host-aiops overview                  # one-shot host healthcontainer-host-aiops analyze restart-loop      # crash-looping containers + cause/actioncontainer-host-aiops container list --running  # running containers

Run as an MCP server (stdio):

bash
export CONTAINER_HOST_AIOPS_MASTER_PASSWORD=...   # only needed for Portainer targetscontainer-host-aiops-mcp

Where that password then lives: an exported variable is readable by every process this shell starts and is recorded by shell history. On a shared or long-lived host, prefer the interactive prompt, or inject it from a secret manager for the life of the one command that needs it.

Governance

Every operation — MCP and CLI — passes through the bundled @governed_tool harness. It records; it does not authorize (see above).

  • Audit — every call (params, outcome summary, status, duration, risk tier, and any operator-supplied approver/rationale) is logged to ~/.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.
  • Runaway guard — a safety backstop, not an authorization gate: the same call hammered in a tight loop trips a circuit breaker so a stuck agent can't burn unbounded calls/time. Disable with CONTAINER_HOST_RUNAWAY_MAX=0; optional hard ceilings via CONTAINER_HOST_MAX_TOOL_CALLS / CONTAINER_HOST_MAX_TOOL_SECONDS.
  • Undo recording — reversible writes record an inverse descriptor built from the fetched before-state.
  • Risk tier — a descriptive label on the audit row derived from risk_level; it gates nothing.

Scope

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.

Missing a capability?

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.

Verification status

  • Docker — exercised against a live Docker Engine 27.5.1 daemon: 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.
  • Portainer and Podman — mock-validated only. Those API paths are modelled from each project's public API shape and have not been exercised against a live server.
  • The full checklist — what the mock suite guarantees, what the Docker run already satisfied, and what a Portainer/Podman run still has to prove — is in docs/VERIFICATION.md. container-host-aiops doctor is the fastest live check on any platform.

來源:README.md,提交 2f72349

工具

0
SourceWeft 曾在隔離沙箱中以無憑證方式啟動該軟體包一次,以列出其工具,但未能完成:伺服器未能啟動。

版本歷史

4
  1. v0.14.0最新Oct 30, 2026
  2. v0.13.0Oct 15, 2026
  3. v0.12.0Oct 15, 2026
  4. v0.11.3Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

其他 Host 整合