MDF is DEFINITELY not OK! It it made from wood fibres glued together and it is full of chemicals. It is even dangerous for humans to use as it contains chemicals that can seriously irritate the lungs. So, it's not something that's appropriate for piggies to gnaw on.
Winnie if you are talking about making a loft out of wood then dont wood is not a good material to build anything in piggie cages. for a loft use cloropast or girds covered with fleece or other padding make the ramp out of recycled corregated tubing but please dont use wood.
If the MDF is new you must remove it. It is releasing toxic fumes.
I used a very old piece of MDF for my loft. It is old enough that the fumes are gone. I also covered it completely with vinyl tiles to keep the pigs from chewing on it and to protect it from pee and moisture...moisture (especially urine) will produce even more toxic fumes.
All edges of the board in my cage are protected and out of reach of the GPs' teeth. It is poisonous so they ABSOLUTELY must not be able to chew on it.
It dosen't matter if you already made it, it's your fault for not checking to see if it was good for piggies before hand. Don't use it, it's very harmful for your pigs. Want them to suffer from all the toxins in it, and possibly die? Please don't use it.. You've already had valuable advise given to you.