From ffae4116a8d58a820f1770c41c69dafe4d51c881 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Sat, 12 Sep 2026 14:57:22 -0400 Subject: [PATCH] refac --- backend/open_webui/utils/mcp/client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/backend/open_webui/utils/mcp/client.py b/backend/open_webui/utils/mcp/client.py index 39b7ae3b8e..29e67f04fb 100644 --- a/backend/open_webui/utils/mcp/client.py +++ b/backend/open_webui/utils/mcp/client.py @@ -89,8 +89,14 @@ class MCPClient: if not self.session: raise RuntimeError('MCP client is not connected.') - result = await self.session.list_tools() - tools = result.tools + tools = [] + cursor = None + while True: + result = await self.session.list_tools(cursor=cursor) + tools.extend(result.tools) + cursor = result.nextCursor + if cursor is None: + break tool_specs = [] for tool in tools: