Realistic oxide materials are often semiconductors, in particular at elevated temperatures, and their surfaces contain undercoordiated atoms at structural defects such as steps and corners. Using hybrid density-functional theory and ab initio atomistic thermodynamics, we investigate the interplay of bond-making, bond-breaking, and charge-carrier trapping at the corner defects at the (100) surface of a p-doped MgO in thermodynamic equilibrium with an O2 atmosphere. We show that by manipulating the coordination of surface atoms one can drastically change and even reverse the order of stability of reduced versus oxidized surface sites.