From 77659afa9e77a99b8cb944a8efd8fc6780ee6573 Mon Sep 17 00:00:00 2001 From: "Jokob @NetAlertX" <96159884+jokob-sk@users.noreply.github.com> Date: Mon, 8 Dec 2025 01:43:32 +0000 Subject: [PATCH] removal of circular call Signed-off-by: GitHub --- server/api_server/mcp_endpoint.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/api_server/mcp_endpoint.py b/server/api_server/mcp_endpoint.py index e9e07bee..130324c8 100644 --- a/server/api_server/mcp_endpoint.py +++ b/server/api_server/mcp_endpoint.py @@ -67,9 +67,10 @@ def get_openapi_spec(): if _openapi_spec_cache: return _openapi_spec_cache try: - r = requests.get(f"{API_BASE_URL}/mcp/openapi.json", timeout=10) - r.raise_for_status() - _openapi_spec_cache = r.json() + # Call the openapi_spec function directly instead of making HTTP request + # to avoid circular requests and authorization issues + response = openapi_spec() + _openapi_spec_cache = response.get_json() return _openapi_spec_cache except Exception as e: mylog("none", [f"[MCP] Failed to fetch OpenAPI spec: {e}"])