I wonder what we really desire most in our walk with God? Anointing or intimacy? The gifts or the Giver? Power or Presence? The Bible seems to suggest that it is possible to operate in an anointing and gifting from God yet still be far from Him. Look at King Saul. His anointing as king had been taken by God because of his disobedience, but for some time afterwards he continued to prophesy. Jesus himself said; Many will say to me on that day, 'Lord, Lord, did we not prophesy in your name, and in your name drive out demons and perform many miracles?' Then I will tell them plainly, 'I never knew you. Away from me, you evildoers. Matthew 7:22-23. Such things are hard to understand!
I guess these spiritual gifts will not be needed in heaven so they are transient and given to get us to a place of faith and trust in Jesus Christ. The thing that will remain is that intimate love relationship with Him that we can cultivate here on earth, just as Mary recognised.
It is good to seek power and gifts, and Paul exhorts us to; But eagerly desire the greater gifts. 1 Corinthians 12:31. We need them desparately. But let's check our priorities and motives and make sure we are seeking the better thing like Mary.