Merge pull request #202 from continuedev/tingwai/con-3456
fix: dont immediately exit on mcp config error
This commit is contained in:
commit
47ddf3fa18
2 changed files with 6 additions and 2 deletions
|
|
@ -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({
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue