- plugin/mua.plg: <!DOCTYPE PLUGIN> XML mit <FILE Run> + <INLINE> - plugin/plugin.json: Metadaten - scripts/rc.mua: SysVinit-Service (statt systemd) - scripts/plugin.php: WebGUI-Tab (Settings > MUA) - README.md: Aktualisiert - Alte Dateien entfernt (MUA.plg, mua.service, install/update/remove.sh)
103 lines
3.1 KiB
Markdown
103 lines
3.1 KiB
Markdown
# MUA — Mikes Unraid Agent
|
|
|
|
Natives Unraid-Plugin: 21 Docker-, Netzwerk- und System-Tools als MCP-Server (Streamable HTTP) auf Port 3002.
|
|
|
|
## Architektur
|
|
|
|
```
|
|
llama.cpp (196) → HTTP → http://192.168.1.2:3002/mcp (MUA Plugin auf Unraid)
|
|
```
|
|
|
|
Kein SSH, kein Proxy, kein Key-Management (nur URL + API-Key).
|
|
|
|
## Unraid-Plugin-Struktur
|
|
|
|
```
|
|
MUA-Mikes-Unraid-Agent/
|
|
├── plugin/
|
|
│ ├── mua.plg # Unraid-Plugin-File (XML, <!DOCTYPE PLUGIN>)
|
|
│ └── plugin.json # Metadaten (Name, Version, Pfade)
|
|
├── mcp/
|
|
│ ├── server.php # MCP-Server (Streamable HTTP, JSON-RPC 2.0)
|
|
│ ├── helpers.php # Helper-Funktionen (Docker, Netzwerk, System)
|
|
│ ├── tools.php # 21 Tool-Definitionen
|
|
│ └── selftest.php # Selftest (12 Tests)
|
|
├── scripts/
|
|
│ ├── rc.mua # SysVinit-Service-Script
|
|
│ ├── plugin.php # WebGUI-Tab (Settings > MUA)
|
|
│ └── unraid-docker-mcp-helper.php # Write-Operationen (DockerClient)
|
|
└── README.md
|
|
```
|
|
|
|
## Installation
|
|
|
|
### Über Unraid-Plugin-Installer
|
|
|
|
```bash
|
|
# .plg-File herunterladen und installieren
|
|
wget -O /tmp/mua.plg "http://192.168.1.2:4000/michael/MUA-Mikes-Unraid-Agent/raw/branch/main/plugin/mua.plg"
|
|
# Im Unraid-WebGUI: Settings > Plugins > Install from URL
|
|
# URL: http://192.168.1.2:4000/michael/MUA-Mikes-Unraid-Agent/raw/branch/main/plugin/mua.plg
|
|
```
|
|
|
|
### Manuell
|
|
|
|
```bash
|
|
# Repo klonen
|
|
git clone git@192.168.1.2:33/michael/MUA-Mikes-Unraid-Agent.git /tmp/mua
|
|
|
|
# Dateien installieren
|
|
mkdir -p /usr/local/emhttp/plugins/mua/{mcp,scripts}
|
|
cp /tmp/mua/mcp/*.php /usr/local/emhttp/plugins/mua/mcp/
|
|
cp /tmp/mua/scripts/plugin.php /usr/local/emhttp/plugins/mua/
|
|
cp /tmp/mua/scripts/rc.mua /etc/rc.d/rc.mua
|
|
chmod 755 /etc/rc.d/rc.mua
|
|
cp /tmp/mua/scripts/unraid-docker-mcp-helper.php /usr/local/bin/
|
|
chmod 755 /usr/local/bin/unraid-docker-mcp-helper.php
|
|
|
|
# Selftest
|
|
php /usr/local/emhttp/plugins/mua/mcp/selftest.php
|
|
|
|
# Starten
|
|
/etc/rc.d/rc.mua start
|
|
```
|
|
|
|
## Verwaltung
|
|
|
|
| Aktion | Befehl |
|
|
|---|---|
|
|
| Starten | `/etc/rc.d/rc.mua start` |
|
|
| Stoppen | `/etc/rc.d/rc.mua stop` |
|
|
| Neu starten | `/etc/rc.d/rc.mua restart` |
|
|
| Status | `/etc/rc.d/rc.mua status` |
|
|
| Logs | `tail -f /var/log/plugins/mua.log` |
|
|
| WebGUI | Settings > MUA |
|
|
|
|
## MCP-Endpunkt
|
|
|
|
- **URL:** `http://<unraid-ip>:3002/mcp`
|
|
- **Transport:** Streamable HTTP (POST-only)
|
|
- **Protokoll:** JSON-RPC 2.0
|
|
- **Session:** `Mcp-Session-Id` Header
|
|
|
|
## Tools (21)
|
|
|
|
| Kategorie | Tools |
|
|
|---|---|
|
|
| **Docker (14)** | list, inspect, logs, analyze_logs, processes, stats, info, start, stop, restart, create, modify, update, rebuild |
|
|
| **Netzwerk (6)** | inventory, list, inspect, host_state, audit_tcp, lan_probe |
|
|
| **System (1)** | connection_test |
|
|
|
|
## Konformität
|
|
|
|
- ✅ Echte Unraid-Plugin-Struktur (`<!DOCTYPE PLUGIN>`, `<FILE Run="/bin/bash">` + `<INLINE>`)
|
|
- ✅ SysVinit-Service (`/etc/rc.d/rc.mua`) statt systemd
|
|
- ✅ WebGUI-Tab (`launch="Settings/MUA"`)
|
|
- ✅ Standard-Pfade (`/usr/local/emhttp/plugins/mua`, `/boot/config/plugins/mua`)
|
|
- ✅ Selftest (12/12)
|
|
- ✅ PHP 8.4-kompatibel
|
|
|
|
## Lizenz
|
|
|
|
MIT
|