According to this collection of notes on the siddur arranged by Rabbi Shneur Zalman of Liadi -- http://www.hebrewbooks.org/pdfpager.aspx?req=30450&st=&pgnum=122 -- the source is Pri Eitz Hayyim, Sha'ar Olam Ha-Assiyah, end of perek alef, which was then mentioned by the Magen Avraham, beginning of siman mem vav.

Pri Eitz Hayyim is a book by Rabbi Hayyim Vital that presents Rabbi Isaac Luria's system of 'kavvanot', i.e., intentions, to be performed in the mind as one prays. The Magen Avraham is a commentary on the Shulhan Arukh who often takes note of Kabbalistic practices. So, the source is in the Kabbalah of the Ari.

One therefore often sees a statement "I hereby take upon myself the positive mitzvah of 'love thy neighbour as thyself'", meant to be recited aloud, pre-pended to the beginning of Shaharit, in prayer books that have been influenced by Kabbalah.