Revert "🚉 feat: MCP Registry Individual Server Init (#9887)"
Some checks are pending
Docker Dev Branch Images Build / build (Dockerfile, lc-dev, node) (push) Waiting to run
Docker Dev Branch Images Build / build (Dockerfile.multi, lc-dev-api, api-build) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile, librechat-dev, node) (push) Waiting to run
Docker Dev Images Build / build (Dockerfile.multi, librechat-dev-api, api-build) (push) Waiting to run
Sync Locize Translations & Create Translation PR / Sync Translation Keys with Locize (push) Waiting to run
Sync Locize Translations & Create Translation PR / Create Translation PR on Version Published (push) Blocked by required conditions

This reverts commit b8720a9b7a.
This commit is contained in:
Danny Avila 2025-09-30 09:39:19 -04:00
parent dfe236acb5
commit 4777bd22c5
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
6 changed files with 81 additions and 257 deletions

View file

@ -38,7 +38,7 @@ export class MCPManager extends UserConnectionManager {
/** Initializes the MCPManager by setting up server registry and app connections */
public async initialize() {
await this.serversRegistry.initialize();
this.appConnections = new ConnectionsRepository(this.serversRegistry.appServerConfigs);
this.appConnections = new ConnectionsRepository(this.serversRegistry.appServerConfigs!);
}
/** Retrieves an app-level or user-specific connection based on provided arguments */
@ -63,23 +63,22 @@ export class MCPManager extends UserConnectionManager {
}
/** Get servers that require OAuth */
public getOAuthServers(): Set<string> {
return this.serversRegistry.oauthServers;
public getOAuthServers(): Set<string> | null {
return this.serversRegistry.oauthServers!;
}
/** Get all servers */
public getAllServers(): t.MCPServers {
return this.serversRegistry.rawConfigs;
public getAllServers(): t.MCPServers | null {
return this.serversRegistry.rawConfigs!;
}
/** Returns all available tool functions from app-level connections */
public getAppToolFunctions(): t.LCAvailableTools {
return this.serversRegistry.toolFunctions;
public getAppToolFunctions(): t.LCAvailableTools | null {
return this.serversRegistry.toolFunctions!;
}
/** Returns all available tool functions from all connections available to user */
public async getAllToolFunctions(userId: string): Promise<t.LCAvailableTools | null> {
const allToolFunctions: t.LCAvailableTools = this.getAppToolFunctions();
const allToolFunctions: t.LCAvailableTools = this.getAppToolFunctions() ?? {};
const userConnections = this.getUserConnections(userId);
if (!userConnections || userConnections.size === 0) {
return allToolFunctions;
@ -129,7 +128,7 @@ export class MCPManager extends UserConnectionManager {
* @returns Object mapping server names to their instructions
*/
public getInstructions(serverNames?: string[]): Record<string, string> {
const instructions = this.serversRegistry.serverInstructions;
const instructions = this.serversRegistry.serverInstructions!;
if (!serverNames) return instructions;
return pick(instructions, serverNames);
}