Cholangiocarcinoma (CCA), a biliary tract malignancy, accounts for 20% of all liver cancers. There are several existing methods for diagnosis of CCA, though they are generally expensive, laborious, and suffer from low detection rates. Herein we first developed a means of partially purifying human bile for consequent injection into a microfluidic chip. Then, the novel microfluidic system, which featured 1) a cell capture module, 2) an immunofluorescence (IF) staining module featuring two CCA-specific biomarkers, and 3) an optical detection module for visualization of antibody probes bound to these CCA marker proteins, was used to detect bile duct cancer cells within partially purified bile samples. As a proof of concept, CCA cells were successfully captured and identified from CCA cell cultures, blood samples inoculated with CCA cells, and clinical bile specimens. In 7.5 ml of bile, this system could detect >2, 0, and 1 positive cells in advanced stage patients, healthy patients, and chemotherapy-treated patients, respectively. In conclusion, our microfluidic system could be a promising tool for detection of cancer cells in bile, even at the earliest stages of CCA when cancer cells are at low densities relative to the total population of epithelial cells.