The cradle of mountain biking is just across the Golden Gate Bridge from San Francisco. The mountain bike pioneers used to race down the Mt. Tamalpais in Marin County. So, you would expect this area to be a mountain bike mecca nowadays. It is a very nice, relaxed area with beautiful beaches, like Muir Beach and Stinson Beach, but it is not a mountain bike hot spot anymore. To a certain degree this is due to Marin County’s opinion about allowing mountain biking on single track trails.
The best ride in the area is most likely Camp Tamarancho a few miles northwest of San Raphael with purpose built trails. Camp Tamarancho requires usage fee (day pass 5$).
I enjoyed my ride on the Diaz Ridge Trail down to Muir Beach. Starting from Mill Valley there are various options to get up to the top of the trail. Cruising through the coast hills and down to the beaches with a fresh ocean breeze in the face lets you breathe the relaxed atmosphere there. The Diaz Ridge Trail is a bit over 3 miles long, but there are several options to make it a loop and a longer ride.