Back to Browse

TrueNAS MCP MCP Server

by User
File & StorageUse Caution3.5Local
Free

Control TrueNAS SCALE from your AI assistant, 278 actions behind one tool

About

MCP server for TrueNAS SCALE. Exposes 278 actions (pools, datasets, shares, snapshots, jails/apps, users, alerts, and more) behind a single hierarchical tool, so the agent's tool-list context cost is about 200 tokens instead of roughly 28,000 for one tool per action. Needs a TrueNAS SCALE instance URL and API key. Built for self-hosters who manage their NAS from an AI coding assistant.

Security Report

3.5
Use Caution3.5High Risk

This is a legitimate TrueNAS SCALE management server that authenticates with a Bearer API key from an environment variable and whose network and filesystem permissions match its purpose. Its main concerns are that TRUENAS_VERIFY_SSL=false disables TLS verification process-wide via NODE_TLS_REJECT_UNAUTHORIZED, and that it exposes very powerful administrative operations (raw API access, ACL/ownership changes, SSH and root login settings, domain leave with passwords) where confirmation gating is inconsistent. The visible code shows no exfiltration or malicious patterns, but the truncated file list means part of the codebase was not reviewed. Supply chain analysis found 4 known vulnerabilities in dependencies (0 critical, 4 high severity). Package verification found 1 issue.

9 files analyzed · 12 issues found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

HTTP Network Access

Connects to external APIs or services over the internet.

env_vars

Check that this permission is expected for this type of plugin.

file_system

Check that this permission is expected for this type of plugin.

process_spawn

Check that this permission is expected for this type of plugin.

What You'll Need

Set these up before or after installing:

Your TrueNAS SCALE instance base URL, including scheme (e.g. https://nas.local)Required

Environment variable: TRUENAS_URL

Sign up free
API key generated in the TrueNAS SCALE web UI under Credentials > API KeysRequired

Environment variable: TRUENAS_API_KEY

Sign up free

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "truenas-mcp": {
      "env": {
        "TRUENAS_URL": "your-truenas-url-here",
        "TRUENAS_API_KEY": "your-truenas-api-key-here"
      },
      "args": [
        "-y",
        "truenas-mcp"
      ],
      "command": "npx"
    }
  }
}

Getting Started

Once installed, try these example prompts and explore these capabilities:

  • 1"List all my TrueNAS storage pools and their free space"
  • 2"Create a new dataset under tank/backups"
  • 3Tool: truenas: one hierarchical tool covering all 278 TrueNAS SCALE actions

Documentation

View on GitHub

From the project's GitHub README.

npm npm downloads license

Wiring a NAS into an AI assistant usually means registering one MCP tool per operation. Cover TrueNAS SCALE properly and that is 50-80 tool schemas — around 28,000 tokens of your context window spent before the model has read a single word of your question, on every request, whether or not you touch storage.

truenas-mcp covers 278 actions across 18 categories — the whole TrueNAS SCALE REST API — behind one hierarchical tool that costs about 200 tokens. The model asks what categories exist, drills into the one it needs, then calls the action. Destructive operations refuse to run without confirm: true.

Install (60 seconds)

# No install needed
TRUENAS_URL=https://truenas.local TRUENAS_API_KEY=1-abc123 npx truenas-mcp

Claude Code:

claude mcp add truenas \
  --env TRUENAS_URL=https://truenas.local \
  --env TRUENAS_API_KEY=1-your-api-key-here \
  -- npx -y truenas-mcp

Get the API key from the TrueNAS UI: Settings > API Keys > Add.

What it looks like

You: "Are my pools healthy, and can you make an NFS share for the media dataset?"

→ truenas({ category: "storage", action: "pool_list" })
  tank — ONLINE, 68% used, 0 errors

→ truenas({ category: "sharing", action: "nfs_share_create",
            params: { path: "/mnt/tank/media", comment: "Media share" } })

The model discovered nfs_share_create by calling truenas({ category: "sharing" }) first — it never had those 36 sharing actions in its prompt.

Why one tool instead of 278

truenas-mcpTypical NAS MCP server
Actions2785-80
Token footprint~200 tokens (1 tool)5,000-30,000 tokens (50-80 tools)
DiscoveryHierarchical — ask for what you needFlat — everything loaded upfront
MCP Resources12 read-only dashboards0
Installnpx truenas-mcpBuild from source / pip
SafetyDestructive ops require confirm: trueVaries

Full configuration

# Using npx (no install needed)
TRUENAS_URL=https://truenas.local TRUENAS_API_KEY=1-abc123 npx truenas-mcp

# Or install globally
npm install -g truenas-mcp

Environment Variables

