Calcitonin gene-related peptide (CGRP), substance P and dural mast cells are main contributors in neurogenic inflammation underlying migraine pathophysiology. Modulation of endocannabinoid system attenuates migraine pain, but its mechanisms of action remain unclear. We investigated receptor mechanisms mediating anti-neuroinflammatory effects of endocannabinoid system modulation in in vivo migraine model and ex vivo hemiskull preparations in rats. To induce acute model of migraine, a single dose of nitroglycerin was intraperitoneally administered to male rats. Moreover, isolated ex vivo rat hemiskulls were prepared to study CGRP and substance P release from meningeal trigeminal afferents. We used methanandamide (cannabinoid agonist), rimonabant (cannabinoid receptor-1 CB1 antagonist), SR144528 (CB2 antagonist) and capsazepine (transient receptor potential vanilloid-1 TRPV1 antagonist) to explore effects of endocannabinoid system modulation on the neurogenic inflammation, and possible involvement of CB1, CB2 and TRPV1 receptors during endocannabinoid effects. Methanandamide attenuated nitroglycerin-induced CGRP increments in in vivo plasma, trigeminal ganglia and brainstem and also in ex vivo hemiskull preparations. Methanandamide also alleviated enhanced number and degranulation of dural mast cells induced by nitroglycerin. Rimonabant, but not capsazepine or SR144528, reversed the attenuating effects of methanandamide on CGRP release in both in vivo and ex vivo experiments. Additionally, SR144528, but not rimonabant or capsazepine, reversed the attenuating effects of methanandamide on dural mast cells. However, neither nitroglycerin nor methanandamide changed substance P levels in both in vivo and ex vivo experiments. Methanandamide modulates CGRP release in migraine-related structures via CB1 receptors and inhibits the degranulation of dural mast cells through CB2 receptors. Selective ligands targeting CB1 and CB2 receptors may provide novel and effective treatment strategies against migraine.