Align documentation and Docker configuration with current implementation

- Fix README.md: Make Docker deployment recommended, remove duplicate installation section
- Fix Dockerfile: Copy correct source files (unraid_mcp/, uv.lock, README.md) instead of non-existent unraid_mcp_server.py
- Update docker-compose.yml: Enable build configuration and use .env instead of .env.local
- Add missing environment variables to .env.example and .env: UNRAID_AUTO_START_SUBSCRIPTIONS, UNRAID_MAX_RECONNECT_ATTEMPTS
- Fix CLAUDE.md: Correct environment hierarchy documentation (../env.local → ../.env.local)
- Remove unused unraid-schema.json file

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Jacob Magar
2025-08-13 06:53:56 -04:00
parent 493a376640
commit 4ef65eb5e1
6 changed files with 85 additions and 71 deletions

View File

@@ -24,8 +24,14 @@ UNRAID_MCP_LOG_FILE=unraid-mcp.log # Log file name (saved to logs/ directory)
# Set to a file path to use a custom CA bundle # Set to a file path to use a custom CA bundle
UNRAID_VERIFY_SSL=true UNRAID_VERIFY_SSL=true
# Optional: Subscription Auto-start Log Path # Real-time Subscription Configuration
# ------------------------------------------ # ------------------------------------
# Custom log file path for subscription auto-start diagnostics # Enable automatic subscription startup (true/false)
UNRAID_AUTO_START_SUBSCRIPTIONS=true
# Maximum WebSocket reconnection attempts (numeric)
UNRAID_MAX_RECONNECT_ATTEMPTS=10
# Optional: Custom log file path for subscription auto-start diagnostics
# Defaults to standard log if not specified # Defaults to standard log if not specified
# UNRAID_AUTOSTART_LOG_PATH=/custom/path/to/autostart.log # UNRAID_AUTOSTART_LOG_PATH=/custom/path/to/autostart.log

View File

@@ -98,7 +98,7 @@ docker-compose down
### Environment Variable Hierarchy ### Environment Variable Hierarchy
The server loads environment variables from multiple locations in order: The server loads environment variables from multiple locations in order:
1. `/app/.env.local` (container mount) 1. `/app/.env.local` (container mount)
2. `../env.local` (project root) 2. `../.env.local` (project root)
3. `../.env` (project root) 3. `../.env` (project root)
4. `.env` (local directory) 4. `.env` (local directory)

View File

@@ -7,12 +7,16 @@ WORKDIR /app
# Install uv # Install uv
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
# Copy the project files # Copy dependency files
COPY pyproject.toml . COPY pyproject.toml .
COPY unraid_mcp_server.py . COPY uv.lock .
COPY README.md .
# Install dependencies # Copy the source code
RUN uv sync --frozen --no-dev COPY unraid_mcp/ ./unraid_mcp/
# Install dependencies and the package
RUN uv sync --frozen
# Make port UNRAID_MCP_PORT available to the world outside this container # Make port UNRAID_MCP_PORT available to the world outside this container
# Defaulting to 6970, but can be overridden by environment variable # Defaulting to 6970, but can be overridden by environment variable

117
README.md
View File

