You should be ok with either a double or triple Shimano mech given it matches the largest front chain ring profile closely enough, plus you don’t have more than 12 teeth difference on the front. You won’t need a road mech unless you have big front chain ring.
For 36T – 48T I use Shimano road mechs.
For 30T – 42T I’ve been ok with an older XT triple mech.
For 26T – 38T I use a more recent XT / SLX double with 105 10 speed shifters.
Depending on where your bottle cage mounts are and if you’re squeezing a huge tyre in the rear you can often get away with high frame mounts but it looks much cleaner using the correct orientation if buying new.