TrueNAS AIops

io.github.AIops-tools由 GitHub 账号 AIops-tools 发布v0.14.0更新于 Oct 30, 2026

Governed TrueNAS SCALE storage ops — 25 MCP tools with audit, budget, undo guards.

概览

AI 生成的概览

面向 TrueNAS SCALE 的受治理存储运维 MCP 服务器,提供 25 个工具管理存储池、数据集、快照、磁盘与服务,并带审计与撤销记录。

可以做什么
  • 查看系统与存储状态:总览、系统信息、存储池、数据集、快照、磁盘与 S.M.A.R.T. 结果、告警、服务、复制与云同步任务
  • 执行只读诊断与根因分析,覆盖存储池健康以及告警与容量
  • 执行受治理的写操作:创建数据集与快照、启动存储池校验、重启服务、删除快照
  • 查看并应用已记录的撤销描述,回滚可逆的写操作
  • 无论通过 MCP 还是命令行,每次调用都会写入一条带风险等级的审计记录
适用场景
适合让助手协助运维 TrueNAS SCALE 设备:排查降级的存储池、检查容量与告警,或执行创建数据集、快照等小型受治理变更,同时保留可审计的操作记录。
运行要求
以本地 Python 包形式通过 uv 安装,并以 stdio 方式作为 MCP 服务器启动。需要可访问的 TrueNAS SCALE 设备(25.04 或更新版本)、在界面中创建的 TrueNAS API 密钥,以及由初始化命令生成的配置文件。加密凭据库通过环境变量 TRUENAS_AIOPS_MASTER_PASSWORD 或交互式提示解锁。插件安装方式要求 PATH 中存在 uvx 命令。
安装前请注意
该服务器不负责放行写操作:没有只读开关、策略文件或审批环节,应把 TrueNAS API 密钥绑定到权限受限的账户。写操作包括创建数据集、创建与删除快照、启动校验和重启服务,其中删除快照属高风险且不可撤销。主密码用于解锁加密密钥库,若导出为环境变量,会被子进程读取并留在命令历史中。审计记录与本地数据库写入用户主目录。

安装

在 SourceWeft 中

  1. 打开 控制台中的 TrueNAS AIops,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

TrueNAS 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 iXsystems or the TrueNAS project. "TrueNAS" is a trademark of its owner. MIT licensed.

AI-powered TrueNAS SCALE storage operations with a built-in governance harness — unified audit log, token/runaway budget guard, undo-token recording, and descriptive risk tiers. Speaks both TrueNAS APIs: REST v2.0 and the JSON-RPC/WebSocket API that replaces it in TrueNAS 26.

Verification status: live-verified against a real TrueNAS SCALE 25.04.2.1 appliance over both transports, including a full write → audit → undo → verified-restore loop. Coverage is listed endpoint by endpoint — and so are the gaps — in docs/VERIFICATION.md. Read it rather than reading "verified" as "everything".

Supported TrueNAS versions — and which API you are speaking

truenas-aiops speaks both TrueNAS APIs and picks the one that will still exist:

TrueNAS versionREST API v2.0JSON-RPC over WebSocketwhat this tool does
≤ 25.10.0supported—REST
25.04 – 25.10.xdeprecated (every call raises an appliance alert)already served at /api/currentWebSocket (auto)
26 and newerremovedrequiredWebSocket

Set transport: per target in config.yaml:

yaml
targets:  - name: nas1    host: nas1.example.com    transport: auto        # default — probe /api/current, prefer WebSocket    # transport: websocket # pin the API that survives TrueNAS 26    # transport: rest      # pin REST while migrating

auto probes /api/current with a cheap HTTP upgrade (no credential spent). If the appliance offers it, the tool uses it; otherwise it falls back to REST, which is still correct on 25.10 and older.

iXsystems documents that upgrading to TrueNAS 26 revokes existing API keys — so expect to mint a new one after the upgrade. We have not reproduced this ourselves; it is reported here from the upstream release notes, not from a verified upgrade. Treat it as a caution, not a measurement.

truenas-aiops doctor tells you which transport the connection actually used, reads the server version, and — on REST — says plainly whether REST is supported, deprecated, or gone. If the version cannot be parsed it reports UNKNOWN, never a clean bill of health it cannot justify.

What works

  • CLI (truenas-aiops ...): init, overview, system, pool list/get/status/scrub-status/capacity/scrub-start, dataset list/get/create, diagnose pool-health/alerts, snapshot list/create/delete, disk list/smart, alert list, service list/restart, replication list/cloudsync, secret set/list/rm/migrate/rotate-password, doctor, mcp.
  • MCP server (truenas-aiops mcp or truenas-aiops-mcp): 25 tools (19 read, 6 write), every one wrapped with the bundled @governed_tool harness.
  • Encrypted credentials: the TrueNAS API key lives in an encrypted store ~/.truenas-aiops/secrets.enc (Fernet + scrypt) — never plaintext on disk. Unlock with a master password from TRUENAS_AIOPS_MASTER_PASSWORD (MCP/CI) or an interactive prompt (CLI).
  • Reversibility: snapshot_create records an inverse snapshot_delete undo descriptor. The irreversible snapshot_delete (high risk) captures the snapshot's BEFORE state for the audit record and declares no undo.
  • Safety: destructive CLI ops (snapshot delete, service restart) require double confirmation and support --dry-run.

What this tool does, and does not, decide

