  This paper proposes a quantum key distribution (QKD) scheme for
measurement-device-independent QKD (MDI-QKD) utilizing quantum memory (QM),
which is based on two distinct functions of QM: on-demand storage and multimode
storage. We demonstrate a nonlinear increase in the secure key rate due to the
utilization of QM. In the protocol incorporating on-demand storage, it is
acknowledged that the secure key rate is scaled by $R=O(\sqrt{\eta_{ch}})$ as
$\eta_{ch}$, while as an alternative approach, we reveal that the improvement
is $O(m_s^2)$, with $m_s$ being the number of modes in frequency (spatial)
multiplexing in the scheme incorporating multimode storage. We adopt an atomic
frequency comb as a QM that incorporates the two functions and propose an
architecture based on MDI-QKD to attain experimental feasibility. This scheme
can be extended to quantum repeaters, and even for a single quantum-repeater
node, there is a nonlinear enhancement and an experimental incentive to
increase the number of modes.
