The uncontrollable growth of Li dendrites and large volume change during cycling limit the practical applications of Li metal anodes. Herein, the in situ-formed Pd nanoparticles locked in three-dimensional N-doped microporous carbon (Pd/NMC), which are derived from the catalyst for Buchwald-Hartwig (B-H) coupling polymerization, have been constructed to address these issues. The homogeneously distributed Pd nanoparticles effectively reduce the overpotential of Li nucleation through the reversible Li-Pd alloying reaction and boost Li