by vespo92
Provides natural-language driven management and automation of TrueNAS Core storage resources via MCP, supporting user, pool, dataset, share, and snapshot operations.
Enables control of TrueNAS Core systems through natural language commands, exposing the full set of storage‑related actions (users, pools, datasets, shares, snapshots) via the Model Context Protocol.
uvx
:
uvx truenas-mcp-server
or install globally with uv tool install truenas-mcp-server
, pip install truenas-mcp-server
, or pipx install truenas-mcp-server
..env
file (or set environment variables) with the required keys:
TRUENAS_URL=https://your-truenas-server.local
TRUENAS_API_KEY=your-api-key-here
Optional settings control SSL verification, log level, timeouts, and destructive‑operation toggles.uvx truenas-mcp-server
)..env
or OS variables.Q: Do I need to expose my TrueNAS API key publicly?
A: No. Store the key in environment variables or a .env
file; never commit it to source control.
Q: Can I run the server on Windows?
A: Yes, as long as Python 3.10+ is installed. Use the same uvx
/pip
commands in a PowerShell or CMD session.
Q: How do I enable destructive operations like delete?
A: Set TRUENAS_ENABLE_DESTRUCTIVE_OPS=true
in your environment. It defaults to false
for safety.
Q: Is TLS verification required?
A: In production you should keep TRUENAS_VERIFY_SSL=true
. For local testing you can disable it with false
.
Q: What clients can talk to this server? A: Any MCP‑compatible client, such as Claude Desktop, custom Python scripts using the provided SDK, or other language bindings.
A production-ready Model Context Protocol (MCP) server for TrueNAS Core systems. Control and manage your TrueNAS storage through natural language with Claude or other MCP-compatible clients.
The easiest way to run TrueNAS MCP Server is with uvx:
# Run directly without installation
uvx truenas-mcp-server
# Or install globally with uv
uv tool install truenas-mcp-server
# With pip
pip install truenas-mcp-server
# Or with pipx for isolated environment
pipx install truenas-mcp-server
git clone https://github.com/vespo92/TrueNasCoreMCP.git
cd TrueNasCoreMCP
pip install -e .
Create a .env
file or set environment variables:
# Required
TRUENAS_URL=https://your-truenas-server.local
TRUENAS_API_KEY=your-api-key-here
# Optional
TRUENAS_VERIFY_SSL=true # Verify SSL certificates
TRUENAS_LOG_LEVEL=INFO # Logging level
TRUENAS_ENV=production # Environment (development/staging/production)
TRUENAS_HTTP_TIMEOUT=30 # HTTP timeout in seconds
TRUENAS_ENABLE_DESTRUCTIVE_OPS=false # Enable delete operations
TRUENAS_ENABLE_DEBUG_TOOLS=false # Enable debug tools
Add to your Claude Desktop config (claude_desktop_config.json
):
{
"mcpServers": {
"truenas": {
"command": "uvx",
"args": ["truenas-mcp-server"],
"env": {
"TRUENAS_URL": "https://your-truenas-server.local",
"TRUENAS_API_KEY": "your-api-key-here",
"TRUENAS_VERIFY_SSL": "false"
}
}
}
}
Note: This uses uvx
to automatically manage the Python environment. Make sure you have uv installed:
# Install uv if you haven't already
curl -LsSf https://astral.sh/uv/install.sh | sh
# or
brew install uv
Once configured, you can interact with TrueNAS using natural language:
"List all storage pools and their health status"
"Create a new dataset called 'backups' in the tank pool with compression"
"Set up an SMB share for the documents dataset"
"Create a snapshot of all datasets in the tank pool"
"Show me users who have sudo privileges"
from truenas_mcp_server import TrueNASMCPServer
# Create server instance
server = TrueNASMCPServer()
# Run the server
server.run()
import asyncio
from truenas_mcp_server.client import TrueNASClient
from truenas_mcp_server.config import Settings
async def main():
# Initialize client
settings = Settings(
truenas_url="https://truenas.local",
truenas_api_key="your-api-key"
)
async with TrueNASClient(settings) as client:
# List pools
pools = await client.get("/pool")
print(f"Found {len(pools)} pools")
# Create a dataset
dataset = await client.post("/pool/dataset", {
"name": "tank/mydata",
"compression": "lz4"
})
print(f"Created dataset: {dataset['name']}")
asyncio.run(main())
list_users
- List all users with detailsget_user
- Get specific user informationcreate_user
- Create new user accountupdate_user
- Modify user propertiesdelete_user
- Remove user accountlist_pools
- Show all storage poolsget_pool_status
- Detailed pool health and statisticslist_datasets
- List all datasetscreate_dataset
- Create new dataset with optionsupdate_dataset
- Modify dataset propertiesdelete_dataset
- Remove datasetlist_smb_shares
- Show SMB/CIFS sharescreate_smb_share
- Create Windows sharelist_nfs_exports
- Show NFS exportscreate_nfs_export
- Create NFS exportlist_iscsi_targets
- Show iSCSI targetscreate_iscsi_target
- Create iSCSI targetlist_snapshots
- Show snapshotscreate_snapshot
- Create manual snapshotdelete_snapshot
- Remove snapshotrollback_snapshot
- Revert to snapshotclone_snapshot
- Clone to new datasetcreate_snapshot_task
- Setup automated snapshotsdebug_connection
- Check connection settingstest_connection
- Verify API connectivityget_server_stats
- Server statisticstruenas_mcp_server/
├── __init__.py # Package initialization
├── server.py # Main MCP server
├── config/ # Configuration management
│ ├── __init__.py
│ └── settings.py # Pydantic settings
├── client/ # HTTP client
│ ├── __init__.py
│ └── http_client.py # Async HTTP with retry
├── models/ # Data models
│ ├── __init__.py
│ ├── base.py # Base models
│ ├── user.py # User models
│ ├── storage.py # Storage models
│ └── sharing.py # Share models
├── tools/ # MCP tools
│ ├── __init__.py
│ ├── base.py # Base tool class
│ ├── users.py # User tools
│ ├── storage.py # Storage tools
│ ├── sharing.py # Share tools
│ └── snapshots.py # Snapshot tools
└── exceptions.py # Custom exceptions
# Clone repository
git clone https://github.com/vespo92/TrueNasCoreMCP.git
cd TrueNasCoreMCP
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e ".[dev]"
# Run all tests
pytest
# With coverage
pytest --cov=truenas_mcp_server
# Specific test file
pytest tests/test_client.py
# Format code
black truenas_mcp_server
# Lint
flake8 truenas_mcp_server
# Type checking
mypy truenas_mcp_server
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ for the TrueNAS community
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "truenas": { "command": "uvx", "args": [ "truenas-mcp-server" ], "env": { "TRUENAS_URL": "https://your-truenas-server.local", "TRUENAS_API_KEY": "<YOUR_API_KEY>" } } } }
Explore related MCPs that share similar capabilities and solve comparable challenges
by zed-industries
A high‑performance, multiplayer code editor designed for speed and collaboration.
by modelcontextprotocol
Model Context Protocol Servers
by modelcontextprotocol
A Model Context Protocol server for Git repository interaction and automation.
by modelcontextprotocol
A Model Context Protocol server that provides time and timezone conversion capabilities.
by cline
An autonomous coding assistant that can create and edit files, execute terminal commands, and interact with a browser directly from your IDE, operating step‑by‑step with explicit user permission.
by continuedev
Enables faster shipping of code by integrating continuous AI agents across IDEs, terminals, and CI pipelines, offering chat, edit, autocomplete, and customizable agent workflows.
by upstash
Provides up-to-date, version‑specific library documentation and code examples directly inside LLM prompts, eliminating outdated information and hallucinated APIs.
by github
Connects AI tools directly to GitHub, enabling natural‑language interactions for repository browsing, issue and pull‑request management, CI/CD monitoring, code‑security analysis, and team collaboration.
by daytonaio
Provides a secure, elastic infrastructure that creates isolated sandboxes for running AI‑generated code with sub‑90 ms startup, unlimited persistence, and OCI/Docker compatibility.