Contextuality has been related for a long time as a topological phenomenon. In this work, such a relationship is exposed in the more general framework of generalized contextuality. The main idea is to identify states, effects, and transformations as vectors living in a tangent space, and the non-contextual conditions as discrete closed paths implying null vertical phases. Two equivalent interpretations hold. The geometrical or realistic view, where flat space is imposed, implies that the contextual behavior becomes equivalent to the curvature (nontrivial holonomy) of the probabilistic functions, in analogy with the electromagnetic tensor; as a modification of the valuation function, it can be used to connect contextuality with interference, non-commutativity, and signed measures. The topological or anti-realistic view, where the valuation functions must be preserved, implies that the contextual behavior can be translated as topological failures (non-trivial monodromy); it can be used to connect contextuality with non-embeddability and a generalized Voroby'ev theorem. Both views can be related to contextual fraction, and the disturbance in ontic models can be presented as non-trivial transition maps.