This is the first of a series of papers in which we derive simultaneous constraints on cosmological parameters and X-ray scaling relations using observations of the growth of massive, X-ray flux-selected galaxy clusters. Our data set consists of 238 cluster detections from the ROSAT All-Sky Survey, and incorporates follow-up observations of 94 of those clusters using the Chandra X-ray Observatory or ROSAT. Here we describe and implement a new statistical framework required to self-consistently produce simultaneous constraints on cosmology and scaling relations from such data, and present results on models of dark energy. In spatially flat models with a constant dark energy equation of state, w, the cluster data yield Ωm= 0.23 ± 0.04, σ8= 0.82 ± 0.05 and w=−1.01 ± 0.20, incorporating standard priors on the Hubble parameter and mean baryon density of the Universe, and marginalizing over conservative allowances for systematic uncertainties. These constraints agree well and are competitive with independent data in the form of cosmic microwave background anisotropies, type Ia supernovae, cluster gas mass fractions, baryon acoustic oscillations, galaxy redshift surveys and cosmic shear. The combination of our data with current microwave background, supernova, gas mass fraction and baryon acoustic oscillation data yields Ωm= 0.27 ± 0.02, σ8= 0.79 ± 0.03 and w=−0.96 ± 0.06 for flat, constant w models. The combined data also allow us to investigate evolving w models. Marginalizing over transition redshifts in the range 0.05–1, we constrain the equation of state at late and early times to be respectively w0=−0.88 ± 0.21 and wet=−1.05+0.20−0.36, again including conservative systematic allowances. The combined data provide constraints equivalent to a Dark Energy Task Force figure of merit of 15.5. Our results highlight the power of X-ray studies, which enable the straightforward production of large, complete and pure cluster samples and admit tight scaling relations, to constrain cosmology. However, the new statistical framework we apply to this task is equally applicable to cluster studies at other wavelengths.