Everyone has already noted in the comments how and why MDF is not a good material to use around water or moisture and that you'll likely have future issues so that is not addressed in this answer. This answer is for the case that you still wish to go forward with your work, perhaps as a temporary fix.
Can I just use any undercoat and paint it with any interior paint?
Because water is a no-go it is necessary to use an oil, alcohol, or lacquer based primer first and then, after sealing, you can use latex water based paint as desired.
Here is a couple of articles with other related information that might helpful