I suspect you just stood up too quickly!
As others have suggested, low blood pressure may be a contributory factor (some medications may cause this), but I don’t think it’s that rare, even for people who are perfectly well.
It’s just a case of if you stand up very suddenly, from a stooping, sitting, or lying position, your heart literally can’t get enough blood to your head fast enough, so you momentarily “see stars”.
I have thought they were small flies before, and tried to swat them - only to realise that yes, a second before, I’d stood up too quickly, and they’re not really there at all.
I don’t think it has anything to do with MS.
If it’s only the single incident, I wouldn’t even worry about it. If you notice it more frequently, you might need a checkup, to see if your blood pressure is low, and whether there’s any underlying reason for it.
I took a drug once, called lofepramine, which noticeably caused it.