truenas-ws-mcp
An MCP (Model Context Protocol) server for TrueNAS Scale that connects via the native WebSocket API. Gives AI assistants like Claude full visibility and control over your TrueNAS homelab — storage pools, datasets, apps, VMs, snapshots, SMART tests, and more.
Features
- 61 tools covering storage, apps, VMs, snapshots, sharing, networking, SMART, cloud sync, and system management
- Native WebSocket DDP protocol (same as the TrueNAS UI uses)
- Works with TrueNAS Scale 24.10+ (Dragonfish and newer)
- Runs as a standard MCP server via
stdiotransport
Quick Start
Install
# With uv (recommended)
uvx truenas-ws-mcp
# With pip
pip install truenas-ws-mcp
Configure
Set these environment variables (or create a .env file):
| Variable | Required | Default | Description |
|---|---|---|---|
TRUENAS_API_KEY |
Yes | — | API key from TrueNAS (System > API Keys) |
TRUENAS_URL |
No | wss://truenas.local/websocket |
WebSocket URL of your TrueNAS instance |
TRUENAS_VERIFY_SSL |
No | false |
SSL certificate verification |
TRUENAS_TIMEOUT |
No | 30 |
API call timeout in seconds |
The URL is flexible — you can pass https://192.168.1.100, wss://truenas.local/websocket, or just a hostname. It will be normalized automatically.
Add to Claude Code
{
"mcpServers": {
"truenas": {
"command": "uvx",
"args": ["truenas-ws-mcp"],
"env": {
"TRUENAS_API_KEY": "your-api-key-here",
"TRUENAS_URL": "wss://your-truenas-ip/websocket"
}
}
}
}
Add to Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"truenas": {
"command": "uvx",
"args": ["truenas-ws-mcp"],
"env": {
"TRUENAS_API_KEY": "your-api-key-here",
"TRUENAS_URL": "wss://your-truenas-ip/websocket"
}
}
}
}
Available Tools
Storage (8 tools)
list_pools, get_pool_status, list_datasets, get_dataset, create_dataset, update_dataset, delete_dataset
Snapshots (6 tools)
list_snapshots, create_snapshot, delete_snapshot, rollback_snapshot, clone_snapshot, list_snapshot_tasks
Apps (10 tools)
list_apps, get_app_config, update_app_config, install_app, delete_app, start_app, stop_app, upgrade_app, redeploy_app, list_available_apps
VMs (4 tools)
list_vms, start_vm, stop_vm, update_vm
Sharing (6 tools)
list_smb_shares, create_smb_share, delete_smb_share, list_nfs_exports, create_nfs_export, delete_nfs_export
System (7 tools)
system_info, list_alerts, list_services, list_jobs, get_audit_log, list_cron_jobs, get_boot_pool
Disks & SMART (4 tools)
list_disks, get_disk_temps, list_smart_results, run_smart_test
Network (2 tools)
list_interfaces, get_network_config
Cloud & Replication (4 tools)
list_cloud_syncs, run_cloud_sync, list_replications, run_replication
Reporting (2 tools)
list_graphs, get_reporting_data
Users (5 tools)
list_users, get_user, create_user, update_user, delete_user
Updates & Certs (2 tools)
check_updates, list_certificates
Important Notes
- App config updates are REPLACE, not MERGE. When using
update_app_config, send ALL storage/config keys — omitted keys revert to defaults. - VM RAM/CPU changes require a full stop+start from TrueNAS. Rebooting from inside the VM does NOT re-allocate resources.
- Destructive operations (delete dataset, snapshot, share, user, app) require
confirm=Trueas a safety guard. - Self-signed certs are common in homelabs. SSL verification is off by default.
Development
git clone https://github.com/thoriphes/truenas-ws-mcp.git
cd truenas-ws-mcp
uv sync
cp env.example .env
# Edit .env with your TrueNAS credentials
uv run pytest
License
MIT
Metadata
Release files for truenas-ws-mcp 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| truenas_ws_mcp-0.1.1.tar.gz | 77.6 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| truenas_ws_mcp-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 94.0 kB
Release files / truenas_ws_mcp-0.1.1.tar.gz
| Download URL | truenas_ws_mcp-0.1.1.tar.gz |
|---|---|
| Size | 77.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
25d58668651e555a704fd85584ae170168321ab216dc0d039ddd99b8f74b5b51
|
|
BLAKE2b-256 checksum How to use checksums |
1214a5ea464aa390f1931bc63c4dd52200e82befb224aea3f9a13d7f52366beb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / truenas_ws_mcp-0.1.1-py3-none-any.whl
| Download URL | truenas_ws_mcp-0.1.1-py3-none-any.whl |
|---|---|
| Size | 16.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
53b8ad0f1505286d76f0428bca4d81eaa389b46606500f2f6e5bda9253a632fe
|
|
BLAKE2b-256 checksum How to use checksums |
608e7db04b74b75069d0f14a5dd09b1614a04447a927018cde7b0ac10604a554
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.10.12 {"installer":{"name":"uv","version":"0.10.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for truenas-ws-mcp 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.