Logo vun TrueNAS MCP Server

TrueNAS MCP Server

Organisatioun
truenas

Monitor and Manage your TrueNAS via LLM using an MCP plugin.

Editeurtruenas
Repositorytruenas-mcp
SproochGo
Forks
26
Stären
99
Disponibel Tools
0
Transporttypstdio
Kategorien
LizenzGPL-3.0
Linken
  • Tools mat KI-Workflows verbannen

    TrueNAS MCP Server stellt MCP-Funktioune bereit, déi vu kompatibele KI-Clienten a KI-Agente kënne benotzt ginn.

  • 0 disponibel Tools

    Kuckt Iech déi opruffbar Aktiounen hei drënner un, mat Nimm a Beschreiwungen, wa se vum Server geliwwert ginn.

  • Konfiguratioun fir ze kopéieren

    Benotzt d'Installatiounsbeispiller, fir dëse Server an Ärem bevorzugte MCP-Client ze konfiguréieren.

  • Indicateure fir Open Source

    99 Stären an 26 Forks aus dem verlinkte Repository.

TrueNAS MCP Server

⚠️ Research Preview This project is in active development and released as a research preview. APIs and features may change. Not recommended for production use.

A Model Context Protocol (MCP) server for TrueNAS that enables AI models to interact with the TrueNAS API using natural language queries.

Table of Contents

Features

TrueNAS MCP provides comprehensive management capabilities through natural language:

Core Categories

  • 📊 Monitoring - System info, health, alerts, performance metrics
  • 💾 Storage - Pools, datasets, snapshots, shares (SMB/NFS)
  • 🖥️ Virtualization - VM management and status
  • 🔐 Directory Services - Active Directory, LDAP, FreeIPA integration and health monitoring
  • 📈 Capacity Planning - Utilization analysis and trend projections
  • 🔄 Maintenance - System updates, boot environments, pool scrubs
  • 📦 Applications - Catalog search, guided installation with storage setup, app management and upgrades
  • ⚙️ Tasks - Long-running operation tracking

Key Capabilities

  • Intelligent Filtering & Sorting - Query datasets, snapshots, VMs with smart filters
  • Dry-Run Mode - Preview changes before execution for all write operations
  • Task Tracking - Automatic progress monitoring for updates, upgrades, and scrubs
  • Safety Checks - Built-in validation prevents dangerous operations
  • Natural Language - Ask questions in plain English, get actionable insights

📖 View complete feature list →

Architecture

Single native binary that runs on your desktop and connects directly to TrueNAS:

┌──────────────────┐
│  Claude Desktop  │
└────────┬─────────┘
         │ stdio (JSON-RPC)
