A bit conflicting… is the App connecting to your Local Server or not?
If not, then read through this topic and try the suggestions… although the primary issue here was the use of Particle IDE… which I do not think you are using with a Mega
But if it is connecting, then do the projects run fine, but just show the device as disconnected (even if it is not)? If so then update your App (as this was due to another issue in another topic and since resolved… )
If something else… please clarify with details.