How to read compass position into 3 rd party software?

How do you read compass position and GPS data into another program whilst running Mission planner ?
All help greatfuly appreciated.
Many thanks !

the easiest way would be to press control-f > nmea.

this outputs standard nmea format output to a selected destination.

or

json.
127.0.0.1:56781/mavlink/
while mp is open