Is Mexico City the capital of Mexico?

Yes. Mexico city is the capital of Mexico. (the country)

The capital of Mexico state (in Mexico) is Toluca.
The state is officially Estado Libre y Soberano de México and the capital is Toluca de Lerdo.