MCP Hub
Back to servers

truenas-mcp

Provides comprehensive management of TrueNAS SCALE instances through 278 actions across 18 categories using a token-efficient hierarchical tool design. Users can perform tasks like storage management, service configuration, and system monitoring while benefiting from built-in safety confirmations and read-only dashboard resources.

glama
Stars
2
Updated
Mar 31, 2026
Validated
Apr 2, 2026

truenas-mcp

The most comprehensive MCP server for TrueNAS SCALE. 278 actions across 18 categories covering the entire TrueNAS REST API — behind a single hierarchical tool that won't bloat your LLM's context window.

Why This One?

truenas-mcpOthers
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

Quick Start

# 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 -- npx -y truenas-mcp \
  --env TRUENAS_URL=https://truenas.local \
  --env TRUENAS_API_KEY=1-your-api-key-here \
  --env TRUENAS_VERIFY_SSL=false

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

License

MIT

Reviews

No reviews yet

Sign in to write a review