Is MPI code generation supported in MLIR?

If you are talking about the Message Passing Interface. It is a library and needs a frontend: Fortran, C, or C++. There is a Flang in the repository. A Fortran compiler going through MLIR. There will be an MLIR-Clang:

To compile the library, you will need an C/C++ compiler.