SuperAPIAI Directory

TrueNAS-AIops

github.com · AI agents

TrueNAS-AIops is a community-maintained MIT open-source project that provides AI-driven operational capabilities and built-in governance mechanisms for TrueNAS SCALE storage operations. It supports both REST v2.0 and the JSON-RPC/WebSocket API that TrueNAS 26 will adopt, and can automatically detect the transport methods actually supported by the device. The project provides a CLI and an MCP server (25 tools, 19 read and 6 write); every call writes an audit record to the local audit.db; write operations carry risk-level labels, reversibility descriptions, --dry-run, and secondary confirmation for destructive operations; API keys are stored encrypted with Fernet + scrypt and are never stored in plaintext. Both transport methods have been tested on TrueNAS SCALE 25.04.2.1; see docs/VERIFICATION.md for per-endpoint coverage. The project is not affiliated with iXsystems or the official TrueNAS project.

Open website Alternatives
PricingOpen source开源项目(可免费自部署)
PlatformsLinux

About this tool

Purpose truenas-aiops is aimed at the day-to-day operations of TrueNAS SCALE storage systems: reading information about the system, pools, datasets, snapshots, disks, alerts, services, replication and cloud sync tasks, and performing governed write operations. It can be used directly as a command-line tool or connected as an MCP server to AI agents (offered in two packaged forms: a Claude Code plugin and an OpenClaw plugin). The project is a community-maintained MIT open-source project and declares that it has no affiliation, endorsement, or sponsorship relationship with iXsystems or the TrueNAS project; "TrueNAS" is the trademark of its owner.

Key capabilities Dual API transports: supports both TrueNAS REST v2.0 and the JSON-RPC/WebSocket API that replaces it in TrueNAS 26. The transport method can be set per target in config.yaml; auto mode probes /api/current with a lightweight HTTP upgrade (without consuming credentials), using it if available and otherwise falling back to REST (which remains correct on 25.10 and earlier). The doctor command reports the transport method actually used by the connection, reads the server version, and under REST explicitly states whether REST is supported, deprecated, or removed; when the version cannot be parsed it reports UNKNOWN rather than giving an unprovable conclusion. CLI: provides commands such as 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, and mcp. MCP server: started via truenas-aiops mcp or truenas-aiops-mcp, with a total of 25 tools (19 read, 6 write), eachEach tool is wrapped with the @governed_tool governance wrapper provided with the package. Read scope: system information, ZFS pools (list/get/status/scrub-status/capacity), datasets (list/get), snapshots (list), disks and S.M.A.R.T. results, alerts, services, replication and cloud sync tasks, a one-time health overview, and read-only diagnostics/root cause analysis (pool_health_rca, alert_and_capacity_rca). Write scope (governed; destructive operations support dry-run and secondary confirmation): pool_scrub_start, dataset_create, snapshot_create, snapshot_delete, service_restart. Auditing and governance: every call (whether via MCP or CLI) writes an audit record row to ~/.truenas-aiops/audit.db. Regarding audit availability, real write operations require a pending audit row to be committed first; if storage is unavailable, stop before contacting the platform; reads and previews may continue but will carry a warning; new audit rows store a result summary rather than the full response. Each tool declares a risk_level, and tests ensure it matches the [READ]/[WRITE] markers in the documentation; the risk level is written into the audit row as a descriptive tier, so reviewers can see at a glance that a given row is a high-risk deletion. It is a label, not a gate. Reversibility: snapshot_create records a reverse snapshot_delete undo descriptor; the irreversible snapshot_delete (high risk) captures the snapshot's BEFORE state for the audit record and declares no undo. Credential security: the TrueNAS API key is stored in encrypted storage ~/.truenas-aiops/secrets.enc (Fernet + scrypt) and is not written to disk in plaintext. Unlock the master password via the TRUENAS_AIOPS_MASTER_PASSWORD environment variable (MCP/CI scenarios) or an interactive prompt. Permission boundaries: the tools do not decide whether a given write operation is allowed; that depends on the agent's judgment or the permissions of the connected account. Restrict the TrueNAS API key to a low-privilege account, and write operations will fail on the device side—permissions trulyThe place it properly belongs. Therefore the project has no read-only switch, no policy file, and no configurable approval gate. Supplementary material: agent-guardrails.md lists the guardrails the tool already enforces for you (avoiding repeated budget consumption in prompts), and provides a ready-to-use system prompt for filling in the remaining parts when running smaller/local models; there is also a "troubleshooting degraded pool" playbook, where each finding cites the measured values that triggered it (status strings, error counts, usage percentages) and points to the specific read/write commands; the documentation also includes a capability matrix of 25 MCP tools.

