The answers to your question are yes and no.
There are tests but they miss most cases because they only detect high histamine levels and related enzymes if the test samples are taken when you are reacting to something you very recently were exposed to (within hours). Knowledgeable doctors will diagnose MCAS clinically. You're right that diet is one way to tell - for me, diet is the primary driver - but that's not true for everyone. You may not react to most high-histamine foods, herbs, probiotics, etc. and your triggers might be something else - pollen, mold, heat, exercise, stress, artificial fragrances, cleaning products, etc. But every trigger matters because it can be cumulative.
For years, I had daily MCAS issues (mainly brain fog and reactions to every single thing I ingested) because I ate a lot of fermented foods, which I was doing because they're good for my microbiome, with no idea that I was reacting to their high histamine levels! I switched to a low-histamine diet, started taking quercetin and curcumin, and started doing DNRS limbic system retraining. I have not had brain fog since except for once when I got "histamined" because my partner made a smoothie with a too-ripe (fermented!) banana. That was a year and a half ago. Usually if triggers have been managed well, then I can handle a little histamine here and there now. It's definitely improved my quality of life.
In his book Toxic, Neil Nathan talks a great deal about
this. Many of the sensitive patients he sees have to address MCAS-related hyper-reactivity before they can tolerate other types of treatment for infections or mold. He says that he suspects MCAS in people who say that they feel better when they aren't treating antimicrobially and in people who seem to react to everything they ingest.