We present a Markov chain Monte-Carlo (MCMC) method for modelling the Galactic magnetic field using total and polarised synchrotron emission data as well as rotation measures of extragalactic sources. With these three datasets, we study the three components of the magnetic field: the large-scale regular field, the small-scale isotropic random field, and the ordered field. In this first paper, w...