Big Boss, after help found the Patriots with the other MGS3 people, gets increasingly frustrated with Zero and how he's being used as a political symbol. The final straw is when he discovers that they're cloning him. He leaves the US and forms a mercenary company, and meets a young Master Miller (named Kazuhira Miller, the explanation being that he's half-Japanese) on the opposite side of a fight. Together they run Militaires Sans Frontieres, (Soldiers Without Borders), though they have very little money or equipment.
One day in 1974, a Costa Rican professor and a young student of his named Paz show up and claim that mysterious soldiers are being sighted in Costa Rica. Costa Rica's constitution prevents any standing army, and thus if something is wrong they have no defenses. Big Boss soon realizes that the "professor" is a KGB operative named Zadornov, and the troops in question are probably American backed. However, Paz produces a tape that appears to have recorded The Boss's voice in Costa Rica. Big Boss takes the mission, and MSF moves to a derelict oil rig off of South America.
Big Boss soons meets up with Sandinistas driven from Nicaragua, and learns that the troops are actually CIA black ops, and they're backed by mysterious advanced armored vehicles that sing. Eventually he learns that these mechs have crude artificial intelligence, prototypes for something called "Peace Walker." Two scientists work on Peace Walker: a programmer known by the alias of Strangelove, who had an infatuation with The Boss when she was alive, and a disabled engineer named "Huey" (it's Otacon's dad). Both of these scientists leave the project and join MSF, where they start work on a new project.
The CIA operative running the Peace Walker project is named Hot Coldman, and he was the one who planned Operation Snake Eater in MGS3. Politics saw him ousted from the head of the CIA and demoted to a backwater, and he intends to use Peace Walker to demonstrate his ideology: deterrence at any cost.
Huey explains what Peace Walker is: using the technology developed by Granin in MGS3, Peace Walker is the first culmination of the "Metal Gear" concept: a walking nuclear vehicle. However, to ensure no human hesitation in a nuclear war scenario, Peace Walker is equipped with an advanced AI that mimics the human brain. This AI is patterned after the greatest soldier ever known: The Boss. Coldman intends to use Peace Walker's nuclear launch as a demonstration of power, which he feels is necessary for MAD to be a viable strategy.
Big Boss eventually fights Peace Walker, in an attempt to finally understand why The Boss was able to accept her mission to die in MGS3. Peace Walker, influenced by The Boss's mind, actually destroys itself to prevent its launch from occurring. Big Boss realizes that The Boss wanted to put away her life of war, and feels betrayed; he only knows how to fight, and considers The Boss's actions to have been a rejection of him as well. He vows that he'll create a world where soldiers will never be rejected and always have a place to fight. [this is the first ending]
With all that settled, it seems that MSF has grown into a successful mercenary business, with Big Boss's legendary skill and reputation and Kaz Miller's business acumen. They're even building their own Metal Gear, Metal Gear ZEKE, with Huey and Strangelove's help. However, Zadornov, who was captured for interfering with their plans, keeps managing to escape somehow. On the final escape attempt, Big Boss discovers that he was covering for Paz, who has hijacked ZEKE and is planning to launch a nuclear attack to frame MSF for terrorism.
Paz reveals that she is actually an adult woman named Pacifica Ocean, and that she was recruited by "Cipher" (the prototypical form of the Patriots) and forced to destroy Big Boss and MSF for refusing to return to their control. Big Boss disables ZEKE and Paz falls into the ocean. Miller then reveals that he was aware of who Paz was all along: he had been trying to use Cipher's funding to help build MSF into a successful business. Big Boss remarks that now the whole world will be after them, and makes a speech to his troops about how they are now a part of Outer Heaven.