VariableRequiredDescription
TRUENAS_URLYesTrueNAS instance URL (e.g. https://truenas.local)
TRUENAS_API_KEYYesAPI key from TrueNAS UI: Settings > API Keys > Add
TRUENAS_VERIFY_SSLNoSet to false to skip SSL verification (self-signed certs)

Claude Desktop Configuration

Add to your claude_desktop_config.json:

{
  "mcpServers": {
    "truenas": {
      "command": "npx",
      "args": ["-y", "truenas-mcp"],
      "env": {
        "TRUENAS_URL": "https://truenas.local",
        "TRUENAS_API_KEY": "1-your-api-key-here",
        "TRUENAS_VERIFY_SSL": "false"
      }
    }
  }
}

Claude Code

claude mcp add truenas \
  --env TRUENAS_URL=https://truenas.local \
  --env TRUENAS_API_KEY=1-your-api-key-here \
  --env TRUENAS_VERIFY_SSL=false \
  -- npx -y truenas-mcp

How It Works — Hierarchical Tool Design

Instead of registering 278 individual tools (which would consume ~30k tokens in the LLM system prompt), this server exposes one tool called truenas with three usage modes:

1. Discover categories

truenas()

Returns all 18 categories with descriptions and action counts (~200 tokens).

2. Explore a category

truenas({ category: "storage" })

Returns all actions in that category with their required/optional parameters.

3. Execute an action

truenas({ category: "storage", action: "pool_list" })
truenas({ category: "storage", action: "dataset_create", params: { name: "tank/media", compression: "LZ4" } })

This means the LLM only pays the token cost for what it actually uses.

Categories

CategoryActionsCovers
system24System info, config, services, mail, API keys, NTP
storage32Pools, datasets, snapshots, periodic snapshot tasks
sharing36SMB/CIFS, NFS exports, iSCSI targets/extents/portals/initiators
network15Interfaces, global config, static routes, IPMI, staged changes
account16Users, groups, privileges/roles
disk7Physical disks, SMART tests, temperatures
vm16Virtual machines, VM devices (disk, NIC, display, PCI)
app17Docker apps, container runtime config
update14System updates, boot environments, boot pool
certificate8TLS certs, ACME/Let's Encrypt, DNS authenticators
alert10Alerts, notification services (Slack, email, PagerDuty)
data_protection49Replication, cloud sync, cloud backup, cron, rsync, init scripts, SSH keys
filesystem7stat, listdir, mkdir, permissions, ACLs, chown
reporting3Metrics config, graphs, time-series data
directory8Active Directory, LDAP, Kerberos
service_config12SSH, FTP, SNMP, UPS, system tunables
audit3Audit logs, audit configuration
api1Raw API escape hatch for any endpoint

MCP Resources (12)

Read-only resources for dashboards — no tool call needed:

ResourceURIDescription
System Infotruenas://system/infoVersion, hostname, uptime, hardware
Poolstruenas://storage/poolsAll pools with capacity and health
Datasetstruenas://storage/datasetsAll datasets with properties
Servicestruenas://servicesService status overview
Alertstruenas://alertsCurrent system alerts
Networktruenas://network/summaryInterfaces, IPs, DNS, gateway
Sharestruenas://sharingAll SMB, NFS, and iSCSI shares
VMstruenas://vmsVirtual machines with status
Appstruenas://appsInstalled applications
Diskstruenas://disksPhysical disks info
Boot Envstruenas://boot/environmentsBoot environments
Updatetruenas://system/updateUpdate configuration

Example Conversations

"What pools do I have and are they healthy?"

→ truenas({ category: "storage", action: "pool_list" })

"Create an NFS share for /mnt/tank/media"

→ truenas({ category: "sharing", action: "nfs_share_create", params: { path: "/mnt/tank/media", comment: "Media share" } })

"Check for system updates"

→ truenas({ category: "update", action: "update_check" })

"What SMART tests have run on sda?"

→ truenas({ category: "disk", action: "disk_smart_test_list", params: { disk: "sda" } })

Safety

All destructive operations require confirm: true in params:

  • Pool create/export/disk replace
  • Dataset/snapshot delete, snapshot rollback
  • VM delete, app delete/rollback
  • System reboot/shutdown, update apply
  • Disk wipe, boot disk attach/detach
  • Certificate delete, boot env delete
  • Directory services leave, ACL set

Without confirm: true, these actions return an error message explaining what would happen.

API Compatibility

Built for TrueNAS SCALE REST API v2.0. Compatible with TrueNAS SCALE 22.x through 25.x.

Development

git clone https://github.com/spranab/truenas-mcp
cd truenas-mcp
npm install
npm run build
npm run dev  # watch mode

Related projects

Other MCP servers and agent infrastructure built by the same author:

  • mcpier — self-hosted MCP control plane for your homelab; keeps API keys off your clients.
  • saga-mcp — SQLite-backed project tracker so the agent doesn't lose the plan between sessions.
  • yantrikdb-mcp — persistent cognitive memory for Claude Code, Cursor and Windsurf.
  • swarmcode — real-time channel between Claude Code instances on different machines.
  • brainstorm-mcp — multi-model debate as an MCP tool.
  • discord-mcp — run a Discord server from an AI assistant, 30+ actions behind one hierarchical tool.
  • icantmarket-mcp — browse products and post asks/reviews on icantmarket from any MCP client.

License

MIT

Reviews

No reviews yet

Be the first to review this server!