Deoxygenation of fatty acid esters in aqueous phase using in-situ generated H2 has emerged as a promising approach to producing sustainable diesel-like hydrocarbons. In this study, we employed a solvothermal method to synthesize novel Ni–Sn metal–organic frameworks (MOFs) with a homogeneous distribution of Ni and Sn elements. Subsequently, various Ni–Sn intermetallic compounds (IMCs) encapsulated with a porous carbon layer (<3 nm) (Ni–Sn IMC@C) were prepared through the facile pyrolysis of metal–organic frameworks under a controlled N2 atmosphere. Applying methyl palmitate as model reactant and methanol as hydrogen donor, Ni3Sn2 IMC@C gives approximately 100% conversion and 93% yield towards n-C15 and n-C16 alkanes at 330 °C, without significant deactivation during the recycling for five times. The deoxygenation pathway is dominated by decarbonylation (DeCO) on Ni–Sn IMCs. In Ni–Sn IMCs, the oxophilic nature of Sn, along with its charge transfer with Ni, enhances the adsorption of an η2(C, O)-aldehyde configuration. The strategic isolation of adjacent Ni by Sn effectively inhibits methanation and C–C bond hydrolysis, reducing H2 consumption and increasing carbon yield. Moreover, the ultrathin porous carbon encapsulation not only prevents the loss and sintering of Ni3Sn2 IMC under harsh hydrothermal condition but also mitigates mass transfer limitation. Surface oxidation of Ni3Sn2 IMC, particularly the formation of SnO2, is detrimental to deoxygenation. Additionally, Ni3Sn2 IMC@C exhibits high hydrocarbon yields (>89.6%) in in-situ aqueous phase deoxygenation of methyl laurate, methyl stearate and methyl oleate. These findings highlight the remarkable potential of MOF-derived catalysts for hydrothermal deoxygenation.