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: