A very thorough and balanced view examining James Madison's religious creed from Tufts University political science professor Vincent Phillip Munoz. Given Madison's reticence to explicate his specific creed, Munoz is hesitant to give a "for sure" answer; however what he writes supports the theistic rationalist view.
Among many other primary sourced quotations, Munoz notes Federalist 37, where "Madison seems to question the certainty with which man can apprehend the meaning of divine revelation." As Madison wrote:
When the Almighty himself condescends to address mankind in their own language, his meaning, luminous as it may be, is rendered dim and doubtful by the cloudy medium through which it is communicated.20
Munoz's conclusion: "On theological matters, Madison was first and foremost a rationalist." And:
Did Madison’s philosophical speculations, then, ultimately lead him to embrace religious faith? The evidence from Madison’s personal writings does not lead to a definitive conclusion. Madison’s natural theology suggests that he certainly was not an atheist—he never intimates that reason disproves God’s existence—yet it also does not definitively confirm a firm belief in the precepts of Christianity or in any sectarian religious faith.