Feat: add MCP dashboard operations (#8460)

### What problem does this PR solve?

Add MCP server dashboard operations.

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
Yongteng Lei
2025-06-25 09:26:04 +08:00
committed by GitHub
parent 18fd7983f1
commit af6850c8d8
7 changed files with 193 additions and 72 deletions

View File

@ -116,4 +116,14 @@ def is_valid_url(url: str) -> bool:
return False
except socket.gaierror:
return False
return True
return True
def safe_json_parse(data: str | dict) -> dict:
if isinstance(data, dict):
return data
try:
return json.loads(data) if data else {}
except (json.JSONDecodeError, TypeError):
return {}