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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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());
};