We present a hybrid system consisting of a superconducting coplanar waveguide resonator coupled to a nanomechanical string and a transmon qubit acting as nonlinear circuit element. We perform spectroscopy for both the transmon qubit and the nanomechanical string. Measuring the ac-Stark shift on the transmon qubit as well as the electromechanically induced absorption on the string allows us to determine the average photon number in the microwave resonator in both the low and high power regimes. In this way, we measure photon numbers that are up to nine orders of magnitude apart. We find a quantitative agreement between the calibration of photon numbers in the microwave resonator using the two methods. Our experiments demonstrate the successful combination of superconducting circuit quantum electrodynamics and nano-electromechanics on a single chip.