Surface analysis experiments on air-sensitive substances are challenging to avoid their contact with air, leading to inaccurate results due to oxidation or hygroscopicity. To address this issue, we designed a compact vacuum transfer device (VTD) and applied it to scanning electron microscopy (SEM) and energy-dispersive X-ray spectroscopy (EDS) experiments. Our VTD features a split structure that can be opened and separated in the SEM specimen exchange chamber via magnetic control. This design allows the SEM manufacturer's stub to be fed directly into the SEM specimen chamber, preventing damage to the instrument's internal components and avoiding restrictions on specimen height. Additionally, the compact design maximizes the utilization of sample accommodation space. Besides, it can be flexibly customized in different sizes and types of stubs to adapt electron microscopes from various manufacturers. To confirm the reliability of our device, we applied it to several highly air-sensitive samples for morphology and chemical composition analysis by SEM and EDS. The EDS results showed that the atomic percentage of Na reaches 94.55 % after 14 minutes and 93.44 % after 30 minutes of storage when transferring metallic sodium. Furthermore, our VTD enables airtight recycling and re-transfer of samples after the SEM (-EDS) experiments. These results demonstrate that our device has excellent practicality and airtightness, making it suitable for medium- and long-distance sample transfer between laboratories on the campus.