Cerebral ischemia-reperfusion (CI/R) injury seriously threatens the patients with ischemic stroke. MiR-128-3p level was found to be upregulated in serum samples of patients with ischemic stroke. It has been shown that miRNA in extracellular vesicles (specifically exosomes) has attracted attention because mesenchymal stem cells (MSCs)-derived exosomes play a favorable role in improving CI/R injury. Thus, we investigated whether MSCs-derived exosomes can be used to deliver miR-128-3p inhibitor (anti-miR-128-3p) to treat CI/R injury. BV2 cells were exposed to oxygen-glucose deprivation/reperfusion (OGD/R) for constructing in vitro model of CI/R. In addition, a rat model of middle cerebral artery occlusion (MCAO) was established to construct in vivo model of CI/R. Results indicated that miR-128-3p inhibitor can be transferred from MSCs to BV2 cells via exosomes. MSCs-derived exosomes containing anti-miR-128-3p significantly reduced the viability and inflammatory response in OGD/R-treated BV2 cells. Additionally, exosomes containing anti-miR-128-3p was able to enhance M1-to-M2 polarization of BV2 cells exposed to OGD/R. Meanwhile, exosomal anti-miR-128-3p markedly decreased infarct area in MCAO rats. Furthermore, NRBF2 was a direct target of miR-128-3p. Exosomal anti-miR-128-3p obviously reduced the level of NRBF2 downstream genes including NLRP3 and Caspase 1 in OGD/R-treated BV2 cells as well as in brain tissues of MCAO rats, suggesting that MSCs-derived exosomal anti-miR-128-3p could attenuate neural cell pyroptosis. In conclusion, exosomes containing anti-miR-128-3p derived from MSCs could attenuate CI/R injury via suppressing neuronal pyroptosis and modulating microglia polarization. Hence, our study might provide a theoretical basis for the treatment of ischemic stroke.