It delivers TrueNAS SCALE storage 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: scope the TrueNAS API key to a limited-privilege account and the writes fail at the appliance — 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 ~/.truenas-aiops/audit.db, and reversible writes still capture their before-state and record an inverse.

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.

Running a smaller / local model? See agent-guardrails.md — it lists the guardrails this tool now enforces for you (so you don't spend prompt budget restating them) and gives a ready-made system prompt for what's left.

Playbook: triage a degraded pool

bash
truenas-aiops diagnose pool-health            # worst-first: bad state, error counters, capacity# → e.g. CRITICAL tank "pool status is DEGRADED", and "read=4 checksum=2" on a vdevtruenas-aiops pool status tank                # inspect the topology / scan detail it citedtruenas-aiops pool scrub-start tank           # kick an integrity scrub (governed, medium risk)truenas-aiops diagnose alerts                 # cross-check active alerts + any datasets near full

Each finding cites the measured number that tripped it (status string, error counts, used-percent) so you see why it was flagged, then points at the exact read/write command to act on it.

Capability matrix (25 MCP tools)

CategoryToolsCountR/W
Overview / Systemoverview, system_info2read
Diagnostics / RCApool_health_rca, alert_and_capacity_rca2read
Poolspool_list, pool_get, pool_status, scrub_status, pool_capacity5read
pool_scrub_start1write (medium)
Datasetsdataset_list, dataset_get2read
dataset_create1write (medium)
Snapshotssnapshot_list1read
snapshot_create (medium), snapshot_delete (high)2write
Disksdisk_list, smart_test_results2read
Alertsalert_list1read
Servicesservice_list1read
service_restart1write (medium)
Replicationreplication_list, cloudsync_list2read
Undo (governance)undo_list1read
undo_apply1write (medium)

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 truenas-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 truenas-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/truenas-aiopsopenclaw skills info truenas-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 truenas-aiopstruenas-aiops init        # interactive wizard: connection details + encrypted API keytruenas-aiops doctor      # verify config, encrypted store, connectivity (hits /system/info)

init writes ~/.truenas-aiops/config.yaml (non-secret connection details) and stores the API key encrypted in ~/.truenas-aiops/secrets.enc. Example config it produces:

yaml
targets:  - name: nas1    host: 10.0.0.30    port: 443    verify_ssl: false          # self-signed lab certs only    api_path: /api/v2.0

Create the API key in the TrueNAS UI under Credentials → API Keys. For non-interactive use (MCP server, CI, cron) export the master password so the store can be unlocked without a prompt:

bash
export TRUENAS_AIOPS_MASTER_PASSWORD='your-master-password'

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.

Managing secrets

bash
truenas-aiops secret set nas1             # prompts hidden for the API keytruenas-aiops secret list                 # names only, values never showntruenas-aiops secret rm nas1truenas-aiops secret rotate-password      # re-encrypt under a new master passwordtruenas-aiops secret migrate              # import a legacy plaintext .env, then deletes it

A legacy plaintext env var TRUENAS_<TARGET_NAME_UPPER>_APIKEY is still honoured as a fallback with a deprecation warning (migrate with truenas-aiops secret migrate).

支持范围 / Supported scope

Versions: TrueNAS SCALE 25.04 and newer over JSON-RPC/WebSocket, and any build still serving REST v2.0 over REST — the transport is selected automatically. See Supported TrueNAS versions. Note that iXsystems documents an upgrade to TrueNAS 26 as revoking existing API keys (upstream claim, not reproduced here).

Read: system info, ZFS pools (list/get/status/scrub-status/capacity), datasets (list/get), snapshots (list), disks + S.M.A.R.T. results, alerts, services, replication & cloud-sync tasks, one-shot health overview, and read-only diagnostics / RCA (pool_health_rca, alert_and_capacity_rca). Mutating (governed, dry-run + double-confirm where destructive): pool_scrub_start, dataset_create, snapshot_create, snapshot_delete, service_restart.

缺功能?(Missing something?) Coverage is intentionally focused. Open an issue or PR at github.com/AIops-tools/TrueNAS-AIops — feature requests, contributions, and comments are all welcome.

Caveats

  • Live-verified against TrueNAS SCALE 25.04.2.1 over both transports — reads cross-checked against the appliance's own API, and a full write → audit → undo → verified-restore loop. What is and is not covered is listed endpoint by endpoint in docs/VERIFICATION.md; read it rather than assuming "verified" means everything.
  • Still unverified: S.M.A.R.T. against failing media (needs real hardware — virtio exposes no S.M.A.R.T. at all), replication/cloudsync against real targets, and TrueNAS 26's auth.login_ex (25.04 exercises only the fallback).
  • CLI exit codes: 0 confirmed, 1 failed or refused, 2 outcome undetermined (the operation may still be in flight — poll before retrying).
  • Out of scope by design: anything that destroys bulk data (dataset/pool deletion, replication runs that overwrite) — only snapshot_delete removes data, and it is high risk + double-confirmed.

Not for

Other NAS/storage or backup products, hypervisor VM lifecycle, container clusters, or network devices — those are out of scope for this tool.

License

MIT — github.com/AIops-tools/TrueNAS-AIops

来源:README.md,提交 8eabb1b

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

5
  1. v0.14.0最新Oct 30, 2026
  2. v0.13.0Oct 15, 2026
  3. v0.12.0Oct 15, 2026
  4. v0.11.5Sep 17, 2026
  5. v0.11.4Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分