In general relativity, the parallel transfer of a vector around a closed curve in spacetime, or along two curves that together form a closed loop, usually results in a nonzero deficit angle between the vector's initial and final positions. We show that such holonomy in the McVittie spacetime, which represents a gravitating object imbedded in an expanding universe, can in principle be used to directly detect the expansion of the universe, for example, by measuring changes in the components of a gyroscopic spin axis. Although such changes are of course small, they are large enough (∆ S ̃10-7) that they could conceivably be measured if the real Universe behaved like the McVittie spacetime. The real problem is that virialization will lead to domains decoupled from the global expansion on a scale much larger than that of the solar system, making such an experiment infeasible probably even in principle. Nevertheless, the effect is of interest in relation to ongoing discussions, dating back at least to Einstein and Straus, that concern the relationship between the expansion of the Universe and local systems.