Why does allocative efficiency occur when P=MC rather than MB=MC

I understand that allocative efficiency is where the demand curve and supply curve intersect, i.e. where MB=MC as demand and supply can be interpreted as marginal benefit and cost respectively; however, where do we get P=MC from?

Question: If I set a price of $p$, which consumers will buy the good?
Answer: a consumer will buy the good if and only if his benefit from consuming it is bigger than his cost, $p$, of buying it. This means that the last (i.e. marginal) consumer who buys will be the one for whom the benefit is just equal to the cost. In other words, for any price, $\text{MB}=p$ must hold.
For efficiency, we know that we need $\text{MB}=\text{MC}$.
Putting these two equations together yields $\text{MB}=\text{MC}=p$.
What is going on here? We know (as you pointed out) that we need $\text{MB}=\text{MC}$ for allocative efficiency. But we can't just go out and tell consumers whether to buy or not. We have to give them the incentive to make the efficient choice on their own. The way this is achieved is by setting the price such that only consumers for whom purchasing is efficient will be willing to buy.