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