A prologue explains the history of the magic tree house that 8-year-old Jack and his younger sister, Annie, have found in the woods. After entering the tree house and looking at the books inside, the children have been transported through time to visit dinosaurs, Egyptian tombs, pirates and ninjas. During one of their visits, they met an enchantress named Morgan Le Fay, who told the children that they needed to free her from a magic spell by finding four items. In the previous book in this series, Night of the Ninjas, the children found the first item, a moonstone.
In this book, Annie and Jack climb into the tree house. They discover Peanut, a field mouse they brought home with them from Japan, scampering across the floor. Because the mouse helped them find their way when they were in Japan, the children ask Peanut to help them during their next trip.
Jack notices a book about the Amazon rain forest. He opens it to a page filled with pictures of tall trees and exotic flowers. Annie worries that if they travel there, they'll encounter spiders and bugs. Her brother reminds her that she has already encountered dinosaurs and ghosts, and asks her why she would be afraid of a little spider. He wants to help Morgan by visiting the rain forest and discovering the second item. Jack points to the open page, and brisk winds begin to blow around them. When the winds calm down, the children look out of the window to find that they've landed in a rain forest canopy, 150 feet above the ground. Jack reads about the rain forest in his book and decides that to be safe, they will have to use a rope ladder to descend to the forest floor.
The children are surprised to find that the rain forest isn't sunny but dark and damp. Peanut leaves the tree house, too. Jack's book explains how the creatures in the rain forest are camouflaged so they can't easily be detected. The children set off on an expedition to locate the second item that Morgan needs, although they don't know what it is. After they explore for some time, the silence is broken by the sound of a person walking through leaves. The sound makes birds fly away and lizards run up tree trunks. The book says that sound means that 30 million flesh-eating ants are marching through the leaves.
Annie spots the ants and tells her brother that they must hurry back to the tree house. When they encounter the Amazon River, Jack suggests that they wade a few feet into it so the ants can't attack them. Annie spies a hollowed out log that resembles a canoe, and they climb into it. Before the children can figure out what to use for paddles, they begin to float downriver in their makeshift canoe.
Concerned about their destination, Jack once again refers to the book for information. The Amazon River is 4,000 miles long and stretches all the way to the Atlantic Ocean. Jack begins taking notes in his notebook as Annie investigates the fish that are swimming alongside their canoe. They have sharp teeth. He warns his sister that they can eat people.
Jack plans to grab a vine and pull them to shore, but when he grabs one, the "vine" is a cold scaly snake that falls into the water and swims away. Annie reaches for what she thinks is another branch, but this time it's a crocodile. Annie lets go and is surprised to hear a monkey screech from a nearby tree.
The monkey throws a piece of fruit toward the children. Annie tells it to stop, but he does it again and again. Finally Annie throws the fruit back at the monkey in retaliation. Then it begins to rain. Jack is worried, but Annie reminds him that they are, after all, in a rain forest. The monkey pursues the children and points a long stick at the canoe. Annie decides that it is trying to help them. She grabs the end of the stick. The monkey pulls the canoe to safety.
Jack and Annie argue about what to do next. He wants to search for the second item that Morgan needs. She wants to follow the monkey. Instead of cooperating with her brother, Annie follows the monkey through the rain forest. When Jack finds them, they are in the middle of the rain forest, and Annie is playing with what looks like a big kitten. Jack's book identifies the kitten as a baby jaguar, the largest predator in the western hemisphere. He warns his sister to stay away because the baby's mother might be nearby. Just as he offers this advice, the mother jaguar moves toward Annie, ready to pounce. In the nick of time, the monkey drops from a tree and grabs the jaguar's tail, saving Annie. The children run away.
Deeper in the forest, the children look at the book again for clues about where to find the item Morgan might need. They read about vampire bats that come out at night to bite their victims and drink their blood. Jack is worried because the rain forest is growing darker. They agree to return to the tree house but can't decide which way they should go. Annie hears Peanut squeaking and sees it scurrying across the rain forest floor in what she believes is the right direction. They follow the mouse back to the tree house.
Safely inside, Jack asks his sister to find the Pennsylvania book that will transport them home, but she can't find it. As they search for the book, a piece of fruit flies through the window. They find the monkey sitting in the window. It looks as though it's trying to speak. Annie watches the monkey and decides that it is telling her to take the piece of fruit to Morgan. It's the second item they need to help free her from the magic spell. Once they realize this, the Pennsylvania book appears, and they are able to return home.
After the tree house lands safely in modern-day Pennsylvania, Jack looks through the book to identify the red fruit. He finds a picture of a mango and matches it to the fruit that the monkey gave them. He puts the mango with the moonstone. Annie chants the words "mango" and "moonstone" and believes that it sounds like a spell. Although Morgan isn't visible, the children call to her. They tell her they have found half the items needed to free her. They leave Peanut in the tree house (their mother doesn't like mice) and walk through the woods toward their own house, realizing how different the Pennsylvania woods are from the rain forest of the Amazon.