Mechanical allodynia is a painful perception of mechanical stimuli and one of the typical symptoms in bone cancer pain (BCP). Previous studies have revealed that mice and humans lacking mechanically activated Piezo2 channels do not sense mechanical stimuli. However, the underlying mechanism of Piezo2 in BCP has not been well established. The aim of the present study was to investigate whether exchange protein directly activated by cAMP 1 (Epac1) mediated Piezo2 signaling pathway may be responsible for the mechanical allodynia of BCP and whether N-methyl-D-aspartic acid (NMDA) receptor subunit 2B (NR2B) is involved in the pathway. In the present study, a BCP model was established in C3H/HeJ mice by intramedullary injection of osteosarcoma cells. The results of the mechanical allodynia test demonstrated a markedly decreased paw withdrawal mechanical threshold in BCP mice, accompanied by a significant increase in Epac1, NR2B proteins and Piezo2 mRNA expression levels in the ipsilateral dorsal root ganglion (DRG). Compared with the sham group, intrathecal Epac1 antisense oligodeoxynucleotides (Epac1-ASODN) effectively ameliorated the mechanical allodynia and decreased the expression levels of NR2B and Piezo2 in the tumor group. Pretreatment of naïve mice with a NR2B antagonist prevented the aggravation of mechanical allodynia and DRG Piezo2 levels induced by an Epac1 agonist. However, the NR2B agonist-induced increase in Piezo2 expression levels was not reversed by pretreatment with Epac1-ASODN. In conclusion, the results of the present study demonstrated that NR2B, which is a crucial downstream regulator of Epac1, may mediate the Epac1-Piezo2 pathway contributing to the development of the mechanical allodynia of BCP. The present study may enrich the theoretical knowledge of the mechanical allodynia of BCP and provide a potential analgesic strategy for clinical treatment.