unraid mcp
A Python-based server that enables AI assistants to interact with an Unraid server through the official Unraid GraphQL API, providing read-only access to system information, Docker containers, VMs, storage, and more.
A Python-based server that enables AI assistants to interact with an Unraid server through the official Unraid GraphQL API, providing read-only access to system information, Docker containers, VMs, storage, and more.
A Python-based MCP (Model Context Protocol) server that enables AI assistants to interact with an Unraid server through the official Unraid GraphQL API.
USE AT YOUR OWN RISK: This software provides access to your Unraid server through AI assistants. While this implementation is configured as read-only to enhance safety, you should still exercise caution when using it.
Even with read-only access, monitoring tools can potentially expose sensitive system information. By using this software, you acknowledge and accept these limitations and risks.
To install Unraid MCP Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @jmagar/unraid-mcp --client claude
Clone the repository:
git clone https://github.com/jmagar/unraid-mcp.git
cd unraid-mcp
Create and activate a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venvScriptsactivate
Install dependencies:
pip install -r requirements.txt
Create a .env
file with your Unraid API credentials:
cp .env.template .env
# Edit .env with your actual API URL and key
To use this MCP server, you need to set up the Unraid API on your Unraid server:
Enable developer mode and the GraphQL sandbox using the CLI:
unraid-api developer
Follow the prompts to enable the sandbox.
Create an API key with the necessary permissions:
unraid-api apikey --create
Follow the prompts to set the name, description, roles, and permissions.
Configure your .env
file with:
UNRAID_API_URL
: The GraphQL URL (e.g., http://your-unraid-server-ip/graphql
)UNRAID_API_KEY
: The API key you created
Test the API using the GraphQL sandbox at http://your-unraid-server-ip/graphql
Note: The Unraid API uses the
x-api-key
header for authentication, not Bearer tokens.
Origin
header that matches the server's URL.Run the server in stdio mode for integration with AI assistants:
# Run in stdio mode (for direct integration with AI assistants)
python run_server.py
The stdio mode is useful for: - Direct integration with AI assistants that support the MCP protocol - Testing with the Anthropic Python SDK - Integration with Claude in Cursor
When running in stdio mode, the server reads from standard input and writes to standard output, following the MCP protocol format. This allows for direct communication with AI assistants without requiring HTTP transport.
The server is built using the FastMCP framework and consists of:
unraid_client.py
):Provides consistent error reporting
MCP Server (server.py
):
Resource URI | Description |
---|---|
unraid://system/info |
System information (CPU, memory, uptime) |
unraid://system/plugins |
Installed plugins |
unraid://docker/containers |
List of all Docker containers |
unraid://docker/{container_name} |
Details of a specific container |
unraid://array/status |
Current array status |
unraid://vms/list |
List of all virtual machines |
unraid://vms/{vm_name} |
Details of a specific VM |
unraid://storage/shares |
User shares information |
Tool Name | Description |
---|---|
get_system_info |
Get detailed system information |
get_network_info |
Get network interface information |
Tool Name | Description |
---|---|
get_array_status |
Get array status in a human-readable way |
get_parity_history |
Get parity check history |
Tool Name | Description |
---|---|
get_docker_containers |
Get information about Docker containers |
get_docker_networks |
Get information about Docker networks |
list_containers |
List Docker containers in a human-readable way |
Tool Name | Description |
---|---|
get_vms |
Get information about virtual machines |
get_vm_details |
Get detailed information about a specific VM |
list_vms |
List virtual machines in a human-readable way |
Tool Name | Description |
---|---|
get_notifications |
Get notifications from the Unraid server |
create_notification |
Create a new notification |
archive_notification |
Archive a notification |
Tool Name | Description |
---|---|
get_shares |
Get information about network shares |
get_share_details |
Get detailed information about a specific share |
Tool Name | Description |
---|---|
get_disks |
Get information about all disks |
get_disk_details |
Get information about a specific disk |
get_unassigned_devices |
Get information about unassigned devices |
Tool Name | Description |
---|---|
get_users |
Get information about all users |
Tool Name | Description |
---|---|
get_api_keys |
Get information about all API keys |
To use the MCP server with Claude API or other AI assistants that support stdio mode:
unraid_mcp_config.json
):
{
"mcpServers": {
"unraid": {
"command": "/path/to/python",
"args": ["/path/to/unraid-mcp/run_server.py"],
"env": {
"UNRAID_API_URL": "http://your-unraid-server:port/graphql",
"UNRAID_API_KEY": "your-api-key",
"LOG_LEVEL": "INFO",
"CLAUDE_MCP_SERVER": "true"
},
"disabled": false,
"autoApprove": []
}
}
}
Note: For Windows users, make sure to use double backslashes in paths (e.g.,
C:Usersusernameunraid-mcprun_server.py
)
Check the log file (unraid_mcp.log
) for detailed error information.
Common issues:
- Incorrect API URL or key in .env
file
- Network connectivity issues to Unraid server
- Insufficient permissions for the API key
- Developer mode not enabled on Unraid server
- API key not having the necessary roles
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.