Even if someone was invisible, them moving would make SOME noise no matter what. If you are corporeal in some way then you move air around when you move. That would make noise. That noise would be extraordinarily slight, to the point that no normal living thing could hear it. However, Magic Mouth isn't a normal living thing. It's MAGIC. It absolutely could be used to detect an invisible creature.
If a PC had the trigger something like, "say 'Warning' when a hostile invisible creature makes any noise within the range of the object" that would totally work. That's RAW. If you wanted to houserule against that you could, but you'd be wrong to say that the spell didn't work that way. You need to remember this is only 30 feet. It's not a huge range. Invisible creatures could still attack from range without having any PCs being warned.