Identifying climate‐change refugia is a key adaptation strategy for reducing global warming impacts. Knowledge of the effects of underlying geology on thermal regime along climate gradients and the ecological responses to the geology‐controlled thermal regime is essential to plan appropriate climate adaptation strategies. In the present study, the dominance of volcanic rocks in the watershed is used as a landscape‐scale surrogate for cold groundwater inputs to clarify the importance of underlying geology in stream ecosystems along climate gradients. First, using hundreds of monitoring stations distributed across multiple catchments, we explored the relationship between watershed geology and the mean summer water temperature of mountain streams along climate gradients in the Japanese archipelago. Mean summer water temperature was explained by the interaction between the watershed geology and climate in addition to independent effects. The cooling effect supported by volcanic rocks reached up to 3.3°C among study regions, which was more pronounced in streams with less summer precipitation or lower air temperatures. Next, we examined the function of volcanic streams as cold refugia under contemporary and future climatic conditions. Community composition analyses revealed that volcanic streams hosted distinct stream communities composed of more cold‐water species compared with nonvolcanic streams. Scenario analyses based on multiple global climate models and Representative Concentration Pathways (RCPs) revealed a geology‐related pattern of thermal habitat loss for cold‐water species. Nonvolcanic streams rapidly declined in thermally suitable habitats for lotic sculpins even under the lowest emission scenario (RCP 2.6). In contrast, most volcanic streams will be sustained below the thermal threshold, especially for low‐ and mid‐level emission scenarios (RCP 2.6, 4.5). However, the distinct stream community in volcanic streams and geology‐dependent habitat loss for lotic sculpins was not uniform and were more pronounced in streams with less summer precipitation or lower air temperatures. These findings highlight that underlying geology, climate variability, and their interaction should be considered simultaneously for the effective management of climate‐change refugia in mountain streams.