Plays essential roles in regulation of cellular metabolism by catalyzing the synthesis of a second messenger, cAMP. ATP = 3',5'-cyclic AMP + diphosphate Binds 1 Mg(2+) ion per subunit. Belongs to the adenylyl cyclase class-3 family.