truenas-mcp

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.

Category
访问服务器

README

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-mcp Others
Actions 278 5–80
Token footprint ~200 tokens (1 tool) 5,000–30,000 tokens (50–80 tools)
Discovery Hierarchical — ask for what you need Flat — everything loaded upfront
MCP Resources 12 read-only dashboards 0
Install npx truenas-mcp Build from source / pip
Safety Destructive ops require confirm: true Varies

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

Variable Required Description
TRUENAS_URL Yes TrueNAS instance URL (e.g. https://truenas.local)
TRUENAS_API_KEY Yes API key from TrueNAS UI: Settings > API Keys > Add
TRUENAS_VERIFY_SSL No Set 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

Category Actions Covers
system 24 System info, config, services, mail, API keys, NTP
storage 32 Pools, datasets, snapshots, periodic snapshot tasks
sharing 36 SMB/CIFS, NFS exports, iSCSI targets/extents/portals/initiators
network 15 Interfaces, global config, static routes, IPMI, staged changes
account 16 Users, groups, privileges/roles
disk 7 Physical disks, SMART tests, temperatures
vm 16 Virtual machines, VM devices (disk, NIC, display, PCI)
app 17 Docker apps, container runtime config
update 14 System updates, boot environments, boot pool
certificate 8 TLS certs, ACME/Let's Encrypt, DNS authenticators
alert 10 Alerts, notification services (Slack, email, PagerDuty)
data_protection 49 Replication, cloud sync, cloud backup, cron, rsync, init scripts, SSH keys
filesystem 7 stat, listdir, mkdir, permissions, ACLs, chown
reporting 3 Metrics config, graphs, time-series data
directory 8 Active Directory, LDAP, Kerberos
service_config 12 SSH, FTP, SNMP, UPS, system tunables
audit 3 Audit logs, audit configuration
api 1 Raw API escape hatch for any endpoint

MCP Resources (12)

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

Resource URI Description
System Info truenas://system/info Version, hostname, uptime, hardware
Pools truenas://storage/pools All pools with capacity and health
Datasets truenas://storage/datasets All datasets with properties
Services truenas://services Service status overview
Alerts truenas://alerts Current system alerts
Network truenas://network/summary Interfaces, IPs, DNS, gateway
Shares truenas://sharing All SMB, NFS, and iSCSI shares
VMs truenas://vms Virtual machines with status
Apps truenas://apps Installed applications
Disks truenas://disks Physical disks info
Boot Envs truenas://boot/environments Boot environments
Update truenas://system/update Update 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选