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
This commit is contained in:
Classic298 2026-10-11 19:06:11 +02:00 • committed by GitHub
parent 1283b2701e
commit ee1d9255fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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(
{