We report on the realization of a chemical sensor based on fiber-top design. The device was obtained by carving a cantilever out of the cleaved edge of an optical fiber. The cantilever was coated with a thin palladium layer and alternatively exposed to hydrogen enriched gaseous mixtures and hydrogen free atmosphere. The sensor was capable to unambiguously distinguish hydrogen absorption and desorption throughout several cycles. Our experiment demonstrates that fiber-top chemical sensors might represent an interesting alternative to commonly used detectors.