Cancer metastasis involves the dissemination of cancer cells from the primary tumour site and is responsible for the majority of solid tumour-related mortality. Screening of anti-metastasis drugs often includes functional assays that examine cancer cell invasion inside a three-dimensional hydrogel that mimics the extracellular matrix (ECM). Here, we built a mechanically tuneable collagen hydrogel model to recapitulate cancer spreading into heterogeneous tumour stroma and monitored the three-dimensional invasion of highly malignant breast cancer cells, MDA-MB-231. Migration assays were carried out in the presence and the absence of drugs affecting four typical molecular mechanisms involved in cell migration, as well as under five ECMs with different biophysical properties. Strikingly, the effects of the drugs were observed to vary strongly with matrix mechanics and microarchitecture, despite the little dependence of the inherent cancer cell migration on the ECM condition. Specifically, cytoskeletal contractility-targeting drugs reduced migration speed in sparse gels, whereas migration in dense gels was retarded effectively by inhibiting proteolysis. The results corroborate the ability of cancer cells to switch their multiple invasion mechanisms depending on ECM condition, thus suggesting the importance of factoring in the biophysical properties of the ECM in anti-metastasis drug screenings.