@@ -4,7 +4,6 @@ import { CredentialStorage } from '../core/auth/storage';
44import { DeployStackAPI } from '../core/auth/api-client' ;
55import { MCPConfigService } from '../core/mcp' ;
66import { ConfigurationChangeService } from './configuration-change-service' ;
7- import { ClientNotificationService } from './client-notification-service' ;
87import { AuthenticationError } from '../types/auth' ;
98import { detectDeviceInfo } from '../utils/device-detection' ;
109
@@ -100,9 +99,6 @@ export class RefreshService {
10099 // Step 2: Handle configuration changes
101100 if ( changeInfo . hasChanges ) {
102101 await this . changeService . handleConfigurationChanges ( changeInfo , teamMCPConfig . servers ) ;
103-
104- // Step 3: Notify connected clients about tool changes
105- await this . notifyConnectedClients ( ) ;
106102 } else {
107103 console . log ( chalk . green ( '✅ No configuration changes detected - your MCP servers are up to date' ) ) ;
108104 console . log ( chalk . gray ( '💡 All servers are already running with the latest configuration' ) ) ;
@@ -141,52 +137,4 @@ export class RefreshService {
141137 }
142138 }
143139
144- /**
145- * Notify connected clients about tool changes using HTTP requests to the running gateway
146- */
147- private async notifyConnectedClients ( ) : Promise < void > {
148- try {
149- console . log ( chalk . blue ( 'Notifying connected MCP clients about tool changes...' ) ) ;
150-
151- // Try to notify the running gateway about tool changes
152- // The gateway will handle notifying all connected clients
153- const gatewayUrl = 'http://localhost:9095' ;
154-
155- try {
156- const fetch = ( await import ( 'node-fetch' ) ) . default ;
157- const response = await fetch ( `${ gatewayUrl } /api/tools/refresh` , {
158- method : 'POST' ,
159- headers : {
160- 'Content-Type' : 'application/json'
161- } ,
162- body : JSON . stringify ( { reason : 'configuration_refresh' } )
163- } ) ;
164-
165- if ( response . ok ) {
166- const result = await response . json ( ) as {
167- totalNotified ?: number ;
168- sseNotified ?: number ;
169- streamableHttpNotified ?: number ;
170- } ;
171- console . log ( chalk . green ( `✅ Notified ${ result . totalNotified || 0 } connected clients` ) ) ;
172- if ( result . sseNotified && result . sseNotified > 0 ) {
173- console . log ( chalk . gray ( ` • SSE clients: ${ result . sseNotified } ` ) ) ;
174- }
175- if ( result . streamableHttpNotified && result . streamableHttpNotified > 0 ) {
176- console . log ( chalk . gray ( ` • Streamable HTTP clients: ${ result . streamableHttpNotified } ` ) ) ;
177- }
178- } else {
179- throw new Error ( `HTTP ${ response . status } ` ) ;
180- }
181- } catch ( error ) {
182- // Gateway might not be running, which is fine
183- console . log ( chalk . gray ( '💡 Gateway not running - clients will receive updated tools when they connect' ) ) ;
184- }
185-
186- } catch ( error ) {
187- console . log ( chalk . yellow ( `⚠️ Failed to notify some clients: ${ error instanceof Error ? error . message : String ( error ) } ` ) ) ;
188- console . log ( chalk . gray ( '💡 Clients will still receive updated tools on their next request' ) ) ;
189- }
190- }
191-
192140}
0 commit comments