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() {
57
57
}
58
58
59
59
const updateMCPClientStates = async ( ) => {
60
+ const oldStates = mcpClientStates ;
60
61
const states = await getMCPClientStates ( client )
61
62
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
+ }
62
70
}
63
71
64
72
useEffect ( ( ) => {
@@ -86,7 +94,7 @@ export function App() {
86
94
const hasMCPConfigured = Object . values ( mcpClientStates ) . some ( state => state . exists && state . configured )
87
95
88
96
return (
89
- < div >
97
+ < >
90
98
< Dialog open = { settings . showModal } onClose = { ( ) => setSettings ( { ...settings , showModal : false } ) } >
91
99
< DialogTitle >
92
100
< Typography variant = 'h2' sx = { { fontWeight : 'bold' , m : 2 } } > Catalog Settings</ Typography >
@@ -110,7 +118,7 @@ export function App() {
110
118
} ,
111
119
} } showSettings = { ( ) => setSettings ( { ...settings , showModal : true } ) } registryItems = { registryItems } canRegister = { canRegister } client = { client } onRegistryChange = { loadRegistry } />
112
120
</ Stack >
113
- </ div >
121
+ </ >
114
122
)
115
123
116
124
}
You can’t perform that action at this time.
0 commit comments