I would recommend using Gmsh + pygmsh instead of mshr which is not maintained actively. See Transitioning from mesh.xml to mesh.xdmf, from dolfin-convert to meshio - #79 by dokken and a lot of other examples therein to use gmsh/pygmsh + meshio to generate and load compatible meshes