I had MS in my first flock which was determined came from wild birds but we will never be 100% sure. I chose to treat the flock instead of culling. It was a learning experience I am so glad I decided to do. Expensive antibiotics, time consuming to drain fluid from the tendon sheathes, miles and miles of vet wrap, but 8 months later the birds were deemed clean. I moved to birds to new ground, new coop and never saw this nasty bacteria again, even in new added chicks or chickens.
But, all this being said, I would not do this again in the future and would probably cull as well.
Yes, you make sure they don' get it by following the cleaning and sanitizing needed in coop. Lime in the run outside and waiting a few weeks. The bacterium needs a host to survive so it will die after a few days.
Light also is one of the major killers of this bacterium