Featuring a huge surface-to-volume ratio, synthesized SBA-15 mesoporous silica is functionalized by inner-channel-wall modification of sensing groups for highly specific chemical-vapor detection at trace level. With the developed sensing material loaded on resonant microcantilevers, the specifically adsorbed chemical-vapor molecules act as an added mass to shift the cantilever resonant frequency for gravimetric sensing signal readout. Two kinds of sensing materials for trinitrotoluene (TNT) and ammonia/amine are respectively prepared by inner-wall layer-by-layer grafting functionalization. By using hexafluoro-2-propanol-functionalized mesoporous silica (HFMS), experimental results show highly specific and rapid detection of TNT vapor, with a ppt-level detection limit; functionalized with a carboxyl (COOH) group, the mesoporous silica is loaded onto the cantilever resonating sensor that experimentally exhibits an ultrafine detection limit of tens of ppb to ammonia/amine gases.