File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,16 @@ export function App() {
5757 }
5858
5959 const updateMCPClientStates = async ( ) => {
60+ const oldStates = mcpClientStates ;
6061 const states = await getMCPClientStates ( client )
6162 setMcpClientStates ( states ) ;
63+ // Whenever a client connection changes, show toast to user
64+ if ( Object . values ( oldStates ) . some ( state => state . exists && ! state . configured ) && Object . values ( states ) . every ( state => state . configured ) ) {
65+ client . desktopUI . toast . success ( 'MCP Client Connected. Restart Claude Desktop to use the MCP Catalog.' ) ;
66+ }
67+ if ( Object . values ( oldStates ) . every ( state => state . configured ) && Object . values ( states ) . some ( state => ! state . configured ) ) {
68+ client . desktopUI . toast . error ( 'MCP Client Disconnected. Restart Claude Desktop to remove the MCP Catalog.' ) ;
69+ }
6270 }
6371
6472 useEffect ( ( ) => {
@@ -86,7 +94,7 @@ export function App() {
8694 const hasMCPConfigured = Object . values ( mcpClientStates ) . some ( state => state . exists && state . configured )
8795
8896 return (
89- < div >
97+ < >
9098 < Dialog open = { settings . showModal } onClose = { ( ) => setSettings ( { ...settings , showModal : false } ) } >
9199 < DialogTitle >
92100 < Typography variant = 'h2' sx = { { fontWeight : 'bold' , m : 2 } } > Catalog Settings</ Typography >
@@ -110,7 +118,7 @@ export function App() {
110118 } ,
111119 } } showSettings = { ( ) => setSettings ( { ...settings , showModal : true } ) } registryItems = { registryItems } canRegister = { canRegister } client = { client } onRegistryChange = { loadRegistry } />
112120 </ Stack >
113- </ div >
121+ </ >
114122 )
115123
116124}
You can’t perform that action at this time.
0 commit comments