feat(mcp): notify desktop UI to reload after connection add/remove

Add /reload-connections bridge route that emits mcp-reload-connections
event, triggering the frontend to re-read connections from SQLite.
This commit is contained in:
t8y2
2026-05-08 12:44:16 +08:00
parent 30b6c472ea
commit 68d8776e8f
3 changed files with 15 additions and 0 deletions
+3
View File
@@ -37,6 +37,9 @@ export function useTauriEvents(deps: { openTableTarget: (target: NavigationTarge
);
},
);
listen("mcp-reload-connections", async () => {
await connectionStore.initFromDisk();
});
listen<{ connection_id: string; database: string; sql: string }>("mcp-execute-query", async (event) => {
const { connection_id, database, sql } = event.payload;
if (!connectionStore.connections.length) await connectionStore.initFromDisk();