Metformin is excreted unchanged, so is safe to combine with MDMA.
Atorvastatin is metabolized mainly through CYP3A4, so you can expect higher blood levels, as MDMA is metabolized by that enzyme among others. This might increase the chance of rhabdomyalysis occurring due to high blood levels of the statin.
Possibly skip the dose before you take MDMA to keep blood levels more stable (as statins don't induce withdrawal/discontinuation symptoms when missing a dose).