Not that long ago, 95% of my work was hand painting raw MDF bookcases and wardrobes to a pretty high standard.
I use Leyland Trade acrylic primer. It is one of the only water based primers that I have found that sands nicely. Most others clog the abrasives. It also happens to be pretty cheap.
Waterbased paints will raise the grain on MDF. That never bothered me that much though given that the machine finish on MDF is far from perfect. I sand the primer back until I can see the factory finish score marks in the MDF. After dusting down, I then apply two coats of oil based finish.
The following shows you the score marks that I was referring to.
Zoom in to the area just to the left of the sander and you can see how "rough" MDF really is. You will also see the score marks running from top to bottom. The above was sanded with 220 grit mesh paper and was only 10% of the way through the sanding process. Typically, I would sand away about 90% of the primer that I apply.
You don't say if you are planning to use waterbased top coats or not though. Water based over water based on MDF can be a bit of a pig to apply. The water based primer does little to deal with the level of suction. After sanding it, the next coat of waterbased finish will raise the grain again.
On the 2 occasions where a customer insisted on a waterbased finish, I used to use oil based primers.