In the Pyrenees, MacGyver arrives to rescue an American geologist, Dr. Andrea Gates, caught between warring local factions. Removing his clothes, MacGyver dons the towel and slips in to the camp and goes to the outdoor showers. As he walks through the camp, he spots the shower water pipe near the cooking fire. He edges the pipe onto the fire and then goes to the locked cabin where the tourist is kept. He uses a wooden board as a lever to lift the door off its hinges. Gates hugs him and they don soldier uniforms. MacGyver then douses a rope with kerosene from a lantern as the shower water reaches the steaming point. MacGyver and Gates slip out and head for a nearby cliff: the soldiers spot them and follow.
MacGyver tosses the rope down a ravine to the river below where some rubber boats are kept. They rappel down and MacGyver sets the rope on fire, stopping the soldiers from following. MacGyver grabs a roll of barbed wire and they paddle downstream as the soldiers rappel down on their own ropes. MacGyver stops momentarily and anchors the barbed wire, and then they paddle across the river and anchor it on the other side. They proceed downstream and the soldiers’ boat hits the barbed wire and deflates.
MacGyver travels to Brazil to help out his friend Dr. Charles Alden, who is investigating strange phenomenon involving terrified birds. MacGyver helped him set up the expedition and they proceed upriver and Alden notices more birds fleeing in panic. They arrive at an outpost and Charlie is eager to get going. MacGyver tells him to relax and find a guide, but Commissioner Santos informs them that all the Indian guides refuse to go into the jungle. Santos says the guides are dreaming of demons and there’s nothing he can do. MacGyver asks about a local cocoa plantation owner he heard about, Lucien Trumbo, but Santos warns he’s a difficult man and has no radio, and recognizes no law except his own.
MacGyver and Alden head upriver on a smaller boat and wonder how Trumbo keeps his workforce, and MacGyver suspects they’re more afraid of Trumbo then the “demons.” The river narrows and they pass through some fronds to find a native marker. They spot a small landing dock up ahead but natives emerge and fire off a shot. Trumbo arrives and tells them they’re trespassing, He’s not concerned about their issues with birds. MacGyver hears the irrigation pump running out of sync due to a busted piston. MacGyver offers his help in return for Trumbo’s assistance in providing a guide. Trumbo refuses to endanger his people but MacGyver agrees to fix the pump anyway. As he looks for tools, one of the workers, Luiz, explains that Trumbo built the entire place out of the jungle and took in Luiz and gave him shelter. Trumbo has no acetylene gas for his welding equipment and MacGyver puts together an electric arc welder out of coins and jumper cables and welds the piston back together. Trumbo defends his efforts, and says his workers are well-paid.
That night, Trumbo says that he holds what he has, and admits that since his wife died he hasn’t been interested in the outside world. He admits he knows something is going on in the jungle: out of control animals have tried to smash down his fences. MacGyver thanks him for his hospitality and Trumbo thanks him, but refuses to risk his people as guides. However, he offers to guide them himself and says they’re leaving at daybreak.
The next day in the jungle, they find animals and birds fleeing in terror. As they head for a nearby village, they hear an odd squeaking noise and go to investigate. They find that an enormous two mile wide column of soldier ants, Marabunta, ravaging the landscape and heading northeast toward Trumbo’s plantation. They hear screams from the village and investigate. The ants are overwhelming the natives. One woman is trapped underneath a fallen canoe. MacGyver rigs a makeshift winch out of rope and a bamboo pole to lift it off of her legs and get her free. Alden goes to check the other side of the village to take photos. He moves to the edge of a drop-off but ants climbs on him and he slips and falls to his death.
Back at the plantation, Trumbo’s workers prepare a fire break around the plantation walls but many of them flee in terror. Trumbo plots the ants’ progress and MacGyver is surprised he plans to stay. Trumbo goes to confront his workers and tries to convince them to stay. The workers know what the ants can do and refuse to stay. When Trumbo opens fire on one of their canoes, MacGyver knocks him down and throws his rifle into the river. The two men struggle while the other workers ignore Luiz and paddle away. Trumbo throws off Luiz and rides back to the plantation, but Luiz refuses to abandon his home. MacGyver admits he wants to stay and see if his weld will hold up.
Trumbo is surprised to see them return and MacGyver explains that they can flood the ditches and create a series of moats and force the ants down into the river. If that doesn’t work, MacGyver suggests they use gasoline and if that fails, blowing up the dam to flood the entire area. Luiz warns that the flood could wash away the topsoil and the plantation house, but they may have no other choice. MacGyver goes to the gas tank and builds a makeshift flamethrower while Luiz goes to the dam to monitor the water levels in the ditches.
As the ditches fill, the horses panic as the ants approach. They get to the ditches and instinctively use leaves as makeshift rafts to cross. They attack Luiz and kill him before he can unleash more water to raise the level and clear the ditches. They realize Luiz is dead and Trumbo prepares to go after him, but MacGyver warns him it’s too late. The ants get to the walls and MacGyver ignites the firebreak with the flamethrower. The plan works… until the gasoline runs out and a new wave of ants approach.
All they can do now is blow the dam but Trumbo notes they don’t have any dynamite. MacGyver goes to work, making nitromanide out of cellulose, fertilizer, and acid. He then melts down a garden hose and covers plastic sheets with the resulting mixture. Finally he cuts the rubberized plastic sheets into a crude protective suit.
MacGyver runs across the ravaged landscape as ants cover him. He gets to the dam but, blinded, is forced to abandon his helmet to plant the explosives. He lights the charge and runs, abandoning the rest of his gear. The dam blows and the water rushes over MacGyver and drowns the ants. Trumbo emerges from his plantation to find MacGyver washed up. Trumbo is happy that they’ve won and is determined to start all over, better than before. He invites MacGyver to come back in a year to see what he’s helped build.