Defects in cerebrospinal fluid (CSF) flow may contribute to idiopathic scoliosis. However, the mechanisms underlying detection of CSF flow in the central canal of the spinal cord are unknown. Here we demonstrate that CSF flows bidirectionally along the antero-posterior axis in the central canal of zebrafish embryos. In the cfap298tm304 mutant, reduction of cilia motility slows transport posteriorly down the central canal and abolishes spontaneous activity of CSF-contacting neurons (CSF-cNs). Loss of the sensory Pkd2l1 channel nearly abolishes CSF-cN calcium activity and single channel opening. Recording from isolated CSF-cNs in vitro, we show that CSF-cNs are mechanosensory and require Pkd2l1 to respond to pressure. Additionally, adult pkd2l1 mutant zebrafish develop an exaggerated spine curvature, reminiscent of kyphosis in humans. These results indicate that CSF-cNs are mechanosensory cells whose Pkd2l1-driven spontaneous activity reflects CSF flow in vivo. Furthermore, Pkd2l1 in CSF-cNs contributes to maintenance of natural curvature of the spine.