diff --git a/src/MCPConnection.ts b/src/MCPConnection.ts index 1eb9decff..8347cf0bf 100644 --- a/src/MCPConnection.ts +++ b/src/MCPConnection.ts @@ -28,7 +28,9 @@ export class MCPConnection { } if (!config?.command) { - throw new Error("MCP server command is not specified"); + const name = config?.name ?? config?.url ?? "server"; + logger.error(`MCP command missing for ${name}`); + return; } const transport = new StdioClientTransport({ diff --git a/src/mcp.ts b/src/mcp.ts index 2119916ff..bf2c82f96 100644 --- a/src/mcp.ts +++ b/src/mcp.ts @@ -27,7 +27,9 @@ export class MCPService { const connectionPromises = assistant.mcpServers.map((server) => MCPConnection.create(server), ); - const connections = await Promise.all(connectionPromises); + const connections = (await Promise.all(connectionPromises)).filter( + (item) => item !== undefined, + ); service.connections.push(...connections); logger.debug("MCP connections established", { connectionCount: connections.length,