File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -561,6 +561,12 @@ class Launcher {
561561 }
562562
563563 this . state = States . STARTING
564+
565+ // The node-red node_modules may have been (re)installed or relinked,
566+ // so any previously-resolved MCP SDK could now be stale. Drop the cached
567+ // reference so it is re-resolved against the current install on next use.
568+ this . agent ?. mqttClient ?. mcp ?. resetSdk ?. ( )
569+
564570 if ( ! existsSync ( this . projectDir ) ||
565571 ! existsSync ( this . files . flows ) ||
566572 ! existsSync ( this . files . credentials ) ||
@@ -751,6 +757,11 @@ class Launcher {
751757 let finalState = States . STOPPED
752758 this . stopReason = reason || 'shutdown'
753759 info ( 'Stopping Node-RED. Reason: ' + this . stopReason )
760+
761+ // Drop any cached MCP SDK reference: the SDK files may be removed (clean
762+ // stop) or replaced before the next start, so they must not be reused.
763+ this . agent ?. mqttClient ?. mcp ?. resetSdk ?. ( )
764+
754765 if ( this . stopReason === States . SUSPENDED ) {
755766 finalState = States . SUSPENDED
756767 }
You can’t perform that action at this time.
0 commit comments