To design gas sensors with fast response speed and high sensitivity for the detection of volatile organic compounds, a stacked MEMS sensor was designed in this study. It utilizes porphyrin-sensitive materials and carbon nanotubes to form composite materials, improve the thermal stability of sensitive materials, and conduct sensor gas sensitivity testing. The results show that the design of the thermal insulation structure makes the sensor obtain lower power consumption and more uniform temperature distribution, and the maximum deformation variable is 3.7 × 10−2 μM. Doping carbon nanotubes in porphyrin-sensitive materials can effectively improve their thermal stability, and the sensor is in a safe state at temperatures below 358 °C. The sensor with higher response recovery characteristics at a low concentration of 80 ppm aniline has better response recovery characteristics, with a response time of 33 s and a recovery time of 23 s, respectively; its response recovery characteristics to 1% high concentration ethanol gas are good, with a recovery time of 13 s and a sensitivity of 1.05. In the analysis of the sensor image characteristics, when the Euclidean distance threshold is set to five, four gases such as aniline and formaldehyde can be classified. The sensor designed in this study can effectively detect four gases, including aniline and formaldehyde.