mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-22 19:30:15 +01:00
refactor: Update convertMCPToolsToPlugins to use mcpManager for server configuration and adjust related tests
This commit is contained in:
parent
b2b2aee945
commit
e7af3bdaed
4 changed files with 110 additions and 66 deletions
|
|
@ -106,7 +106,9 @@ const getAvailableTools = async (req, res) => {
|
|||
const cache = getLogStores(CacheKeys.CONFIG_STORE);
|
||||
const cachedToolsArray = await cache.get(CacheKeys.TOOLS);
|
||||
const cachedUserTools = await getCachedTools({ userId });
|
||||
const userPlugins = convertMCPToolsToPlugins({ functionTools: cachedUserTools, customConfig });
|
||||
|
||||
const mcpManager = getMCPManager();
|
||||
const userPlugins = convertMCPToolsToPlugins({ functionTools: cachedUserTools, mcpManager });
|
||||
|
||||
if (cachedToolsArray != null && userPlugins != null) {
|
||||
const dedupedTools = filterUniquePlugins([...userPlugins, ...cachedToolsArray]);
|
||||
|
|
@ -117,7 +119,6 @@ const getAvailableTools = async (req, res) => {
|
|||
let pluginManifest = availableTools;
|
||||
if (customConfig?.mcpServers != null) {
|
||||
try {
|
||||
const mcpManager = getMCPManager();
|
||||
const flowsCache = getLogStores(CacheKeys.FLOWS);
|
||||
const flowManager = flowsCache ? getFlowStateManager(flowsCache) : null;
|
||||
const serverToolsCallback = createServerToolsCallback();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue