fix MCP under seatbelt, improve error handling (#301)

This commit is contained in:
Olcan
2025-05-09 09:02:14 -07:00
committed by GitHub
parent b35a3856a2
commit c58f879026
3 changed files with 11 additions and 1 deletions

View File

@@ -187,7 +187,15 @@ export class ToolRegistry {
command: mcpServerCmd,
stderr: 'pipe',
});
await this.mcpClient.connect(transport);
try {
await this.mcpClient.connect(transport);
} catch (error) {
console.error(
'failed to start or connect to MCP server using ' +
`command '${mcpServerCmd}'; \n${error}`,
);
throw error;
}
this.mcpClient.onerror = (error) => {
console.error('MCP ERROR', error.toString());
};