--- Menu="OtherSettings" Type="xmenu" Title="MUA" Icon="cubes" --- true, CURLOPT_TIMEOUT => 3, CURLOPT_CONNECTTIMEOUT => 2, ]); $health = curl_exec($ch); $health_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $health_ok = ($health_code === 200); // ── Config vom Config-Server laden (Port 3003) ────────────────────────── $config = null; $ch = curl_init('http://127.0.0.1:' . $config_port . '/config'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 3, CURLOPT_CONNECTTIMEOUT => 2, ]); $config_raw = curl_exec($ch); $config_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($config_code === 200 && $config_raw !== false) { $config = json_decode($config_raw, true); } $api_key = $config['apiKey'] ?? ''; $enabled_tools = $config['enabledTools'] ?? []; $all_tools = $config['allTools'] ?? []; $config_ok = ($config !== null); // ── POST-Handling (Einstellungen speichern) ───────────────────────────── $flash_msg = ''; $flash_type = ''; if ($_SERVER['REQUEST_METHOD'] === 'POST') { $payload = []; // A) API-Key generieren if (isset($_POST['action']) && $_POST['action'] === 'generate_key') { $payload['generate'] = true; } // B) Tool-Checkboxen if (isset($_POST['action']) && $_POST['action'] === 'save_tools') { $selected = []; foreach ($all_tools as $tool) { if (isset($_POST['tool_' . $tool])) { $selected[] = $tool; } } $payload['enabledTools'] = $selected; } if (!empty($payload)) { $ch = curl_init('http://127.0.0.1:' . $config_port . '/config'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 5, CURLOPT_CONNECTTIMEOUT => 3, CURLOPT_POST => true, CURLOPT_POSTFIELDS => json_encode($payload), CURLOPT_HTTPHEADER => ['Content-Type: application/json'], ]); $resp_raw = curl_exec($ch); $resp_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); $resp = json_decode($resp_raw, true); if ($resp_code === 200 && isset($resp['ok'])) { // Config neu laden $ch = curl_init('http://127.0.0.1:' . $config_port . '/config'); curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 3, CURLOPT_CONNECTTIMEOUT => 2, ]); $config_raw = curl_exec($ch); curl_close($ch); $config = json_decode($config_raw, true); $api_key = $config['apiKey'] ?? ''; $enabled_tools = $config['enabledTools'] ?? []; if ($payload['generate'] ?? false) { $flash_msg = 'Neuer API-Key generiert.'; $flash_type = 'ok'; } else { $flash_msg = 'Tool-Einstellungen gespeichert (' . count($selected) . ' von ' . count($all_tools) . ' aktiv).'; $flash_type = 'ok'; } } else { $flash_msg = 'Fehler beim Speichern (HTTP ' . $resp_code . ')'; $flash_type = 'err'; } } } $binary_exists = file_exists($binary); $host_ip = $_SERVER['SERVER_ADDR'] ?? '127.0.0.1'; // Tool-Gruppierung für die Checkbox-Liste $tool_groups = [ 'Docker' => [ 'unraid_docker_list', 'unraid_docker_inspect', 'unraid_docker_logs', 'unraid_docker_analyze_logs', 'unraid_docker_processes', 'unraid_docker_stats', 'unraid_docker_info', 'unraid_docker_start', 'unraid_docker_stop', 'unraid_docker_restart', 'unraid_docker_create', 'unraid_docker_modify', 'unraid_docker_update', 'unraid_docker_rebuild', ], 'Netzwerk' => [ 'unraid_network_inventory', 'unraid_network_list', 'unraid_network_inspect', 'unraid_network_host_state', 'unraid_network_audit_tcp', 'unraid_network_lan_probe', ], 'System' => [ 'unraid_system_connection_test', ], ]; ?>
✅ MCP-Server läuft (PID , Port )
❌ MCP-Server läuft nicht — starte mit /etc/rc.d/rc.mua start
✅ Health-Check: OK
⚠️ Health-Check: HTTP
⚠️ Health-Check: nicht erreichbar

MCP-Endpunkt

Transport: Streamable HTTP (POST-only) · JSON-RPC 2.0

API-Key (Authentifizierung)

✅ API-Key aktiv — Clients müssen diesen als Bearer-Token senden

API-Key:***

Authorization-Header: Authorization: Bearer *** htmlspecialchars($api_key) ?>

Beispiel (curl):
curl -X POST -H "Authorization: Bearer *** htmlspecialchars($api_key) ?>" -H "Content-Type: application/json" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}'

⚠️ Kein API-Key gesetzt. Generiere einen, um den MCP-Endpunkt zu schützen.
⚠️ Config-Server nicht erreichbar (Port ). Starte den MCP-Server, um die Einstellungen zu verwalten.

Tools (aktivieren / deaktivieren)

. Deaktivierte Tools werden nicht in tools/list angezeigt und bei tools/call abgelehnt.

$group_tools): ?>

()

⚠️ Tool-Liste nicht verfügbar (Config-Server nicht erreichbar).

Details

PluginMUA (Mikes Unraid Agent)
Version2026.08.18.r003
RuntimeTypeScript (Bun Runtime, kompiliertes Binary)
Binary
Port (MCP)
Port (Config) (nur localhost)
Host-IP
Tools (Docker: 14, Netzwerk: 6, System: 1)
Plugin-Verzeichnis
Service/etc/rc.d/rc.mua (SysVinit)

Verwaltung

AktionBefehl
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
Logstail -f /var/log/plugins/mua.log