Manuel Garcia O'Kelly-Davis, or Mannie for short, goes on a routine computer repair job… only to learn that the super computer has gained self-awareness. It's just another day in a science fiction world, really. Mannie befriends the personality—naming it Mike—and helps it gain an understanding of human behavior. To this end, Mike requests Mannie bring a recorder to a "Sons of Revolution" rally.
When the Warden's bodyguard busts in to arrest everybody, Mannie helps revolutionary Wyoming Knott escape, and like all classic heroes, he gets dragged into a fight that isn't his. The duo hides in a hotel room and eventually contacts another revolutionary, Professor Bernardo de la Paz. Mike reveals to these three that under the Authority's rule, Luna will exhaust its resources, leading to food riots and eventually cannibalism.
Deciding he draws the line at cannibalism, Mannie joins the revolution. The group begins planning for the day they will overthrow the Authority: creating covert revolution cells, laundering money, and setting up an imaginary figurehead through Mike called Adam Selene. After a group of Peace Dragoons rape and murder a Luna woman, the Loonies riot, killing the Warden and the Security Chief and claiming Luna as their own.
Mike sends false information to Earth to buy the revolution time. Meanwhile, Prof creates the first Luna Congress as a governmental front for his own political scheming. Mannie and Prof decide to head earthside as diplomats to convince the Federated Nations to accept Luna as a free state. The night before he goes, Wyoh opts into his family as the sixth Davis wife.
On Earth, Mannie and Prof embark on a public tour to garner support for Luna. They also enter committee meetings with the Authority to state their side of the story, which goes about as well as you'd expect. Eventually, Mannie is arrested for polygamy, and he and Prof must escape back to Luna.
En route, Prof tells Mannie that failure was always the goal. Mannie's arrest and the Chairman's attempt to bribe him rally the Loonies under a banner of patriotic spirit—the revolution is now on like Donkey Kong.
The Federated Nations send troops to reclaim Luna, but the fierce Loonies fight them back. Mannie begins Operation Hard Rock, and Mike begins launching moon rocks at the earth's surface to warn the nations there that the moon can—and will—fight back.
The Federated Nations attack with war cruisers, destroying the catapult, but Mannie and Mike have a secret weapon: another catapult. A game of galactic cat and mouse begins. Mannie continues launching rocks while trying to keep the catapult's location hidden from the F.N. cruisers, and just before he runs out of ammunition, the nations of Earth begin recognizing Luna as a legitimate state. The Loonies win.
But victory comes at a cost: Prof dies immediately after claiming victory for the state, and Mike's self-aware personality is deleted after his hardware takes damage. Withdrawing from politics all together, Mannie contemplates what life would be like on the frontier of humanity—the asteroid belt.