@@ -25,7 +25,6 @@
- [Installation](#-installation) - [Installation](#-installation)
- [Configuration](#-configuration) - [Configuration](#-configuration)
- [Available Tools & Resources](#-available-tools--resources) - [Available Tools & Resources](#-available-tools--resources)
- [Docker Deployment](#-docker-deployment)
- [Development](#-development) - [Development](#-development)
- [Architecture](#-architecture) - [Architecture](#-architecture)
- [Troubleshooting](#-troubleshooting) - [Troubleshooting](#-troubleshooting)
@@ -35,51 +34,94 @@
## 🚀 Quick Start ## 🚀 Quick Start
### Prerequisites ### Prerequisites
- Python 3.10+ - Docker and Docker Compose (recommended)
- [uv](https://github.com/astral-sh/uv) package manager - OR Python 3.10+ with [uv](https://github.com/astral-sh/uv) for development
- Unraid server with GraphQL API enabled - Unraid server with GraphQL API enabled
### 1. Installation ### 1. Clone Repository
```bash ```bash
git clone https://github.com/jmagar/unraid-mcp git clone https://github.com/jmagar/unraid-mcp
cd unraid-mcp cd unraid-mcp
uv sync
``` ```
### 2. Configuration ### 2. Configure Environment
```bash ```bash
cp .env.example .env cp .env.example .env
# Edit .env with your Unraid details # Edit .env with your Unraid API details
``` ```
### 3. Run ### 3. Deploy with Docker (Recommended)
```bash ```bash
# Using uv script (recommended) # Start with Docker Compose
uv run unraid-mcp-server docker compose up -d
# Using development script (with hot reload) # View logs
docker compose logs -f unraid-mcp
```
### OR 3. Run for Development
```bash
# Install dependencies
uv sync
# Run development server
./dev.sh ./dev.sh
# Using module syntax
uv run -m unraid_mcp.main
``` ```
--- ---
## 📦 Installation ## 📦 Installation
### Using uv (Recommended) ### 🐳 Docker Deployment (Recommended)
The easiest way to run the Unraid MCP Server is with Docker:
```bash ```bash
# Install dependencies # Clone and configure
git clone https://github.com/jmagar/unraid-mcp
cd unraid-mcp
cp .env.example .env
# Edit .env with your Unraid API details
# Deploy with Docker Compose
docker compose up -d
# View logs
docker compose logs -f unraid-mcp
```
#### Manual Docker Build
```bash
# Build and run manually
docker build -t unraid-mcp-server .
docker run -d --name unraid-mcp \
--restart unless-stopped \
-p 6970:6970 \
--env-file .env \
unraid-mcp-server
```
### 🔧 Development Installation
For development and testing:
```bash
# Clone repository
git clone https://github.com/jmagar/unraid-mcp
cd unraid-mcp
# Install dependencies with uv
uv sync uv sync
# Install development dependencies # Install development dependencies
uv sync --group dev uv sync --group dev
```
### Manual Installation # Configure environment
```bash cp .env.example .env
pip install -r requirements.txt # If you have a requirements.txt # Edit .env with your settings
# Run development server
./dev.sh
``` ```
--- ---
@@ -170,41 +212,6 @@ UNRAID_VERIFY_SSL=true # true, false, or path to CA bundle
--- ---
## 🐳 Docker Deployment
### Using Docker Compose (Recommended)
1. **Prepare Environment**
```bash
cp .env.example .env.local
# Edit .env.local with your settings
```
2. **Start Services**
```bash
docker compose up -d
```
3. **View Logs**
```bash
docker compose logs -f unraid-mcp
```
### Manual Docker
```bash
# Build image
docker build -t unraid-mcp-server .
# Run container
docker run -d --name unraid-mcp \
--restart unless-stopped \
-p 6970:6970 \
--env-file .env.local \
unraid-mcp-server
```
---
## 🔧 Development ## 🔧 Development

View File

@@ -1,10 +1,8 @@
services: services:
unraid-mcp: unraid-mcp:
image: unraid-mcp-server # Assumes you've built this image locally using 'docker build -t unraid-mcp-server .' build:
# Or, to build automatically if the image doesn't exist: context: .
# build: dockerfile: Dockerfile
# context: .
# dockerfile: Dockerfile
container_name: unraid-mcp container_name: unraid-mcp
restart: unless-stopped restart: unless-stopped
ports: ports:
@@ -12,7 +10,7 @@ services:
# Change the host port (left side) if 6970 is already in use on your host # Change the host port (left side) if 6970 is already in use on your host
- "6970:6970" - "6970:6970"
env_file: env_file:
- .env.local # Loads environment variables from .env.local in the same directory as this docker-compose.yml - .env # Loads environment variables from .env in the same directory as this docker-compose.yml
# Optional: If you want to mount a specific directory for logs (ensure UNRAID_MCP_LOG_FILE in .env.local points within this mount) # Optional: If you want to mount a specific directory for logs (ensure UNRAID_MCP_LOG_FILE in .env points within this mount)
# volumes: # volumes:
# - ./logs:/app/logs # Example: maps ./logs on host to /app/logs in container # - ./logs:/app/logs # Example: maps ./logs on host to /app/logs in container

File diff suppressed because one or more lines are too long