fix MCPHub group publishing and recovery

This commit is contained in:
Mikei386
2026-08-26 11:42:39 +02:00
parent 167448d778
commit 9ae7d22618
5 changed files with 67 additions and 4 deletions
+37
View File
@@ -82,6 +82,42 @@ def registry_servers(registry: pathlib.Path, secrets_dir: pathlib.Path,
return result
def ensure_hermes_group(settings: dict[str, object]) -> None:
"""Seed the bounded Hermes aggregate route on fresh installs/recovery."""
server_names = [
"mcphub-admin", "athena-operator", "github", "arr", "navidrome",
"deemix", "unraid",
]
members: list[dict[str, object]] = [
{"name": name, "tools": "all", "prompts": "all", "resources": "all"}
for name in server_names
]
members.append({
"name": "fritzbox",
"tools": ["list_services", "list_actions", "describe_action", "call_action"],
"prompts": [],
"resources": [],
})
groups = settings.setdefault("groups", [])
if not isinstance(groups, list):
groups = []
settings["groups"] = groups
current = next(
(group for group in groups
if isinstance(group, dict) and group.get("name") == "hermes"),
None,
)
if current is None:
current = {
"id": str(uuid.uuid4()),
"owner": "system",
"name": "hermes",
}
groups.append(current)
current["description"] = "Gefilterte zentrale MCP-Auswahl für alle Hermes-Clients"
current["servers"] = members
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("settings", type=pathlib.Path)
@@ -114,6 +150,7 @@ def main() -> None:
}
settings["mcpServers"] = servers
ensure_hermes_group(settings)
settings.setdefault("users", [])
token_path = args.settings.parent / "client-token"
keys = settings.setdefault("bearerKeys", [])