How to use As a Claude Code plugin: a single install gives the agent both the skill and the MCP server; the MCP server is pulled via uv and pinned to the package version declared by the plugin, so audit lines can be traced back to the code version that wrote them. Credentials still need to be configured with truenas-aiops init. As an OpenClaw plugin: the same bundle is published on ClawHub, and a single install provides both the skill and its MCP server; after installation, the OpenClaw gateway must be restarted to load the plugin. The MCP server is pulled via uv and pinned to that exact release 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: init writes ~/.truenas-aiops/config.yaml (non-sensitive connection information) and stores the API key encrypted in ~/.truenas-aiops/secrets.enc. The API key must be created 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; however, note that the exported variable can be read by all processes started by that shell and will be recorded in shell history, so on shared or long-running hosts prefer interactive prompts, or inject it from a secret manager only for the duration of a single command. Key management: the legacy plaintext environment variable TRUENAS_<TARGET_NAME_UPPER>_APIKEY is still accepted as a fallback, but will produce a deprecation warning, and can be used with truenas-aiops secret migrate migration; the secret subcommand supports set/list/rm/migrate/rotate-password.

Applicable scenarios Operations scenarios that require auditable storage read operations and limited write operations on TrueNAS SCALE (starting scrub, creating datasets, creating/deleting snapshots, restarting services); scenarios that require AI agents to operate storage devices within clear permission boundaries; scenarios that require read-only diagnosis and root cause analysis of degraded pools, alerts, and capacity issues and provide executable commands; scenarios that require adding guardrails and system prompts for small models.

Limitations and unverified scope Supported versions: TrueNAS SCALE 25.04 and newer can be used via JSON-RPC/WebSocket, any version that still provides REST v2.0 can be used via REST, and the transport is selected automatically. iXsystems documentation states that upgrading to TrueNAS 26 will revoke existing API keys; the project notes that this is a hint from upstream release notes, has not been reproduced by the project itself, and should be treated as a warning rather than a tested conclusion. Actual testing: testing has been performed on a real TrueNAS SCALE 25.04.2.1 device via both transports, read results were cross-checked against the device's own API, and a complete write → audit → revoke → verify recovery loop was completed; per-endpoint coverage and gaps are listed in docs/VERIFICATION.md, and "verified" should not be understood as "fully covered". Parts still unverified include: S.M.A.R.T. on failing media (requires real hardware, virtio does not expose S.M.A.R.T. at all), replication/cloud sync against real targets, and auth.login_ex on TrueNAS 26 (25.04 only uses the fallback path). Excluded by design: any operation that destroys bulk data (dataset/pool deletion, replication tasks that overwrite data)—only snapshot_delete deletes data, and it is high-risk and requires secondary confirmation; other NAS/storage or backup products, virtual machine lifecycle management, container clusters, and network devices are all out of scope. CLI exit codes: 0 means confirmed, 1 means failed or rejected, 2 means the result is undetermined (the operation may still be in progress; poll before retrying). For missing functionality, submit an issue or PR in the project repository. Information on fees, pricing, and commercial supportis not currently provided; the project only notes that it uses the MIT license.

Up/Down to navigate · Enter to open · ESC to closeBrowse all tools