Molecular imaging allows clinicians to visualize the progression of tumours and obtain relevant information for patient diagnosis and treatment. Owing to their intrinsic optical, electrical and magnetic properties, nanoparticles are promising contrast agents for imaging dynamic molecular and cellular processes such as protein-protein interactions, enzyme activity or gene expression. Until now, nanoparticles have been engineered with targeting ligands such as antibodies and peptides to improve tumour specificity and uptake. However, excessive loading of ligands can reduce the targeting capabilities of the ligand and reduce the ability of the nanoparticle to bind to a finite number of receptors on cells. Increasing the number of nanoparticles delivered to cells by each targeting molecule would lead to higher signal-to-noise ratios and would improve image contrast. Here, we show that M13 filamentous bacteriophage can be used as a scaffold to display targeting ligands and multiple nanoparticles for magnetic resonance imaging of cancer cells and tumours in mice. Monodisperse iron oxide magnetic nanoparticles assemble along the M13 coat, and its distal end is engineered to display a peptide that targets SPARC glycoprotein, which is overexpressed in various cancers. Compared with nanoparticles that are directly functionalized with targeting peptides, our approach improves contrast because each SPARC-targeting molecule delivers a large number of nanoparticles into the cells. Moreover, the targeting ligand and nanoparticles could be easily exchanged for others, making this platform attractive for in vivo high-throughput screening and molecular detection.