Mast cell-specific G protein-coupled receptor for basic secretagogues, which regulates mast cell degranulation and itch-related hypersensitivity reactions (PubMed:22069323, PubMed:25517090, PubMed:28288109, PubMed:34789874, PubMed:34789875). A secretagogue is an agent that promotes the secretion of hormones, neurohormones, chemical neurotransmitters or other compounds synthesized and secreted by cells (PubMed:25517090). Basic secretagogues comprise a set of cationic amphiphilic drugs, as well as endo- or exogenous peptides, consisting of a basic head group and a hydrophobic core (PubMed:25517090). Ligand binding causes a conformation change that triggers signaling via guanine nucleotide-binding proteins (G proteins) and modulates the activity of downstream effectors, such as adenylate cyclase (PubMed:28288109, PubMed:34789874, PubMed:34789875). MRGPRX2 is both coupled to G(q) and G(i) G proteins: G(q) coupling activates phospholipase C-beta, releasing diacylglycerol (DAG) and inositol 1,4,5-trisphosphate (IP3) second messengers, while G(i) coupling mediates inhibition of adenylate cyclase activity (PubMed:28288109, PubMed:34789874, PubMed:34789875). Recognizes and binds small molecules containing a cyclized tetrahydroisoquinoline (THIQ), such as non- steroidal neuromuscular blocking drugs (NMBDs), including tubocurarine and atracurium (By similarity). In response to these compounds, mediates pseudo-allergic reactions characterized by histamine release, inflammation and airway contraction (By similarity). Acts as a receptor for substance P, a basic secretagogue neuropeptide released from the terminals of specific sensory nerves, initiating a signaling that mediates neurogenic inflammation and pain (PubMed:30686732, PubMed:34789875). Neurogenic inflammation includes mast cell activation, recruitment of immune cells and release of inflammatory mediators, such as cytokines and chemokines (By similarity). The inflammatory response can then activate or sensitize nociceptors, promoting pain (By similarity). Acts as a receptor for a number of other ligands, including peptides and alkaloids, such as cortistatin- 14, proadrenomedullin peptides PAMP-12 and, at lower extent, PAMP-20, antibacterial protein LL-37, PMX-53 peptide, beta-defensins, complanadine A and CXCL17 (PubMed:12915402, PubMed:15823563, PubMed:21441599, PubMed:22069323, PubMed:23698749, PubMed:24930830, PubMed:34789874, PubMed:34789875). Also acts as a receptor for opioids, such as (-)- and (+)-morphine, hydrocodone, sinomenine, dextromethorphan, dynorphin A, dynorphin B, and alpha- and beta- neoendorphin, promoting mast cell degranulation (PubMed:28288109). {ECO:0000250|UniProtKB:Q3KNA1, ECO:0000269|PubMed:12915402, ECO:0000269|PubMed:15823563, ECO:0000269|PubMed:21441599, ECO:0000269|PubMed:22069323, ECO:0000269|PubMed:23698749, ECO:0000269|PubMed:24930830, ECO:0000269|PubMed:25517090, ECO:0000269|PubMed:28288109, ECO:0000269|PubMed:30686732, ECO:0000269|PubMed:34789874, ECO:0000269|PubMed:34789875, ECO:0000269|PubMed:41167449}. This is the function of Ensembl gene identifier ENSG00000183695 (MRGPRX2, MAS related GPR family member X2).