With the aim of bringing substantial insight to the fundamental question of how galaxies acquire their material for star formation, we present the first comprehensive characterisation of the galaxy connectivity (i.e. the number of small-scale filamentary streams connected to a galaxy) in relation to the cosmic environment, and a statistical exploration of the impact of connectivity on the star formation rate (SFR) at z = 2. We detected kiloparsec-scale filaments directly connected to galaxies by applying the DisPerSE filament finder to the dark matter density around 2942 central galaxies (M* > 108 M⊙/h) of the TNG50-1 simulation. Our results demonstrate that galaxy connectivity spans a broad range (from 0 to 9), with more than half of the galaxies connected to two or three streams. We examined a variety of factors that might influence the connectivity and found that it increases with mass, decreases with local density for low-mass galaxies, and does not depend on local environment, estimated by the Delaunay tessellation, for high-mass galaxies. Beyond mass and local density, we further classified galaxies according to their location in different cosmic web environments, and we highlight the influence of the large-scale structure on the number of connected streams. Our results reflect the different strengths of the cosmic tides, which can prevent the formation of coherent streams feeding the galaxies or even disconnect the galaxy from its local web. Finally, we show that at fixed local density, the SFR of low-mass galaxies is up to 5.9σ higher as a result of connectivity. This SFR boost is even higher (6.3σ) for galaxies that are embedded in cosmic filaments, where the available matter reservoirs are large. A milder impact is found for high-mass galaxies, which indicates different relative efficiencies of matter inflow via small-scale streams in galaxies of different masses.