We developed adaptive optical (AO) two-photon excitation microscopy by introducing a spatial light modulator (SLM) in a commercially available microscopy system. For correcting optical aberrations caused by refractive index (RI) interfaces at a specimen’s surface, spatial phase distributions of the incident excitation laser light were calculated using 3D coordination of the RI interface with a 3D ray-tracing method. Based on the calculation, we applied a 2D phase-shift distribution to a SLM and achieved the proper point spread function. AO two-photon microscopy improved the fluorescence image contrast in optical phantom mimicking biological specimens. Furthermore, it enhanced the fluorescence intensity from tubulin-labeling dyes in living multicellular tumor spheroids and allowed successful visualization of dendritic spines in the cortical layer V of living mouse brains in the secondary motor region with a curved surface. The AO approach is useful for observing dynamic physiological activities in deep regions of various living biological specimens with curved surfaces.