MIDI can specify tuning either in a sysex dump or in real time, but putting such information into a MIDI file or sequence will not necessarily give you the results you want. The sound module or virtual instrument that converts the MIDI to audio is where the tuning and temperament actually take place, so it really depends on what kinds of MIDI messages your sound source supports, not what is possible in the MIDI specs.
Whether you send note numbers or sysex data or anything doesn’t matter. It’s the receiving device that determines how the MIDI is interpreted, not the MIDI itself that dictates the results. To understand the full extent of this, one only needs to contemplate how lighting controllers sometimes use MIDI instead of other protocols to control lights. A note on message is just a pattern of numbers sent within a protocol definition.
That means it’s already possible to do this with many different devices and pieces of software. Synths from Moog, Sequential, and Yamaha definitely have this capability, and I’m sure others do as well. In Logic you can set an entire project to an alternate tuning, although I’m not sure to what extent that applies to third-party virtual instruments. That said, many virtual instruments offer this functionality as well.
The only way I can think of to build microtonality into MIDI data that would work for 99% of sound sources would be to assume an equally tempered sound module and the use the pitch controller CC to augment the note numbers to create microtonality. You’d have to use MPE or multiple channels to play chords this way, but it can be done.