G-protein-coupled receptors (GPCRs) have key roles in physiology and are central targets for drug discovery and development1,2, but the design of protein agonists and antagonists has been challenging as GPCRs are integral membrane proteins and conformationally dynamic3–6. Here we describe de novo design methods and a high-throughput receptor-diversion microscopy-based screen for generating GPCR-binding miniproteins with high affinity, potency and selectivity. We design miniprotein agonists that activate receptors involved in itch and pain, as well as antagonists that inhibit receptors implicated in cancer, metabolic disorders such as diabetes and obesity, and migraines. The cryo-electron microscopy (cryo-EM) structures of five receptor-bound designs are close to the computational design models. A designed chemokine receptor antagonist mobilizes haematopoietic stem and progenitor cells in vivo at a level comparable to a clinically used drug, with fewer adverse effects.