Over the past two decades, the diagnosis rate for patients with encephalitis has remained poor despite advances in pathogen-specific testing such as PCR and antigen assays. Metagenomic next-generation sequencing (mNGS) of RNA and DNA extracted from cerebrospinal fluid and brain tissue now offers another strategy for diagnosing neurological infections. Given that mNGS simultaneously assays for a wide range of infectious agents in an unbiased manner, it can identify pathogens that were not part of a neurologist's initial differential diagnosis either because of the rarity of the infection, because the microorganism has not been previously associated with a clinical phenotype or because it is a newly discovered organism. This Review discusses the technical advantages and pitfalls of cerebrospinal fluid mNGS in the context of patients with neuroinflammatory syndromes, including encephalitis, meningitis and myelitis. We also speculate on how mNGS testing potentially fits into current diagnostic testing algorithms given data on mNGS test performance, cost and turnaround time. Finally, the Review highlights future directions for mNGS technology and other hypothesis-free testing methodologies that are in development.