fix MCPHub group publishing and recovery
This commit is contained in:
@@ -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", [])
|
||||
|
||||
Reference in New Issue
Block a user