Hi there
First of all mpls can work with any routing protocol including ospf
Mpls uses lable switching that built based on the local router routing table
Please see the below link to understand how mpls works
https://learningnetwork.cisco.com/docs/DOC-5914
However with mpls networks an extintion of bgp used to support virtulization using what is called MP-bgp
That can run L3vpn between edge routers called PE to exchange routing over the core mpls network
http://www.cisco.com/en/US/docs/ios/12_2sr/12_2srb/feature/guide/brbclns.html
Hope this help
If helpful rate