Engineering magnetic topological insulators at the atomic level