This paper investigates the optimal routing design problem of a community shuttle system feeding to metro stations based on demand-responsive service. The solution aims to jointly optimize a set of customized routes and the departure time of each route to provide a flexible shuttle service. Considering a set of on-demand trip requests between bus stops and metro stations, a mixed-integer optimization model is formulated to minimize the total system cost, including the operation cost and passenger’s in-vehicle cost, subject to the constraints on the route length, time window, detours, and vehicle capacity. To solve the problem, two metaheuristic algorithms, i.e. a tabu search (TS) and a variable neighborhood search (VNS), with different internal operators are specifically designed. A case study based on a realistic network is conducted to test the model and the solution, and comparisons of the performance of different algorithms are investigated.