The overuse of antibiotics in animal agriculture and medicine has caused a series of potential threats to public health. Macleaya cordata is a medicinal plant species from the Papaveraceae family, providing a safe resource for the manufacture of antimicrobial feed additive for livestock. The active constituents from M. cordata are known to include benzylisoquinoline alkaloids (BIAs) such as sanguinarine (SAN) and chelerythrine (CHE), but their metabolic pathways have yet to be studied in this non-model plant. The active biosynthesis of SAN and CHE in M. cordata was first examined and confirmed by feeding ^13C-labeled tyrosine. To gain further insights, we de novo sequenced the whole genome of M. cordata, the first to be sequenced from the Papaveraceae family. The M. cordata genome covering 378 Mb encodes 22,328 predicted protein-coding genes with 43.5% being transposable elements. As a member of basal eudicot, M. cordata genome lacks the paleohexaploidy event that occurred in almost all eudicots. From the genomics data, a complete set of 16 metabolic genes for SAN and CHE biosynthesis was retrieved, and 14 of their biochemical activities were validated. These genomics and metabolic data show the conserved BIA metabolic pathways in M. cordata and provide the knowledge foundation for future productions of SAN and CHE by crop improvement or microbial pathway reconstruction.