Add managed Deemix MCP integration
This commit is contained in:
Executable → Regular
+38
-2
@@ -38,12 +38,14 @@ rm -f "$volume_path/webui.db-wal" "$volume_path/webui.db-shm"
|
||||
|
||||
navidrome_enabled=false
|
||||
[[ -s /etc/mike-ai/navidrome-mcp.env ]] && navidrome_enabled=true
|
||||
deemix_enabled=false
|
||||
[[ -s /etc/mike-ai/deemix-mcp.env ]] && deemix_enabled=true
|
||||
github_enabled=false
|
||||
if [[ -s /etc/mike-ai/github-mcp.env ]] && \
|
||||
grep -Eq '^GITHUB_PERSONAL_ACCESS_TOKEN=.+$' /etc/mike-ai/github-mcp.env; then
|
||||
github_enabled=true
|
||||
fi
|
||||
python3 - "$db" "$FILTER_DIR" "$ACTION_DIR" "${OPENWEBUI_FILTER_OWNER_ID:-}" "$navidrome_enabled" "$github_enabled" "$MUA_MCP_ENV_FILE" <<'PY'
|
||||
python3 - "$db" "$FILTER_DIR" "$ACTION_DIR" "${OPENWEBUI_FILTER_OWNER_ID:-}" "$navidrome_enabled" "$github_enabled" "$deemix_enabled" "$MUA_MCP_ENV_FILE" <<'PY'
|
||||
import json
|
||||
import copy
|
||||
import pathlib
|
||||
@@ -53,10 +55,11 @@ import time
|
||||
|
||||
(
|
||||
db, filter_dir, action_dir, requested_owner, navidrome_enabled_raw,
|
||||
github_enabled_raw, mua_mcp_env_file,
|
||||
github_enabled_raw, deemix_enabled_raw, mua_mcp_env_file,
|
||||
) = sys.argv[1:]
|
||||
navidrome_enabled = navidrome_enabled_raw.lower() == "true"
|
||||
github_enabled = github_enabled_raw.lower() == "true"
|
||||
deemix_enabled = deemix_enabled_raw.lower() == "true"
|
||||
con = sqlite3.connect(db)
|
||||
columns = {row[1] for row in con.execute("pragma table_info(function)")}
|
||||
required = {
|
||||
@@ -238,6 +241,13 @@ with con:
|
||||
"Websuche oder Audioausgabe auf dem KI-Host. Wegen des großen Werkzeugkatalogs "
|
||||
"nur bei Musikaufgaben aktivieren.",
|
||||
),
|
||||
"deemix-local": (
|
||||
"Deemix (bestehende Unraid-Instanz)",
|
||||
"Durchsucht Deezer über die vorhandene Deemix-Instanz auf Unraid und "
|
||||
"verwaltet deren Download-Queue. Keine zweite Deemix-Instanz. Schreibende "
|
||||
"Queue-Aktionen nur auf ausdrücklichen Benutzerauftrag; Status und Suche "
|
||||
"sind read-only.",
|
||||
),
|
||||
"github-local": (
|
||||
"GitHub Repository (offiziell, read-only)",
|
||||
"Für Repository-Suche, echte Datei-Inhalte und gezielte "
|
||||
@@ -282,6 +292,8 @@ with con:
|
||||
match = "navidrome-local"
|
||||
elif "mike-ai-mcp-github" in url:
|
||||
match = "github-local"
|
||||
elif "mike-ai-mcp-deemix" in url:
|
||||
match = "deemix-local"
|
||||
elif "mike-ai-mcp-athena-operator" in url:
|
||||
match = "athena-operator-local"
|
||||
else:
|
||||
@@ -408,6 +420,30 @@ with con:
|
||||
}
|
||||
)
|
||||
changed = True
|
||||
if deemix_enabled and not any(
|
||||
isinstance(connection, dict)
|
||||
and (
|
||||
str(connection.get("url", "")).lower()
|
||||
== "http://mike-ai-mcp-deemix:8000/mcp"
|
||||
or str((connection.get("info") or {}).get("id", "")).lower()
|
||||
== "deemix-local"
|
||||
)
|
||||
for connection in connections
|
||||
):
|
||||
name, description = descriptions["deemix-local"]
|
||||
connections.append(
|
||||
{
|
||||
"url": "http://mike-ai-mcp-deemix:8000/mcp",
|
||||
"path": "",
|
||||
"type": "mcp",
|
||||
"auth_type": "none",
|
||||
"headers": None,
|
||||
"key": "",
|
||||
"config": {"enable": True, "access_grants": []},
|
||||
"info": {"id": "deemix-local", "name": name, "description": description},
|
||||
}
|
||||
)
|
||||
changed = True
|
||||
if not any(
|
||||
isinstance(connection, dict)
|
||||
and (
|
||||
|
||||
Reference in New Issue
Block a user