MUA v1.0.0 — Mikes Unraid Agent
Natives Unraid-Plugin: 21 Docker-, Netzwerk- und System-Tools als MCP-Server (Streamable HTTP) auf Port 3002. - mcp/server.php: MCP-Server (JSON-RPC 2.0, Streamable HTTP) - mcp/helpers.php: Lokale Tool-Implementierungen (kein SSH) - mcp/tools.php: 21 Tool-Definitionen - mcp/selftest.php: Selftest (12 Checks) - scripts/unraid-docker-mcp-helper.php: Write-Operationen - scripts/mua.service: systemd-Service - scripts/install.sh, update.sh, remove.sh: Plugin-Scripts - MUA.plg: Plugin-Manifest
This commit is contained in:
@@ -0,0 +1,140 @@
|
||||
# MUA — Mikes Unraid Agent
|
||||
|
||||
Natives Unraid-Plugin, das 21 Docker-, Netzwerk- und System-Tools als **MCP-Server** (Model Context Protocol) über **HTTP (Streamable HTTP)** exponiert.
|
||||
|
||||
Läuft **lokal auf dem Unraid-Host** — kein SSH, kein Proxy, kein Key-Management.
|
||||
|
||||
## Endpunkt
|
||||
|
||||
```
|
||||
http://<unraid-ip>:3002/mcp
|
||||
```
|
||||
|
||||
- **POST** `/mcp` — JSON-RPC 2.0 (MCP-Requests)
|
||||
- **GET** `/health` — Health-Check
|
||||
- **DELETE** `/mcp` — Session-End
|
||||
|
||||
## Tools (21)
|
||||
|
||||
### Docker (14)
|
||||
| Tool | Beschreibung |
|
||||
|------|-------------|
|
||||
| `unraid_docker_list` | Alle Container mit Runtime-Stats |
|
||||
| `unraid_docker_inspect` | Container-Details |
|
||||
| `unraid_docker_logs` | Container-Logs |
|
||||
| `unraid_docker_analyze_logs` | Log-Analyse (server-seitig) |
|
||||
| `unraid_docker_processes` | Prozesse im Container |
|
||||
| `unraid_docker_stats` | Live-Stats (CPU/RAM/Net) |
|
||||
| `unraid_docker_info` | Docker-Daemon-Info |
|
||||
| `unraid_docker_start` | Container starten |
|
||||
| `unraid_docker_stop` | Container stoppen |
|
||||
| `unraid_docker_restart` | Container neu starten |
|
||||
| `unraid_docker_create` | Container aus Template |
|
||||
| `unraid_docker_modify` | Template ändern |
|
||||
| `unraid_docker_update` | Container aktualisieren |
|
||||
| `unraid_docker_rebuild` | Container neu bauen |
|
||||
|
||||
### Netzwerk (6)
|
||||
| Tool | Beschreibung |
|
||||
|------|-------------|
|
||||
| `unraid_network_inventory` | Netzwerk-Inventur |
|
||||
| `unraid_network_list` | Alle Netzwerke |
|
||||
| `unraid_network_inspect` | Netzwerk-Details |
|
||||
| `unraid_network_host_state` | Host-Netzwerk-Zustand |
|
||||
| `unraid_network_audit_tcp` | TCP-Endpunkte auditieren |
|
||||
| `unraid_network_lan_probe` | Dualstack-Probe |
|
||||
|
||||
### System (1)
|
||||
| Tool | Beschreibung |
|
||||
|------|-------------|
|
||||
| `unraid_system_connection_test` | Verbindungstest |
|
||||
|
||||
## Installation
|
||||
|
||||
### Via Community Apps (Link)
|
||||
1. Community Apps öffnen
|
||||
2. "Add Plugin" → Link: `https://git-192.168.1.2:33/michael/MUA-Mikes-Unraid-Agent`
|
||||
3. Installieren
|
||||
|
||||
### Manuell
|
||||
```bash
|
||||
# Dateien kopieren
|
||||
mkdir -p /usr/local/plugins/mua
|
||||
cp -r mcp scripts /usr/local/plugins/mua/
|
||||
|
||||
# Helper installieren
|
||||
cp scripts/unraid-docker-mcp-helper.php /usr/local/bin/
|
||||
chmod 755 /usr/local/bin/unraid-docker-mcp-helper.php
|
||||
|
||||
# Service installieren
|
||||
cp scripts/mua.service /etc/systemd/system/
|
||||
systemctl daemon-reload
|
||||
systemctl enable --now mua.service
|
||||
|
||||
# Health-Check
|
||||
curl http://127.0.0.1:3002/health
|
||||
```
|
||||
|
||||
## Anbindung an MCP-Client
|
||||
|
||||
### Beispiel: Hermes Agent (config.yaml)
|
||||
```yaml
|
||||
mcp_servers:
|
||||
mua:
|
||||
url: http://192.168.1.2:3002/mcp
|
||||
transport: http
|
||||
```
|
||||
|
||||
### Beispiel: curl
|
||||
```bash
|
||||
# Initialize
|
||||
curl -X POST http://192.168.1.2:3002/mcp \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
|
||||
|
||||
# Tools auflisten
|
||||
curl -X POST http://192.168.1.2:3002/mcp \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Mcp-Session-Id: <session-id>" \
|
||||
-d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'
|
||||
|
||||
# Tool aufrufen
|
||||
curl -X POST http://192.168.1.2:3002/mcp \
|
||||
-H "Content-Type: application/json" \
|
||||
-H "Mcp-Session-Id: <session-id>" \
|
||||
-d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"unraid_docker_list","arguments":{}}}'
|
||||
```
|
||||
|
||||
## Selftest
|
||||
|
||||
```bash
|
||||
php /usr/local/plugins/mua/mcp/selftest.php
|
||||
```
|
||||
|
||||
## Architektur
|
||||
|
||||
```
|
||||
MCP-Client (z.B. llama.cpp auf 196)
|
||||
│
|
||||
│ HTTP (Streamable HTTP)
|
||||
▼
|
||||
http://192.168.1.2:3002/mcp (MUA Plugin auf Unraid)
|
||||
│
|
||||
│ lokal (kein SSH)
|
||||
▼
|
||||
/usr/bin/docker, /usr/bin/ip, /usr/bin/ss, /usr/bin/php
|
||||
```
|
||||
|
||||
## Port
|
||||
|
||||
- **3002** (3000 ist belegt von `theippenguin/unraid-mcp`)
|
||||
|
||||
## Git
|
||||
|
||||
- Repo: `michael/MUA-Mikes-Unraid-Agent.git`
|
||||
- Zugang: `git@192.168.1.2:33` (SSH-Key `ha_agent`)
|
||||
- Updates: Neuer Commit + Push
|
||||
|
||||
## Lizenz
|
||||
|
||||
MIT
|
||||
Reference in New Issue
Block a user