Located 25 km from Kannur, on the banks of Kuppam river, the present structure has been built on the original foundation. The mosque is credited Muslim scholar and traveller Malik Ibn Dinar who, it is said, brought with him letters bearing the royal insignia from Cheruman Perumal, the last king of the Chera Perumal kingdom, seeking the assistance of local chieftains including the ruler Kolattiri Raja of the Kolathunadu royal family for building mosques. It was from the Kolattiri Raja that Dinar received support to construct the Madayi mosque.
A plaque at the mosque bears the date of construction as 1124 AD. The mosque was renovated in 2006 with elements of the Indo-Saracenic style. In the mosque is a block of white marble which is said to be from Mecca. Madayi mosque is one of many built around Pazhayangadi.