Tangier is certainly an interesting city , but is very busy. How long are you going for?
The streets can be manic in places unless you get out to the posher parts of town, where the roads are better too. The Medina is worth exploring but not on a bike, and probably best with a guide.
I’m sure there would be some fantastic road riding out of Tangier, especially along the coastal roads, but you would need to know where you are going. You cant just stop at a road side shop or petrol station, there might not be any. You should have access for mountain biking in most of the countryside. Keep some €’s in a back pack and learn a little Arabic, French or Spanish and you will find strangers more than welcoming and happy. Prepare to eat out well too. You can find some amazing restaurants and small cafes.
On a side note, try to visit the Church St Andrews. The caretaker’s name was Mustapha Chergui. He is a wonderful person (mad as a bog of frogs) but will be pleased to show you arround.