(notification: ClientNotification)
| 332 | }; |
| 333 | |
| 334 | const sendNotification = async (notification: ClientNotification) => { |
| 335 | if (!mcpClient) { |
| 336 | const error = new Error("MCP client not connected"); |
| 337 | toast({ |
| 338 | title: "Error", |
| 339 | description: error.message, |
| 340 | variant: "destructive", |
| 341 | }); |
| 342 | throw error; |
| 343 | } |
| 344 | |
| 345 | try { |
| 346 | await mcpClient.notification(notification); |
| 347 | // Log successful notifications |
| 348 | pushHistory(notification); |
| 349 | } catch (e: unknown) { |
| 350 | if (e instanceof McpError) { |
| 351 | // Log MCP protocol errors |
| 352 | pushHistory(notification, { error: e.message }); |
| 353 | } |
| 354 | toast({ |
| 355 | title: "Error", |
| 356 | description: e instanceof Error ? e.message : String(e), |
| 357 | variant: "destructive", |
| 358 | }); |
| 359 | throw e; |
| 360 | } |
| 361 | }; |
| 362 | |
| 363 | const checkProxyHealth = async () => { |
| 364 | try { |
no test coverage detected