We develop an adaptive optics (AO) multiphoton microscope by incorporating a deformable mirror and a Hartmann-Shack wavefront sensor. The AO module operating in closed-loop is used to correct for the aberrations of the illumination laser beam. This increases the efficiency of the nonlinear processes in reducing tissue photodamage, improves contrast, and enhances lateral resolution in images of nonstained ocular tissues. In particular, the use of AO in the multiphoton microscope provides a better visualization of ocular structures, which are relevant in ophthalmology. This instrument might be useful to explore the possible connections between changes in ocular structures and the associated pathologies.