FastAPI-based documentation web server that automatically generates comprehensive documentation from your AppDaemon automation files. Features real-time file monitoring, modern web interface, and AI agent integration through MCP (Model Context Protocol).
This containerized service transforms your AppDaemon Python automation files into beautiful, searchable documentation with automatic generation, real-time updates, and professional presentation. The service provides both web-based access and programmatic access through MCP for AI agents.
- 🚀 Auto-Generation - Automatically creates documentation from AppDaemon Python files on startup
- 👀 Real-Time Monitoring - Watches for file changes and regenerates documentation automatically
- 🔄 Live Updates - WebSocket integration provides instant notifications of changes
- 📱 Modern Web Interface - Responsive design with syntax highlighting and search
- 🔍 Full-Text Search - Built-in search functionality across all documentation
- 🤖 MCP Integration - AI agent support through Model Context Protocol
- 📈 Health Monitoring - Comprehensive status reporting and error tracking
- 🎨 CSS Foundation - Cross-browser compatibility with normalize, custom properties, and optimized typography
- 🐳 Docker Ready - Production-ready containerized deployment
For local development and testing:
git clone <repository-url>
cd appdaemon-docs-server
uv syncCreate a .dev_env file with your configuration:
# Example .dev_env file
APPS_DIR=/path/to/your/appdaemon/apps
HOST=127.0.0.1
PORT=8080
LOG_LEVEL=info
RELOAD=true
FORCE_REGENERATE=false
ENABLE_FILE_WATCHER=true
WATCH_DEBOUNCE_DELAY=2.0Run the development server:
uv run server/run-dev.pyThe server will be available at http://127.0.0.1:8080
See DEVELOPMENT.md for detailed local development instructions.
docker build -t appdaemon-docs-server .docker run -d \
--name appdaemon-docs \
-p 8080:8080 \
-e APPS_DIR=/app/appdaemon-apps \
-v /path/to/your/appdaemon/apps:/app/appdaemon-apps:ro \
appdaemon-docs-serverWindows Users: Path syntax varies by shell:
Git Bash/WSL/MSYS:
# Windows with Git Bash/WSL
docker run -d \
--name appdaemon-docs \
-p 8080:8080 \
-e APPS_DIR=/app/appdaemon-apps \
-v //c/Users/username/appdaemon/apps:/app/appdaemon-apps:ro \
appdaemon-docs-serverPowerShell/CMD:
# Windows PowerShell/CMD
docker run -d `
--name appdaemon-docs `
-p 8080:8080 `
-e APPS_DIR=/app/appdaemon-apps `
-v C:/Users/username/appdaemon/apps:/app/appdaemon-apps:ro `
appdaemon-docs-serverUse the provided docker-compose.yml file and customize the volume path:
services:
appdaemon-docs-server:
build:
context: .
dockerfile: Dockerfile
container_name: appdaemon-docs-server
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- /path/to/your/appdaemon/apps:/app/appdaemon-apps:ro
environment:
- APPS_DIR=/app/appdaemon-apps
- HOST=0.0.0.0
- PORT=8080
- LOG_LEVEL=info
- FORCE_REGENERATE=false
- ENABLE_FILE_WATCHER=true
- WATCH_DEBOUNCE_DELAY=2.0Start the service:
docker compose up -dAccess your documentation at http://localhost:8080
All configuration is handled through environment variables:
| Variable | Description | Example |
|---|---|---|
APPS_DIR |
Path to AppDaemon source files | /app/appdaemon-apps |
| Variable | Default | Description |
|---|---|---|
HOST |
0.0.0.0 |
Server bind address |
PORT |
8080 |
Server port |
LOG_LEVEL |
info |
Logging level (debug, info, warning, error) |
RELOAD |
false |
Enable auto-reload for development |
FORCE_REGENERATE |
false |
Force regenerate all docs on startup |
ENABLE_FILE_WATCHER |
true |
Enable real-time file monitoring |
WATCH_DEBOUNCE_DELAY |
2.0 |
Delay before processing file changes (seconds) |
WATCH_MAX_RETRIES |
3 |
Maximum retry attempts for failed generations |
WATCH_FORCE_REGENERATE |
false |
Force regenerate on file changes |
WATCH_LOG_LEVEL |
info |
File watcher log level (debug, info, warning, error) |
RECURSIVE_SCAN |
false |
Scan and watch nested subdirectories for .py files (increases CPU usage and file handles) |
MARKDOWN_CACHE_SIZE |
128 |
Maximum number of markdown files to cache in memory (higher values increase RAM usage but improve performance) |
APP_TITLE |
AppDaemon Documentation Server |
Application title |
APP_DESCRIPTION |
Web interface for AppDaemon... |
Application description |
APP_ENV |
production |
Runtime environment - accepted values: production (default, security hardened), development/dev/debug (enables debug features) |
EXPOSE_ABS_PATHS_IN_API |
false |
Include absolute filesystem paths in API responses (only works when APP_ENV=development/dev/debug) |
- Startup - Service scans your AppDaemon apps directory for Python files
- Generation - Creates comprehensive markdown documentation for each automation file
- Web Interface - Serves documentation through FastAPI with modern UI
- File Watching - Monitors for changes and regenerates documentation automatically
- Real-time Updates - WebSocket connections notify browsers of changes instantly
- Documentation Index - Browse all generated documentation files at
/docs/ - Individual Files - View specific documentation at
/docs/{filename} - Search - Full-text search across all documentation
- Syntax Highlighting - Python code blocks with proper formatting
- Responsive Design - Works on desktop, tablet, and mobile devices
/- Redirects to documentation index/docs/- Main documentation index page/docs/{filename}- Individual documentation file viewer/health- Service health check endpoint
# Health and status
GET /health # Service health check
GET /api/watcher/status # File watcher status
GET /api/ws/status # WebSocket connection status
# Documentation access
GET /api/files # List all documentation files
GET /api/file/{filename} # Get processed file content
GET /api/search?q=query # Search documentation
# Manual operations
POST /api/generate/all?force=true # Force regenerate all documentation
POST /api/generate/file/{filename}?force=true # Regenerate specific file# Real-time updates
WS /ws # WebSocket for live updates# Model Context Protocol for AI agents
GET/POST /mcp/ # MCP HTTP endpoint
GET /mcp/sse # MCP Server-Sent EventsThe service includes built-in Model Context Protocol (MCP) support for AI agent integration.
The server automatically generates MCP tools from FastAPI endpoints with short, descriptive names:
- health - Check server health and status
- list_files - List all available documentation files
- get_file - Get content of a specific documentation file
- search_docs - Search through documentation content
- generate_all - Regenerate all documentation files
- generate_file - Regenerate a specific documentation file
- ws_status - Get WebSocket connection status
- watcher_status - Get file watcher status
- broadcast_test - Send test message to WebSocket clients
Tool names are based on custom operation IDs for brevity and clarity.
To connect an MCP-compatible AI agent:
-
Verify server is running:
# Check server health curl http://your-server-ip:port/health # Test MCP connection directly npx mcp-remote your-server-ip:port/mcp --allow-http
-
Configure Claude Code CLI with the MCP server:
For Local Server:
{ "mcpServers": { "appdaemon-docs-local": { "command": "npx", "args": [ "mcp-remote", "http://localhost:8080/mcp" ] } } }For Remote Server:
{ "mcpServers": { "appdaemon-docs": { "command": "npx", "args": [ "mcp-remote", "http://your-server-ip:port/mcp", "--allow-http" ] } } }Note: The
--allow-httpflag is required when connecting to remote HTTP servers (non-HTTPS). -
Test the connection by asking Claude to list your automation files
- Code Understanding - AI can analyze your automation logic and suggest improvements
- Documentation Search - Natural language queries to find relevant automations
- Development Help - Get assistance with debugging and new automation patterns
- Architecture Analysis - Understand relationships between automation modules
The project includes comprehensive test suites:
# Run all tests
uv run pytest
# Run specific test categories
uv run pytest server/tests/api/ # API functionality tests
uv run pytest server/tests/ui/ # UI and accessibility tests
# Run with coverage
uv run pytest --cov=server- API Tests - Documentation generation, file watching, and API endpoints
- UI Tests - Color contrast, accessibility, and interface functionality using Playwright
{
"status": "healthy",
"service": "appdaemon-docs-server",
"version": "1.0.0",
"docs_directory_exists": true,
"apps_directory_exists": true,
"docs_files_count": 45,
"startup_generation_completed": true,
"file_watcher_active": true,
"startup_errors_count": 0,
"startup_errors": [],
"uptime": "running"
}healthy- Service operational, documentation currentstarting- Service initializing, generation in progressdegraded- Service operational with some generation errorsunhealthy- Critical errors preventing operation
# Check overall health
curl http://localhost:8080/health
# Monitor file watcher
curl http://localhost:8080/api/watcher/status
# Check WebSocket status
curl http://localhost:8080/api/ws/status
# Count documentation files
curl http://localhost:8080/api/files | jq '.total_count'- CPU: 1+ cores (2+ recommended for production)
- Memory: 256MB minimum, 512MB recommended
- Storage: 100MB + size of generated documentation
- Network: HTTP/HTTPS access for web interface
For large AppDaemon installations:
environment:
- WATCH_DEBOUNCE_DELAY=5.0 # Reduce CPU usage during file changes
- FORCE_REGENERATE=false # Faster startup times
- LOG_LEVEL=warning # Reduce log verbosity
- MARKDOWN_CACHE_SIZE=256 # Increase cache for better performance with large doc sets
- RECURSIVE_SCAN=false # Disable deep directory scanning for better performance
- WATCH_LOG_LEVEL=warning # Reduce file watcher log verbosity-
Network Environment -
⚠️ This server must run in a local or trusted network environment only- Error logs may expose potentially sensitive information from AppDaemon configuration
- The
apps_configobject can contain secrets fromapps.yamlincluding tokens, API keys, URLs, and other sensitive configuration data - Do not expose this service to untrusted networks or the public internet
- Consider using VPN or private network access for remote monitoring
-
Read-Only Mounts - Always mount AppDaemon apps directory as read-only (
:ro) -
Non-Root User - Container runs as non-root user (UID 1000)
-
Network Access - Consider firewall rules for port 8080
-
MCP Access - MCP integration provides full API access including documentation regeneration capabilities
-
External Directory Access - When using external paths, the server will detect and warn about:
- Unrestricted filesystem access outside the repository
- Read-only vs read-write mount status
- Security implications of external path usage
-
Absolute Path Exposure - Filesystem paths are protected in production environments:
- Development Mode (Safe): Set both
APP_ENV=developmentandEXPOSE_ABS_PATHS_IN_API=trueto include absolute paths in API responses for debugging - Production Mode (Secure): Default
APP_ENV=productionblocks absolute path exposure regardless ofEXPOSE_ABS_PATHS_IN_APIsetting - Security Gate: The
APP_ENVcheck is hard-disabled in production to prevent information disclosure about server filesystem structure
Example - Safe Development Configuration:
environment: - APP_ENV=development # Enables development features - EXPOSE_ABS_PATHS_IN_API=true # Shows absolute paths in API
Example - Secure Production Configuration:
environment: - APP_ENV=production # Default, blocks absolute paths - EXPOSE_ABS_PATHS_IN_API=false # Ignored in production anyway
- Development Mode (Safe): Set both
Service won't start:
- Check that
APPS_DIRenvironment variable is set - Verify the apps directory exists and is readable
- Check Docker logs:
docker logs appdaemon-docs-server
Documentation not generating:
- Ensure AppDaemon files exist in the mounted directory
- Check file permissions on the apps directory
- Force regeneration:
curl -X POST http://localhost:8080/api/generate/all?force=true
File watcher not working:
- Verify
ENABLE_FILE_WATCHER=trueis set - Check watcher status:
curl http://localhost:8080/api/watcher/status - Review container logs for file system events
MCP integration issues:
- Test MCP endpoint:
curl http://localhost:8080/mcp/ - Verify AI agent configuration includes correct URL
- Check server logs for MCP-related errors
Enable detailed logging for troubleshooting:
environment:
- LOG_LEVEL=debug
- WATCH_LOG_LEVEL=debugThis project provides documentation generation services for AppDaemon automation systems.