Skip to main content
Glama
index.mdβ€’5.54 kB
# TrueNAS Core MCP Server Production-ready Model Context Protocol (MCP) server for TrueNAS Core - Control your NAS through natural language with Claude and other AI assistants. ## Overview The TrueNAS Core MCP Server enables AI assistants like Claude to interact with your TrueNAS system through natural language, providing: - **Storage Management**: Create, manage, and monitor ZFS pools and datasets - **User Management**: Comprehensive user and group administration - **Sharing**: Configure SMB, NFS, and iSCSI shares - **Snapshots**: Automated snapshot management and scheduling - **Production-Ready**: Built-in caching, rate limiting, metrics, and security ## Key Features ### πŸš€ Performance - **Smart Caching**: Configurable TTL-based caching with LRU eviction - **Rate Limiting**: Token bucket algorithm protects your TrueNAS API - **Connection Pooling**: Efficient HTTP connection management - **Async Architecture**: Fully asynchronous for maximum throughput ### πŸ”’ Security - **Audit Logging**: Complete audit trail of all operations - **Input Validation**: Path traversal and injection protection - **Authentication**: Secure API key management - **Rate Limiting**: Prevent API abuse ### πŸ“Š Observability - **Prometheus Metrics**: Full observability with counters, gauges, and histograms - **Structured Logging**: JSON-formatted logs for easy parsing - **Health Checks**: Built-in health and readiness endpoints - **Performance Tracking**: Detailed timing metrics for all operations ### πŸ›‘οΈ Reliability - **Circuit Breaker**: Automatic failure detection and recovery - **Retry Logic**: Exponential backoff with jitter - **Error Handling**: Comprehensive exception hierarchy - **Type Safety**: Full type hints and Pydantic validation ## Quick Start ### Installation ```bash # Using pip pip install truenas-mcp-server # Using pipx (recommended) pipx install truenas-mcp-server # Using uvx (no installation required) uvx truenas-mcp-server ``` ### Configuration Create a `.env` file: ```env TRUENAS_URL=https://your-truenas-server TRUENAS_API_KEY=your-api-key-here TRUENAS_VERIFY_SSL=true LOG_LEVEL=INFO ENABLE_CACHE=true CACHE_TTL=300 RATE_LIMIT_PER_MINUTE=60 ``` ### Running the Server ```bash truenas-mcp-server ``` ## Architecture ``` β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ Claude / AI Assistant β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ MCP Protocol β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ TrueNAS MCP Server β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Cache β”‚ β”‚ Rate β”‚ β”‚ Metrics β”‚ β”‚ β”‚ β”‚ Layer β”‚ β”‚ Limiter β”‚ β”‚ Collector β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ Tools Layer β”‚ β”‚ β”‚ β”‚ Storage β”‚ Users β”‚ Sharing β”‚ Snapshotsβ”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β”‚ β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ β”‚ β”‚ HTTP Client β”‚ β”‚ β”‚ β”‚ Connection Pool β”‚ Retry β”‚ Auth β”‚ β”‚ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β”‚ HTTPS API β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β” β”‚ TrueNAS Core Server β”‚ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ ``` ## Use Cases ### 1. Storage Management "Create a new dataset named 'backups' on pool 'tank' with compression enabled" ### 2. Snapshot Management "Create a snapshot of tank/data and schedule daily snapshots" ### 3. User Administration "Create a new user 'john' with home directory and add to 'developers' group" ### 4. Share Configuration "Set up an SMB share for /mnt/tank/data accessible by the team" ## Documentation - [Installation Guide](guides/INSTALL.md) - [Quick Start Guide](guides/QUICKSTART.md) - [Feature Overview](FEATURES.md) - [API Reference](api/client.md) - [Troubleshooting](troubleshooting.md) ## Requirements - Python 3.10 or higher - TrueNAS Core 13.0 or higher - Valid TrueNAS API key ## Contributing See [CONTRIBUTING.md](CONTRIBUTING.md) for development guidelines. ## License MIT License - see [LICENSE](https://github.com/vespo92/TrueNasCoreMCP/blob/main/LICENSE) ## Support - GitHub Issues: https://github.com/vespo92/TrueNasCoreMCP/issues - Documentation: https://github.com/vespo92/TrueNasCoreMCP/wiki

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/vespo92/TrueNasCoreMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server