The answer to the question is complicated and highly individualized. The tl;dr version is that it depends on what is causing the UC. If you don't know the root reason for the UC, then it's unsafe to take MDMA. The problem with knowing the root is that modern medicine claims the etiology of UC is unknown, which I've found to mostly be BS, but again it depends on the person.
Some people have UC due to gut flora problems. Some have it due to stress and mental health issues (similar to IBS, but way more severe). For others, the etiology is unknown.
I barely did MDMA at all in my 20's. My major use and abuse was when I was 18-19. Yet in my most recent long-term relationship, we did more MDMA than I did in my entire 20's combined, within a short period. Then that relationship had a major falling out that was traumatic, abusive, and *extremely* stressful. I believe it was that stress, combined with all the drug use, which primed my gut for my first flare.
IBD and IBS are not the same disease, but they have a relationship through the mind/gut/emotional systems of the body. A lot of people with IBD have comorbid mental health problems. Most of our neurotransmitters or their precursors are made in the gut by gut flora, which then release those chemistries into the blood stream where they flow to the brain. Even though I have no proof, I strongly suspect that MDMA use impacts this cycle more easily in people with IBD because these health systems are already impaired.
It's the chicken and the egg. Sometimes people develop flares from high stress or emotional situations. Other people start to get depressed because their gut starts to get run down. It can be either/or. There's preliminary evidence that people prone to IBS and IBD tend to store stress in their gut and can have cytokine (inflammatory) reactions there simply from emotional states, but modern medicine is slow on the uptake with this. My doctors actually tried telling me that there's no connection between diet and IBD, maybe because most MDs get very little training in nutrition. They also don't really support the mind/body connection, which is a pretty "duh" factor for most of us with IBD. Probiotics weren't mentioned either, and it was home made ferments that (literally) saved my ass. So... you'll have to do soul searching elsewhere and do some experimentation to figure out the origins of your disease. Modern medicine is looking more at the body's sensitivity to cortisone and adrenaline. In people with IBD, the gut is a lot more reactive to stress hormones than the average person, so the assumption is that emotional stress = stress hormones = inflammatory response.
This is true of the general population (which is why stress = shortened lifespan), but looking just at hormones sidesteps the emotional intelligence of the gut and how in some people with Inflammatory Bowel, the sensitivity level is naturally heightened. (These people tend to more sensitive empaths in general.) But somehow with IBD patients, stress response leads to a disproportionate release of TNF-a in the body, which the gut is hypersensitive to already, and flares result. Because most recreational drugs - especially the amphetamines - cause major endorphin release, they are an antagonizing factor for ANY kind of inflammatory illness (i.e. arthritis, psoriasis, IBD, chronic pain, etc.). My personal strong belief is that there's a pathogenic factor involved, like an occult infection by mycobacterium, but modern testing is so deficient in this area that it's hard to know for sure.
If you aren't flaring and your IBD is under control, you're still being risky by taking MDMA or anything that depletes neurotransmitters or causes downregulation. It won't just be the synapses in the brain which downregulate, but also the grey matter in the gut, around the heart, etc. When the gut downregulates, you can get depressed just as easily if not more so than if the brain downregulates. Depression and anxiety go hand in hand, which means a more long-term stress response, which means your gut gets bathed in all those stress hormones, putting you at risk for a flare. I've noticed that MDMA makes my gut problems worse -- I just didn't know I was in IBD territory until my first flare, which nearly killed me. I'd love to see a study done to see how much CRP and TNF-a are in the blood stream of regular MDMA users vs. non. I bet you anything MDMA users have more inflammation by default because of the stress it puts on the body during and post-use.
There's also a connection between the immune system, the gut, and these neurotransmitter levels. A lot of people suffer lowered immunity after each MDMA use, and I don't believe it's purely just that you didn't get enough rest or didn't eat well. There's something biochemical happening. Because IBD is auto-immune related, it's an additional reason why you must be extremely cautious with MDMA use.
If you ARE flaring, then doing recreational drugs in general is a fool's errand. MDMA does nothing for inflammation and would probably make it worse because of its sympathetic action. I've met some people with IBD who say that LSD and mushrooms help them, but that makes sense because both have anti-inflammatory properties. You're still risking down-regulation with something like LSD though, or any drug. I find I can't even smoke weed now without being hung over for days. When the gut is impaired you just don't have the neurochemical resource to spare anymore.