A new tripodal receptor and a novel dyed mesoporous material are presented. The presence of thioureas conjugated with azobenzene chromophores enables the selective colorimetric detection of mercury(II) cations in THF through a remarkable colour change from yellow to deep purple.