What's the best way to paint MDF?
Just like wood you should apply a primer first.

Then undercoat and finally the top coat (or two).

The primer will stop the other paint just soaking straight into the MDF and the undercoat will give "body" to the finish.

Even if you get a "one coat" paint I usually find that it needs two (or occasionally three) coats to get a good, even finish.