The Bose-Hubbard model (BHM) of interacting bosons in a lattice has been a paradigm in many-body physics, and it exhibits a Mott insulator-superfluid (MI-SF) transition at integer filling. Here a quantum simulator of the BHM using a superconducting circuit is proposed. Specifically, a superconducting transmission line resonator supporting microwave photons is coupled to a charge qubit to form one site of the BHM, and adjacent sites are connected by a tunable coupler. To obtain a mapping from the superconducting circuit to the BHM, we focus on the dispersive regime where the excitations remain photonlike. Standard perturbation theory is implemented to locate the parameter range where the MI-SF transition may be simulated. This simulator allows single-site manipulations, and we illustrate this feature by considering two scenarios where a single-site manipulation can drive a MI-SF transition. The transition can be analyzed by mean-field analyses, and the exact diagonalization was implemented to provide accurate results. The variance of the photon density and the fidelity metric clearly show signatures of the transition. Experimental realizations and other possible applications of this simulator are also discussed.