Delivering genes to and across the brain vasculature efficiently and specifically across species remains a critical challenge for addressing neurological diseases. We have evolved adeno-associated virus (AAV9) capsids into vectors that transduce brain endothelial cells specifically and efficiently following systemic administration in wild-type mice with diverse genetic backgrounds, and in rats. These AAVs also exhibit superior transduction of the CNS across non-human primates (marmosets and rhesus macaques), and in ex vivo human brain slices, although the endothelial tropism is not conserved across species. The capsid modifications translate from AAV9 to other serotypes such as AAV1 and AAV-DJ, enabling serotype switching for sequential AAV administration in mice. We demonstrate that the endothelial-specific mouse capsids can be used to genetically engineer the blood-brain barrier by transforming the mouse brain vasculature into a functional biofactory. We apply this approach to Hevin knockout mice, where AAV-X1-mediated ectopic expression of the synaptogenic protein Sparcl1/Hevin in brain endothelial cells rescued synaptic deficits.