Yellow Cab Cooperative Inc., San Francisco’s largest taxi company, filed for bankruptcy protection Friday, the latest in string of traditional taxi companies to turn to chapter 11 amid the rapid rise of ride-hailing rivals like Uber Technologies Inc. and Lyft Inc.

Pamela Martinez, the co-op’s president, said in court papers that her company faced a host of challenges, including a high number of accidents-related claims and liabilities, a steep decline in ridership and competition from newer app-based ride-sharing services,...