James Madison was one of only two U.S. Presidents (along with Washington) who signed the U.S. Constitution. James Madison also served as a U.S. Representative in the First Federal Congress (1789-1791).
James Madison was an Episcopalian.
James Madison attended St. John's Episcopal Church while he was President. Some sources classify Madison was a deist.
He was identified as an Episcopalian by the 1995 Information Please Almanac; A Worthy Company: Brief Lives of the Framers of the United States Constitution by M. E. Bradford; and the Library of Congress. Memoirs & Correspondence of Thomas Jefferson, IV, page 512 was cited as the source stating explicitly that Madison was a "theist." (Source: Ian Dorion, "Table of the Religious Affiliations of American Founders", 1997).
From: Robert G. Ferris (editor), Signers of the Constitution: Historic Places Commemorating the Signing of the Constitution, published by the United States Department of the Interior, National Park Service: Washington, D.C. (revised edition 1976), pages 189-193:
A brillian political philosopher and pragmatic politician who dominated the Constitutional Convention, Madison has deservedly won the epithet "Father of the Constitution."
...He received his early education from his mother, from tutors, and at a private school. ...in 1771 he graduated from the College of New Jersey (later Princeton), where he demonstrated special interest in government and the law. But, considering the ministry for a career, he stayed on for a year of postgraduate study in theology.
Back at Montpelier, still undecided on a profession, Madison soon embraced the patriot cause, and State and local politics absorbed much of his time...
Although a slaveholder all his life, he was active during his later years in the American Colonization Society, whose mission was the resettlement of slaves in Africa.