The field of optomechanics has emerged as leading platform for achieving quantum control of macroscopic mechanical objects. Implementations of microwave optomechanics to date have coupled microwave photons to mechanical resonators using a moving capacitance. While simple and effective, the capacitive scheme suffers from limitations on the maximum achievable coupling strength. Here, we experimentally implement a fundamentally different approach: flux-mediated optomechanical coupling. In this scheme, mechanical displacements modulate the flux in a superconducting quantum interference device (SQUID) that forms the inductor of a microwave resonant circuit. We demonstrate that this flux-mediated coupling can be tuned in situ by the magnetic flux in the SQUID, enabling nanosecond flux tuning of the optomechanical coupling. Furthermore, we observe linear scaling of the single-photon coupling rate with the in-plane magnetic transduction field, a trend with the potential to overcome the limits of capacitive optomechanics, opening the door for a new generation of groundbreaking optomechanical experiments.