How should I mount a rework box if it has to go through an MDF/wood panel and drywall?
Why does it need to mount in the MDF? Just put box outside the perimeter of the MDF.

But if you insist:

From my experience, the simplest and cleanest way to do this is to mount the box in the drywall. You can either put a box extender in the MDF, or cut a hole big enough to clear the whole faceplate. I typically prefer cutting a big hole for the faceplate because it results in a cleaner look by helping to hide the connectors.

First cut your MDF to size. Then cut a hole for the box in the MDF. You can either make the hole the right size to fit the extender, or you can make the hole big enough to fit the faceplate.

Hold the MDF in place or temporarily mount it to your ceiling. Trace the cutout in the MDF on to the ceiling. Remove the MDF, cut the drywall, and install your box.