How match tempo to midi

I have recorded some midi, without listening to the click, and now wish to set the click to the tempo of the midi so I can quantise the performance. I can’t for the life of me figure out a way to do this.

Can anyone help ?
Thanks