This study investigates the effects of annealing on the tunnel magnetoresistance (TMR) ratioin CoFeB/MgO/CoFeB-based magnetic tunnel junctions (MTJs) with different capping layers and correlates them with microstructural changes. It is found that the capping layer plays an important role in determining the maximum TMR ratio and the corresponding annealing temperature (T-ann). For a Pt capping layer, the TMR reaches similar to 95% at a T-ann of 350 degrees C, then decreases upon a further increase in T-ann. A microstructural analysis reveals that the low TMR is due to severe intermixing in the Pt/CoFeB layers. On the other hand, when introducing a Ta capping layer with suppressed diffusion into the CoFeB layer, the TMR continues to increase with T-ann up to 400 degrees C, reaching similar to 250%. Our findings indicate that the proper selection of a capping layer can increase the annealing temperature of MTJs so that it becomes compatible with the complementary metal-oxide-semi conductor backend process.