MCPcopy
hub / github.com/AstrBotDevs/AstrBot / _normalize_server_config

Function _normalize_server_config

astrbot/dashboard/api/tools.py:59–71  ·  view source on GitHub ↗
(body: dict[str, Any], id_key: str)

Source from the content-addressed store, hash-verified

57
58
59def _normalize_server_config(body: dict[str, Any], id_key: str) -> dict[str, Any]:
60 config = body.get("config")
61 if isinstance(config, dict):
62 normalized = dict(config)
63 else:
64 normalized = {
65 key: value
66 for key, value in body.items()
67 if key not in {id_key, "config", "enabled", "mcp_server_config"}
68 }
69 if "enabled" in body and "active" not in normalized:
70 normalized["active"] = body["enabled"]
71 return normalized
72
73
74def _server_name_from_body(body: dict[str, Any]) -> str:

Callers 1

_update_mcp_serverFunction · 0.85

Calls 2

getMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected