mirror of
https://github.com/agent0ai/agent-zero.git
synced 2026-07-09 17:08:29 +00:00
Add project-scoped MCP server configuration with global/project merge semantics, a richer settings UI, and chat composer access. Introduce MCP config scanning plus project-aware status/detail/log/apply APIs while preserving the raw JSON editor. Strengthen MCP runtime handling for dotted tool names, timeouts, status accuracy, and project-aware tool execution, with focused regression coverage.
19 lines
832 B
Python
19 lines
832 B
Python
from helpers.api import ApiHandler, Request, Response
|
|
from typing import Any
|
|
|
|
from helpers.mcp_handler import MCPConfig
|
|
|
|
|
|
class McpServerGetDetail(ApiHandler):
|
|
async def process(self, input: dict[Any, Any], request: Request) -> dict[Any, Any] | Response:
|
|
|
|
# try:
|
|
server_name = input.get("server_name")
|
|
project_name = str(input.get("project_name", "") or "").strip()
|
|
if not server_name:
|
|
return {"success": False, "error": "Missing server_name"}
|
|
config = MCPConfig.get_project_instance(project_name) if project_name else MCPConfig.get_instance()
|
|
detail = config.get_server_detail(server_name)
|
|
return {"success": True, "detail": detail}
|
|
# except Exception as e:
|
|
# return {"success": False, "error": str(e)}
|