From ee1d9255fcd434a7233d4bd0443382e5fb1612f6 Mon Sep 17 00:00:00 2001 From: Classic298 <27028174+Classic298@users.noreply.github.com> Date: Sun, 11 Oct 2026 19:06:11 +0200 Subject: [PATCH] fix: MCP server connection failures are not logged at the default log level (#32229) When an MCP tool server fails to connect during a chat, the chat shows "Failed to connect to MCP server" but the reason was only logged at debug level, so it never appeared in the logs of a default install. The failure is now logged as an error with the full cause, such as a refused connection or a 401 from the server. The message in the chat is unchanged. Fixes #32213 --- backend/open_webui/utils/middleware.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 6eca511252..fe967019a8 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -3085,8 +3085,8 @@ async def process_chat_payload(request, form_data, user, metadata, model): 'client': client, 'direct': False, } - except Exception as e: - log.debug(e) + except Exception: + log.exception("Failed to connect to MCP server '%s'", server_id) if event_emitter: await event_emitter( {