I've watched this thread with interest as I had depression for many years on and off before I started cycling. I would say, in general, yes, exercise, especially outdoors is great for mental health, but, depending on the specifics of your mental and physical state at the time, it can take over and become just another factor which is not helping, especially if you use it as a crutch and become emotionally dependent on it. ie - That's when you get down if you can't get out on the bike because of poor weather or illness.
If you are competing, or aiming towards a specific goal, you can end up pushing higher and higher, and the cycling then becomes another source of anxiety or stress. The adrenal glands and other areas the endocrine system don't differentiate between physical stressors (cycling) and mental stressors such as work, home life, etc - you still produce the same stress hormones; adrenalin, cortisol, etc. in your body as a response. If you are under stress at home or work on top of intensive cycling/training, this really depletes your already depressed immune system, which in turn aggravates the depression - a vicious circle. Also, if you have any issues with eating disorders or self-image, cycling and the lifestyle that surrounds it, can be another aggravating factor. Of course if you do have this problem you'll probably think cycling is great, as you can use it as another tool to lose more weight or punish yourself further.
Finding a balance is the most important thing. There is more to life than cycling, and to become too focussed on one specific thing is not helpful for anyone, especially anyone with mental health problems. It is best to have several other things you can also turn to for enjoyment, as well as a really strong support network - another thing that seems to suffer if you spend too much time on the bike away from family and friends.