Unraid MCP Server

by jmagar
Verified
# Progress: Unraid MCP Server ## What Works - Project structure created - Python environment set up - Dependencies installed (mcp, aiohttp, python-dotenv) - Unraid API client implementation with improved error handling - MCP server implementation (resources and tools) - Enhanced error handling and diagnostics - Added new resources (shares, plugins) - Added templated resources for individual VMs and containers - Improved resource URIs based on FastMCP examples - Improved documentation and logging - Server implementation with stdio transport mode exclusively - Successfully integrated with Claude using mcpServers configuration - Tested resource access and tool execution through Claude - Fixed timeout issues with disk operations - Resolved GraphQL schema validation errors - Enhanced logging system with both console and file outputs - Fixed Docker container tools to use direct query execution - Converted to read-only tools for security: - User information tools (get_users) - API key information tools (get_api_keys) - Unassigned devices tools (get_unassigned_devices) - Parity history tools (get_parity_history) - Removed all potentially dangerous tools and methods: - System management tools (shutdown_server, reboot_server) - Array management tools (start_array, stop_array) - Disk management tools (mount_disk, unmount_disk) - User management tools (add_user, delete_user) - API key management tools (create_api_key) - Remote access configuration tools - Updated README with proper JSON configuration for stdio mode - Organized available tools by category in README for better readability - Updated "Use at Your Own Risk" disclaimer to emphasize read-only nature - Modified code to use stdio transport exclusively - Commented out all SSE-related code to simplify the codebase - Improved all tools with proper human-readable formatting: - Added consistent formatting patterns across all tools - Used emojis and clear section headers for better readability - Organized information in a logical, easy-to-read format - Added status indicators (🟢/🔴) for running/stopped services - Included summary statistics where applicable - Improved error messages with more context - Removed duplicate tools to simplify the codebase: - Removed `get_vms` (keeping the formatted `list_vms`) - Removed `get_array_status` (keeping the formatted `format_array_status`) - Removed `get_docker_containers` (keeping the formatted `list_containers`) - Removed `archive_notification` (was not working correctly) ## What's Left to Build 1. **Project Structure** - [x] Create directory structure - [x] Set up requirements.txt - [x] Create .env template 2. **Unraid API Client** - [x] Implement UnraidClient class - [x] Add GraphQL query execution functionality - [x] Add error handling - [x] Add enhanced query logging and debugging - [x] Fix timeout issues with long-running operations - [x] Improve handling of nested GraphQL fields - [x] Convert to read-only operations for security 3. **MCP Server Implementation** - [x] Set up FastMCP server - [x] Implement system information resource - [x] Implement Docker container resources - [ ] Implement container management tools (start/stop) - Not supported by Unraid API - [x] Implement array management resources - [x] Implement VM resources - [x] Implement additional tools - [x] Implement proper error diagnostics - [x] Add logging support - [x] Add templated resources for individual items - [x] Fix schema validation errors in disk and Docker tools - [x] Implement user information tools (read-only) - [x] Implement API key information tools (read-only) - [x] Implement unassigned devices tools - [x] Implement parity history tools - [x] Modify code to use stdio transport exclusively - [x] Remove all potentially dangerous tools and methods - [x] Improve all tools with proper human-readable formatting - [x] Remove duplicate tools to simplify the codebase 4. **Documentation** - [x] Create README.md - [x] Add installation instructions - [x] Add usage examples - [x] Add testing instructions - [x] Document available resources and tools - [x] Add stdio mode integration instructions - [x] Add JSON configuration examples - [x] Organize tools by category for better readability - [x] Add "Use at Your Own Risk" disclaimer - [x] Update documentation to reflect read-only nature 5. **Testing** - [x] Test with Claude - [x] Address issues found during Claude/Cline integration - [x] Test fixed disk and Docker tools with real Unraid server - [x] Verify stdio mode integration works correctly - [x] Test all tools with proper human-readable formatting 6. **Claude/Cline Integration** - [x] Create proper MCP settings configuration - [x] Configure server to use stdio transport exclusively - [x] Implement optional ctx parameter for tools - [x] Add enhanced logging for Claude/Cline integration - [x] Test resources and tools through Cline ## Progress Status - Project structure and implementation complete - Improvements based on FastMCP examples and Unraid API documentation implemented - Added standard resource URI structure following FastMCP patterns - Added templated resources for individual items (VMs, containers) - Added server implementation with stdio transport mode exclusively - Enhanced error handling and logging - Successfully integrated with Claude/Cline - Verified resources access working correctly with actual Unraid server - Successfully connected to Claude using mcpServers JSON configuration - Tested end-to-end functionality with Claude - Fixed critical issues with disk operations and GraphQL schema validation - Improved Docker container tools functionality - Enhanced logging system with both console and file outputs - Converted to read-only tools for security (user information, API key information, unassigned devices, parity history) - Removed all potentially dangerous tools and methods - Updated README with proper JSON configuration for stdio mode integration - Organized available tools by category for better readability - Updated "Use at Your Own Risk" disclaimer to emphasize read-only nature - Modified code to use stdio transport exclusively - Commented out all SSE-related code to simplify the codebase - Improved all tools with proper human-readable formatting - Removed duplicate tools to simplify the codebase ## Next Steps - Continue testing and improving the read-only tools with various configurations - Implement additional Unraid API features as they become available (read-only only) - Add authentication and security features to the MCP server - Implement advanced features like caching - Create Docker container for easy deployment