mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
🔄 refactor: Optimize MCP Tool Initialization
🔄 refactor: Optimize MCP Tool Initialization
fix: update tool caching to use separated mcp logic
refactor: Replace `req.user` with `userId` in MCP handling functions
refactor: Replace `req` parameter with `userId` in file search tool functions
fix: Update user connection parameter to use object format in reinitMCPServer
refactor: Simplify MCP tool creation logic and improve handling of tool configurations to avoid capturing too much in closures
refactor: ensure MCP available tools are fetched from cache only when needed
This commit is contained in:
parent
386900fb4f
commit
5b1a31ef4d
15 changed files with 111 additions and 134 deletions
|
|
@ -5,7 +5,11 @@
|
|||
const { logger } = require('@librechat/data-schemas');
|
||||
const { Constants } = require('librechat-data-provider');
|
||||
const { convertMCPToolToPlugin } = require('@librechat/api');
|
||||
const { getAppConfig, getMCPServerTools } = require('~/server/services/Config');
|
||||
const {
|
||||
cacheMCPServerTools,
|
||||
getMCPServerTools,
|
||||
getAppConfig,
|
||||
} = require('~/server/services/Config');
|
||||
const { getMCPManager } = require('~/config');
|
||||
|
||||
/**
|
||||
|
|
@ -49,7 +53,6 @@ const getMCPTools = async (req, res) => {
|
|||
|
||||
// Cache server tools if found
|
||||
if (Object.keys(serverTools).length > 0) {
|
||||
const { cacheMCPServerTools } = require('~/server/services/Config');
|
||||
await cacheMCPServerTools({ serverName, serverTools });
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue