Skip to content

Commit

Permalink
Add notif warning claude must be restarted
Browse files Browse the repository at this point in the history
  • Loading branch information
ColinMcNeil committed Feb 26, 2025
1 parent 6ffc79c commit 9832690
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/extension/ui/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,16 @@ export function App() {
}

const updateMCPClientStates = async () => {
const oldStates = mcpClientStates;
const states = await getMCPClientStates(client)
setMcpClientStates(states);
// Whenever a client connection changes, show toast to user
if (Object.values(oldStates).some(state => state.exists && !state.configured) && Object.values(states).every(state => state.configured)) {
client.desktopUI.toast.success('MCP Client Connected. Restart Claude Desktop to use the MCP Catalog.');
}
if (Object.values(oldStates).every(state => state.configured) && Object.values(states).some(state => !state.configured)) {
client.desktopUI.toast.error('MCP Client Disconnected. Restart Claude Desktop to remove the MCP Catalog.');
}
}

useEffect(() => {
Expand Down Expand Up @@ -86,7 +94,7 @@ export function App() {
const hasMCPConfigured = Object.values(mcpClientStates).some(state => state.exists && state.configured)

return (
<div>
<>
<Dialog open={settings.showModal} onClose={() => setSettings({ ...settings, showModal: false })}>
<DialogTitle>
<Typography variant='h2' sx={{ fontWeight: 'bold', m: 2 }}>Catalog Settings</Typography>
Expand All @@ -110,7 +118,7 @@ export function App() {
},
}} showSettings={() => setSettings({ ...settings, showModal: true })} registryItems={registryItems} canRegister={canRegister} client={client} onRegistryChange={loadRegistry} />
</Stack>
</div>
</>
)

}

0 comments on commit 9832690

Please sign in to comment.