McMahon, 27, can also be deployed in an attacking midfield role.
An employment tribunal recently ordered Portadown to pay £7,000 in unpaid wages to McMahon, an outcome the Shamrock Park club say they will appeal.
In June, an Irish FA disciplinary hearing ruled that McMahon had been paid while registered as an amateur.
The registration case led to a 12-point penalty being handed down to the Ports, a decision which they are also in the process of appealing.
Swifts head coach Rodney McAree described McMahon as "a wonderful talent".
"The fact the Swifts play good football really made me want to join the club. I watched last season and anytime I saw them play I thought 'they play the game the right way' and that has attracted me to the club without a doubt," McMahon told the Dungannon FC website.
Dungannon lie fifth in the Premiership table and travel to Seaview to face champions Crusaders on Saturday.

Ym mis Ionawr, fe bleidleisiodd y cyngor sir i ollwng y ffrwd Saesneg yn Ysgol Llangennech ger Llanelli.
Yn ystod y ddadl honno fe gyfeiriodd un cynghorydd Llafur at y penderfyniad fel "arwahanu" ac fel "apartheid ar ei waethaf", tra bod un ymgyrchydd blaenllaw wedi awgrymu y gallai pobl sy'n anhapus "groesi'r ffin".
Yn ystod sesiwn holi'r Prif Weinidog yn y Senedd, fe gyhuddodd arweinydd Plaid Cymru, Leanne Wood rhai aelodau Llafur o weithio gydag UKIP mewn ymgyrch yn erbyn y newidiadau.
Dywedodd Mr Jones: "Mae yna rai sylwadau sydd wedi cael eu gwneud gan wleidyddion nad wyf yn cytuno â nhw.
"Rwyf wedi gweld y sylwadau hynny ac yr wyf yn credu ei fod yn hynod o bwysig nawr bod pobl yn tawelu, a bod y gwenwyndra rydym wedi ei brofi yn lleihau."
"Lle Cyngor Sir Gaerfyrddin ydy hi i egluro'r penderfyniadau a wnaed ganddynt yn Llangennech."
Ychwanegodd Mr Jones fod Llywodraeth Cymru wedi ymrwymo i gyrraedd targed o 1m o siaradwyr Cymraeg.

The King Charles spaniel was found on the A38 near Kennford service station in Devon on Thursday afternoon.
The owners of the dog, which suffered two suspected broken legs, have now been traced.
CCTV footage is being reviewed  by police "to shed light" on the incident.
Devon and Cornwall Police said: "We are currently working under the impression that the dog had escaped from its home and ran across the road and sustained its injuries this way."
Dungannon Swifts have completed the signing of former Portadown and Bohemians forward Peter McMahon on a one-year deal.
[NEXT_CONCEPT]
Mae'r Prif Weinidog wedi galw ar bobl i bwyllo yn y ffrae chwerw dros y penderfyniad i newid statws iaith ysgol gynradd yn Sir Gaerfyrddin.
[NEXT_CONCEPT]
An injured dog which was first thought to have been thrown from a car on a busy dual carriageway had probably escaped from home and run across the road, police say.