  We construct a quantum statistical mechanical system $(A,s)$ analogous to the
systems constructed by Bost-Connes and Connes-Marcolli in the case of Shimura
varieties. Along the way, we define a new Bost-Connes system for number fields
which has the ``correct'' partition function and the ``correct'' symmetries. We
give a formalism that applies to general Shimura data $(G,X)$. The object of
this series of papers is to show that these systems exhibit phase transitions
with spontaneous symmetry breaking, and to classify their KMS states, at least
for low temperature.
