fix(settings): guard paperclip mcp.json type + sort registrations
This commit is contained in:
@@ -60,7 +60,16 @@ def _read_paperclip_registrations() -> list[dict[str, Any]]:
|
||||
instance_dir.name, e,
|
||||
)
|
||||
continue
|
||||
for name, cfg in (data.get("mcpServers") or data or {}).items():
|
||||
if not isinstance(data, dict):
|
||||
logger.warning(
|
||||
"paperclip_mcp_json_unexpected_type: %s type=%s",
|
||||
instance_dir.name, type(data).__name__,
|
||||
)
|
||||
continue
|
||||
servers = data.get("mcpServers") or data
|
||||
if not isinstance(servers, dict):
|
||||
continue
|
||||
for name, cfg in servers.items():
|
||||
if not isinstance(cfg, dict):
|
||||
continue
|
||||
out.append(_normalize(f"Paperclip ({instance_dir.name})", name, cfg))
|
||||
@@ -87,9 +96,11 @@ def list_registrations() -> dict[str, Any]:
|
||||
"error": "host_path_unavailable",
|
||||
"message": "תיקיית /host לא mounted. ראה runbook להגדרת volumes ב-Coolify.",
|
||||
}
|
||||
return {
|
||||
"registrations": (
|
||||
registrations = (
|
||||
_read_claude_registrations() + _read_paperclip_registrations()
|
||||
),
|
||||
)
|
||||
registrations.sort(key=lambda r: (r["client"], r["server_name"]))
|
||||
return {
|
||||
"registrations": registrations,
|
||||
"error": None,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user