┌────────▼───────────────────┐
│  truenas-mcp               │ (Your Desktop)
│  - stdio interface         │
│  - Tool registry           │
│  - WebSocket client        │
└────────┬───────────────────┘
         │ Secure WebSocket (wss://)
         │ + TrueNAS API key auth
┌────────▼──────────────────┐
│  TrueNAS Middleware       │
│  - WebSocket HTTPS endpoint│
│  - Port 443 (wss)          │
└───────────────────────────┘

Key Benefits:

  • ✅ No deployment to TrueNAS required
  • ✅ Runs entirely on your desktop
  • ✅ Secure WebSocket connection (wss://) to TrueNAS middleware
  • ✅ Self-signed certificate support via --tls-ca (works with TrueNAS defaults)
  • ✅ Cross-platform support (macOS, Linux, Windows)
  • ✅ Simple configuration with hostname or full WebSocket URL
  • ✅ API key protection (requires encrypted connections)

Building

bash
# Download dependencies
go mod download

# Build for local platform
make build

# Build for all platforms (macOS, Linux, Windows)
make build-all

Installation

Step 1: Download or Build Binary

Choose the appropriate binary for your platform:

macOS (Apple Silicon):

bash
sudo cp truenas-mcp-darwin-arm64 /usr/local/bin/truenas-mcp
sudo chmod +x /usr/local/bin/truenas-mcp

macOS (Intel):

bash
sudo cp truenas-mcp-darwin-amd64 /usr/local/bin/truenas-mcp
sudo chmod +x /usr/local/bin/truenas-mcp

Linux:

bash
sudo cp truenas-mcp-linux-amd64 /usr/local/bin/truenas-mcp
sudo chmod +x /usr/local/bin/truenas-mcp

Windows:

powershell
copy truenas-mcp-windows-amd64.exe C:\Windows\System32\truenas-mcp.exe

Step 2: Get TrueNAS API Key

  1. Log into your TrueNAS web interface
  2. Go to System Settings → API Keys
  3. Click Add to create a new API key
  4. Give it a name (e.g., "Claude Desktop MCP")
  5. Make sure it has appropriate permissions (admin recommended)
  6. Copy the API key - you'll need it for configuration

Step 3: Configure Your MCP Client

Claude Desktop

Edit your Claude Desktop configuration file:

macOS:

bash
vi ~/Library/Application\ Support/Claude/claude_desktop_config.json

Linux:

bash
vi ~/.config/Claude/claude_desktop_config.json

Windows:

%APPDATA%\Claude\claude_desktop_config.json

Add the TrueNAS MCP server configuration:

json
{
  "mcpServers": {
    "truenas": {
      "command": "truenas-mcp",
      "args": [
        "--truenas-url", "truenas.local",
        "--api-key", "your-api-key-here"
      ]
    }
  }
}

Configuration options:

Option 1: Hostname (automatically uses wss://):

json
"args": [
  "--truenas-url", "192.168.0.31",
  "--api-key", "your-api-key-here"
]

Option 2: Using environment variables:

json
{
  "mcpServers": {
    "truenas": {
      "command": "truenas-mcp",
      "env": {
        "TRUENAS_URL": "192.168.0.31",
        "TRUENAS_API_KEY": "your-api-key-here"
      }
    }
  }
}

TLS with a self-signed certificate: TrueNAS ships with a self-signed certificate by default, and certificate verification is on by default. Either export your server's certificate once and trust it (recommended):

json
"env": {
  "TRUENAS_URL": "192.168.0.31",
  "TRUENAS_API_KEY": "your-api-key-here",
  "TRUENAS_TLS_CA": "/path/to/truenas-cert.pem"
}

or explicitly disable verification (not recommended - allows man-in-the-middle attacks on your network):

json
"env": { "TRUENAS_INSECURE": "1" }

To export the certificate: TrueNAS UI → System Settings → Certificates, or openssl s_client -connect 192.168.0.31:443 </dev/null 2>/dev/null | openssl x509 > truenas-cert.pem

Claude Code

Claude Code uses the claude mcp command to configure MCP servers:

Add TrueNAS MCP server:

bash
claude mcp add truenas -- truenas-mcp --truenas-url 192.168.0.31 --api-key your-api-key-here

Verify the configuration:

bash
claude mcp list
claude mcp get truenas

Manage the server:

bash
# Remove the server
claude mcp remove truenas

# Re-add with updated configuration
claude mcp add truenas -- truenas-mcp --truenas-url 192.168.0.31 --api-key new-api-key

Step 4: Restart Your MCP Client

Claude Desktop: Quit Claude Desktop completely and restart it.

Claude Code: The MCP server will be loaded automatically when you use Claude Code.

Step 5: Verify the Connection

You should now be able to ask TrueNAS questions:

  • "What version of TrueNAS is running?"
  • "Show me all storage pools and their health"
  • "List all datasets"
  • "What shares are configured?"
  • "Show me system metrics for the past hour"

Command-Line Options

Flags

  • --truenas-url - TrueNAS hostname (required, or use TRUENAS_URL env var)
    • Examples: truenas.local or 192.168.0.31 (automatically uses wss:// on port 443)
    • ⚠️ Note: ws:// (unencrypted) is not allowed - TrueNAS will revoke API keys used over unencrypted connections
  • --api-key - TrueNAS API key for authentication (required, or use TRUENAS_API_KEY env var)
  • --tls-ca - Path to a PEM certificate to trust, e.g. the TrueNAS self-signed certificate (or use TRUENAS_TLS_CA env var)
  • --insecure - Disable TLS certificate verification entirely (or set TRUENAS_INSECURE=1) - unsafe: allows man-in-the-middle attacks; prefer --tls-ca
  • --debug - Enable debug logging (or set TRUENAS_MCP_DEBUG=1)
  • --version - Print version and exit

Debug Logging

By default, logs written to stderr contain only metadata (method names, request IDs, response sizes) - never request or response bodies. Set TRUENAS_MCP_DEBUG=1 (or pass --debug) to log full request/response bodies for troubleshooting.

Even in debug mode, credentials are never logged: API keys and other credential-bearing values (password, bindpw, secret, token, etc.) are replaced with [REDACTED], so debug logs are safe to share in bug reports.

Examples

bash
# Basic usage
./truenas-mcp --truenas-url 192.168.0.31 --api-key your-api-key

# Using environment variables
export TRUENAS_URL=192.168.0.31
export TRUENAS_API_KEY=your-api-key
./truenas-mcp

# With debug logging (full request/response bodies, credentials redacted)
./truenas-mcp --truenas-url 192.168.0.31 --api-key your-api-key --debug
# or: TRUENAS_MCP_DEBUG=1 ./truenas-mcp --truenas-url 192.168.0.31 --api-key your-api-key

Connection Details

How It Works

The binary connects directly to TrueNAS middleware's WebSocket endpoint:

  1. Uses secure WebSocket (wss://): Connects to wss://your-truenas:443/websocket
  2. Verifies certificates by default: trust the TrueNAS self-signed certificate with --tls-ca (see TLS with a self-signed certificate)
  3. Authenticates via API key: Uses auth.login_with_api_key method

⚠️ Security Requirement

IMPORTANT: TrueNAS requires encrypted connections (wss://) for API key authentication. Using unencrypted ws:// will cause your API key to be revoked as a security measure. This binary defaults to wss:// to protect your credentials.

Troubleshooting

Connection Issues:

  • Verify TrueNAS is accessible from your machine
  • Check firewall allows port 443 (wss)
  • Verify API key is valid and has admin permissions

Certificate Verification Errors (x509: certificate signed by unknown authority or similar):

  • TrueNAS uses a self-signed certificate by default; export it and pass --tls-ca truenas-cert.pem (recommended)
  • Or disable verification with --insecure / TRUENAS_INSECURE=1 (unsafe on untrusted networks)

Authentication Failures:

  • Generate a new API key in TrueNAS System Settings → API Keys
  • Ensure the key has appropriate permissions
  • Check that the key wasn't accidentally truncated when copying

Security

  • Authentication: TrueNAS API key required for all operations
  • TLS/SSL: Only supports wss:// (encrypted) - ws:// is rejected for security
  • Certificate verification: On by default; pin a self-signed certificate with --tls-ca, or opt out explicitly with --insecure
  • Network: Client-only (no listening ports, all connections outbound)
  • API Key Storage: Recommend using environment variables instead of command-line args
  • Log Safety: Credentials are redacted from all log output and error messages; full request/response bodies are only logged in debug mode (see Debug Logging)

Security Best Practices

  1. Always use secure WebSocket (wss://) - enforced by default, ws:// is rejected
  2. Generate dedicated API key for MCP use only
  3. Use environment variables for API keys in Claude Desktop config
  4. Restrict API key permissions to minimum required
  5. Rotate API keys periodically

Example Usage

Once connected via an MCP client, ask questions in natural language:

Quick Start Examples

Monitoring:

  • "What version of TrueNAS is running?"
  • "Are there any system alerts?"
  • "Show me CPU and memory usage over the past day"

Storage:

  • "Show me all storage pools and their health status"
  • "What are the top 10 datasets using the most space?"
  • "List snapshots for the tank/shares/data dataset"

Maintenance:

  • "Check if there are any TrueNAS system updates available"
  • "What's the scrub status of my pools?"
  • "Show me boot environments that are safe to delete"

Management:

  • "Create a new dataset for file sharing"
  • "Set up a weekly scrub schedule for tank on Sunday at 2am"
  • "Upgrade the plex app to the latest version"

💬 View complete example queries →

Advanced Features

MCP Tasks for Long-Running Operations

The server implements MCP Tasks specification for operations that take time to complete (like app upgrades):

How it works:

  1. Write operations (like upgrade_app) return a task_id instead of blocking
  2. Tasks are automatically tracked in the background
  3. Use tasks_get with the task ID to check progress
  4. Tasks update automatically - no manual polling needed

Example:

User: "Upgrade the plex app"
→ Returns: {"task_id": "abc-123", "status": "working", ...}

User: "Check task abc-123"
→ Returns: {"status": "completed", "result": {...}}

Task States:

  • working - Operation in progress
  • completed - Operation finished successfully
  • failed - Operation encountered an error
  • cancelled - Operation was cancelled

Dry-Run Mode for Write Operations

Write operations support previewing changes before execution:

How to use: Add "dry_run": true to any write operation to preview what would happen without making changes.

Example:

Tool: upgrade_app
Args: {"app_name": "plex", "dry_run": true}

Returns:
{
  "tool": "upgrade_app",
  "current_state": {
    "name": "plex",
    "version": "1.32.5.7349",
    "state": "RUNNING"
  },
  "planned_actions": [
    {
      "step": 1,
      "description": "Stop application containers",
      "operation": "stop",
      "target": "plex"
    },
    {
      "step": 2,
      "description": "Upgrade from 1.32.5.7349 to latest",
      "operation": "upgrade",
      "target": "plex"
    },
    {
      "step": 3,
      "description": "Start application with new version",
      "operation": "start",
      "target": "plex"
    }
  ],
  "warnings": [],
  "estimated_time": {
    "min_seconds": 30,
    "max_seconds": 300,
    "note": "Time varies based on image size and network speed"
  }
}

Benefits:

  • See exactly what will change before committing
  • Understand prerequisites and warnings
  • Get time estimates for operations
  • Build confidence before making changes

Development

bash
# Run linters
make lint

# Run tests
make test

# Clean build artifacts
make clean

Installatioun

TypingMind
{
  "mcpServers": {
    "truenas-mcp": {
      "command": "truenas-mcp",
      "args": [
        "--truenas-url",
        "{{config.TRUENAS_URL}}",
        "--api-key",
        "{{config.TRUENAS_API_KEY}}"
      ],
      "env": {
        "TRUENAS_URL": "<TRUENAS_URL>",
        "TRUENAS_API_KEY": "<TRUENAS_API_KEY>"
      }
    }
  }
}

TrueNAS MCP Server MCP mat verschiddene KI-Modeller benotzen

TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Soubal TrueNAS MCP Server verbonnen ass, kënnt Dir et mat verschiddene KI-Modeller an TypingMind benotzen, amplaz et fir all Modell separat anzeriichten. Dës MCP-Integratioun leeft lokal iwwer den TypingMind-MCP-Connector op Ärem Apparat.

Ariichtungsuleedung fir de lokale Connector ze benotzen

Benotzt dës Optioun, wann den MCP-Server Zougrëff op lokal Fichieren, Appen oder privat Ressourcen op Ärem Computer brauch.

1

D'MCP-Astellungen opmaachen

Gitt an TypingMind op „Astellungen“, „Erweidert Astellungen“, dann op „Model Context Protocol“ a wielt „Connector ariichten“.

  1. Maacht TypingMind an Ärem Browser op.
  2. Klickt op d'Astellungssymbol.
  3. Gitt op „Erweidert Astellungen“.
  4. Maacht d'Sektioun „Model Context Protocol“ op.
  5. Klickt op „Connector ariichten“ a wielt „Dësen Apparat“.
Ariichtungsbildschierm vum TypingMind-MCP-Connector mat „Dësen Apparat“ ausgewielt
2

De Connector-Befeel ausféieren

Wielt „Dësen Apparat“, kopéiert de Befeel aus TypingMind a féiert en am Terminal aus. Loosst de Prozess lafen, wärend Dir MCP benotzt.

  1. Kopéiert den Ariichtungsbefeel, deen TypingMind uweist.
  2. Maacht Terminal op macOS oder Windows Terminal op Windows op.
  3. Pescht de Befeel an a féiert en aus.
  4. Bestätegt d'Installatioun vum Package, wann den Terminal Iech freet, ob Dir weiderfuere wëllt.
  5. Loosst den Terminal an de Prozess doranner lafen, wärend Dir MCP-Tools benotzt.
3

TrueNAS MCP Server als Server derbäisetzen

Wann de Connector-Status „Prett“ ass, klickt op „Serveren änneren“ a pescht d'MCP-Serverkonfiguratioun an.

  1. Waart, bis de Connector-Status „Prett“ weist.
  2. Klickt op „Serveren änneren“.
  3. Pescht d'MCP-Serverkonfiguratioun vu TrueNAS MCP Server an.
  4. Späichert d'Serverlëscht.
  5. Aktualiséiert, wann Dir kontrolléiere wëllt, ob de Connector nach ëmmer prett ass.
MCP-Astellunge vun TypingMind mat aktivem Server an dem Knäppchen „Serveren änneren“
{
  "mcpServers": {
    "truenas-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

D'Verbindung mat verschiddene Modeller benotzen

Späichert d'Serverlëscht, maacht „Plugins“ op an aktivéiert d'MCP-Tools vu TrueNAS MCP Server. Wielt dann e belibegen ënnerstëtzte KI-Modell an TypingMind a benotzt d'Tools am Chat oder weist se engem KI-Agent zou.

  1. Maacht d'Säit „Plugins“ an TypingMind op.
  2. Aktivéiert d'MCP-Tools vu TrueNAS MCP Server.
  3. Start e Chat a wielt de KI-Modell, deen Dir benotze wëllt.
  4. Benotzt d'MCP-Tools am Chat oder weist se engem KI-Agent zou.
  5. Wiesselt bei Bedarf op en anere KI-Modell, ouni MCP nei ze verbannen.
TypingMind-Chat mat aktivéierte MCP-Tools an engem ausgewielte KI-Modell
Hëlleft Dir mir bei dëser Aufgab mat TrueNAS MCP Server?
TrueNAS MCP Server
Jo. Ech hunn et gelies.
Dat hunn ech mat TrueNAS MCP Server fonnt.

Heefeg gestallte Froen

Fir wat gëtt de MCP-Server TrueNAS MCP Server benotzt?

TrueNAS MCP Server ass e MCP-Server, deen et kompatibele KI-Clienten erlaabt, sech mat externen Tools a Kontext ze verbannen. An TypingMind kënnt Dir dëse MCP-Server eemol derbäisetzen a seng Tools an Ärem KI-Aarbechtsberäich zur Verfügung stellen.

Kann ech TrueNAS MCP Server MCP mat méi KI-Modeller an TypingMind benotzen?

Jo. TypingMind verbënnt MCP-Tools um Niveau vum Aarbechtsberäich. Sou kënnt Dir TrueNAS MCP Server mat verschiddene KI-Modeller wéi Claude, ChatGPT, Gemini oder anere Modeller benotzen, déi Dir an TypingMind konfiguréiert hutt, ouni de MCP-Server fir all Modell separat anzeriichten.

Firwat TrueNAS MCP Server MCP mat TypingMind benotzen?

TypingMind ass eng vun de beschte Benotzeruewerfläche fir LLM-Chat, well et méi KI-Modeller, Prompts, Plugins, KI-Agenten, API-Schlësselen a MCP-Tools an engem Aarbechtsberäich zesummebréngt. Wann TrueNAS MCP Server verbonnen ass, kënnt Dir seng MCP-Tools mat Äre bevorzugte Modeller benotzen a gläichzäiteg Är Chataarbecht an TypingMind organiséieren.

Wéi verbannen ech TrueNAS MCP Server MCP mat TypingMind?

TrueNAS MCP Server leeft iwwer de lokale MCP-Connector vun TypingMind. Dat eegent sech am beschten, wann de MCP-Server Zougrëff op lokal Fichieren, Desktop-Apps, Kommandozeilen-Tools oder privat Ressourcen op Ärem Computer brauch.

Wéi eng Tools stellt TrueNAS MCP Server MCP an TypingMind zur Verfügung?

TrueNAS MCP Server stellt MCP-Funktiounen zur Verfügung, déi Dir op der Plugins-Säit vun TypingMind aktivéiere kënnt, fir se am Chat ze benotzen oder KI-Agenten zouzeweisen.

Muss ech meng API-Schlëssele mat TypingMind deelen, fir TrueNAS MCP Server MCP ze benotzen?

Nee. TypingMind setzt op lokal Veraarbechtung a léisst Iech d'Kontroll iwwer Är Modellubidder, API-Schlësselen, Prompts a MCP-Konfiguratioun. Wann TrueNAS MCP Server eng Authentifizéierung verlaangt, setzt déi néideg Headeren, OAuth-Astellungen oder lokal Konfiguratioun fir dee MCP-Server derbäi, wann Dir d'Verbindung erstallt.

Änlech MCP-Serveren

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