| 1 | from helpers.api import ApiHandler, Request, Response |
| 2 | |
| 3 | from typing import Any |
| 4 | |
| 5 | from helpers.mcp_handler import MCPConfig |
| 6 | |
| 7 | |
| 8 | class McpServersStatuss(ApiHandler): |
| 9 | async def process(self, input: dict[Any, Any], request: Request) -> dict[Any, Any] | Response: |
| 10 | |
| 11 | # try: |
| 12 | project_name = (input or {}).get("project_name") if isinstance(input, dict) else None |
| 13 | config = MCPConfig.get_project_instance(project_name) if project_name else MCPConfig.get_instance() |
| 14 | status = config.get_servers_status() |
| 15 | return {"success": True, "status": status} |
| 16 | # except Exception as e: |
| 17 | # return {"success": False, "error": str(e)} |