Used to work in Morocco for years, best tip if you are just heading over would be to avoid Tangiers at all costs, horrible place. If you are getting ferry across head via Ceuta instead.
MTB didn’t really exist when i was out there, but have since heard really good things about Freeride Morocco.
It depends what you want from the trip, if you want the hustle and bustle, then Marrakesh is a good base with Atlas above and desert below. Our if you want somewhere more relaxed for a few days, Chefchaouen in Rif mountains or Essaouira on the coast are good.