We develop a theory to connect the following three areas: (a) the mean field equations on flat tori, (b) the classical Lame equations and (c) modular forms. A major theme in part I is a classification of developing maps f attached to solutions of the mean field equation according to the types of transformation laws (or monodromy) with respect to the period lattice satisfied by f.