A Connecticut Yankee in King Arthur's Court is a "framed story." That is, the first chapter tells how a tourist in England, presumably Mark Twain, meets a stranger who tells him part of his story and then gives him a manuscript that tells the rest of his strange tale. In the last chapter, the tourist has finished reading the manuscript and searches out the stranger, only to find him dying and calling out for the wife and daughter whom he had lived with in sixth-century England.
In the first chapter, this stranger (we later learn that his name is Hank Morgan, but he is usually referred to in the novel as The Boss) tells the tourist that he was something of a jack-of-all-trades who had a particular aptitude for making and inventing things mechanical. He is from Hartford, Connecticut, where he had been head superintendent in a munitions factory until, in a fight with one of the workers, he was hit in the head with a crowbar. When he awakened, he was sitting in the grass under a tree. A man in old-fashioned armor took him prisoner, and they rode off to what Hank Morgan believed would probably be an insane asylum. At this point in the story, this stranger begins to feel very sleepy, so he gives the tourist the manuscript detailing his adventures, which he has written from the journals that he kept.
The first chapter of the manuscript (the introductory chapter is technically a prologue) begins with the knight and Hank Morgan riding through a quiet countryside that Morgan does not recognize. After a time, they arrive in a small, wretched town and pass through the gates of a huge castle; they then enter into a great paved court.
Trying to find out what asylum this is, Hank Morgan talks with a young man who tells him that the year is 528 and that the day is June 19; Morgan has been captured by Sir Kay the Seneschal, and he will be exhibited before the court. Then he will be sent to the dungeons to either rot or be ransomed.
At the feast around the Round Table, Sir Kay's turn to tell of his adventures finally arrives, but he is interrupted by Merlin, who tells the story of how King Arthur got his sword from the Lady of the Lake; he puts the entire crowd to sleep. When Sir Kay does tell his story, he exaggerates immensely. Then Arthur sentences Morgan to die at noon on the 21st. Morgan is stripped of his "enchanted" clothes and is hauled off to the dungeons.
When Clarence (the boy to whom he had talked) comes to visit him, Morgan tells the boy to take a message to the court; he says that he is a magician more powerful than Merlin. The message has some effect, but Merlin ultimately scoffs at the claims of this "magician" because the so-called spell that Morgan says that he will cast is not specified. By this time, Morgan has remembered that there will be an eclipse of the sun at noon on the 21st, so Morgan sends Clarence back to tell the court that he will blot out the sun — if he must.
Shortly thereafter, Morgan is hauled out to the courtyard and chained to a stake. A monk is praying for him when, suddenly, he stops, and Morgan notices that the solar eclipse is just beginning. He realizes that when he asked Clarence what day it was, Clarence gave him the incorrect day. Thus Morgan puts his knowledge of the eclipse to good use, thereby gaining his freedom and a position as "perpetual minister and executive" to the king, as well as liberal funding, if he will "let" the sun shine again. He keeps the king and the knights in suspense for a time, ostensibly to make sure that the king meant what he said; then, when he notices that the eclipse is total, he announces that his spell will now begin to pass away.
This "miracle" makes Morgan a man of great interest to the people of the kingdom, and when Merlin begins spreading rumors about him, Morgan blows up Merlin's tower, using explosives which he and Clarence have made. This "miracle" solidifies Morgan's position in the country.
At one of the frequent tournaments held in Camelot, Sir Dinadan (who tells many bad jokes) is being drubbed by Sir Gareth, and The Boss (as Morgan is now called) says that he hopes that he (Sir Dinadan) dies. By the time these ambiguous words are uttered, however, Sir Gareth has crashed into Sir Sagramor le Desirous, and Sir Sagramor thinks that Morgan's derogatory wish was meant for him. Sagramor therefore challenges Morgan, The Boss, to a bout after he, Sagramor, returns from questing after the Holy Grail. The king and others urge The Boss to also undertake a quest so that he will be more worthy of taking on Sir Sagramor. Morgan puts off this journey for some time, though, so that he can make some changes in the kingdom — such changes as providing some schools, factories, military academies, telephones, and telegraph lines; all these changes are done quietly, of course, so that they will not be too noticeable immediately.
Finally, Morgan can put off his quest no longer. The king decides that Morgan will accompany the Demoiselle Alisande la Carteloise to free her mistress and forty-four princesses held captive by three giants with one eye each.
Along the way, Morgan, The Boss, discovers many things; first, he learns that armor is very uncomfortable to ride in and also to sleep in. Then he and the Demoiselle have a meal with several freemen, one of whom is willing to think about change; as a result, he is sent back to Camelot for Clarence to put into training. A little later, The Boss terrifies six armed knights by stoking up a head of smoke with his pipe as they charge at him; the knights halt, amazed, and are willing to surrender. That evening, the evening of the second day out from Camelot, they come upon the castle ruled by Morgan le Fay. Although the wicked le Fay has a quick temper and is willing to kill anyone who crosses her even slightly, she becomes very deferential when she learns that her visitor is The Boss. She allows him his way even after he frees a man accused of killing a deer on the royal preserve and even though he frees nearly all of the prisoners in her dungeons. She casually stabs for a young boy, but she refrains from throwing his grandmother, who curses her for that deed, into the dungeons.
Several days later, Sandy (the name which Morgan has given his traveling companion) informs The Boss that they are coming upon an ogres' castle. The Boss, however, can see only a pigsty filled with pigs, but Sandy assures him that it is a castle and that those are princesses (and not pigs) who must be freed. Rather than argue with her, The Boss agrees that this castle must surely be enchanted — but enchanted for his eyes only. Thus, he rides down and buys the pigs from the swineherds. He and Sandy then drive the pigs to a nearby castle, where the "princesses" will wait to be reclaimed by their kin or friends.
When The Boss and Sandy meet a band of pilgrims heading toward the Valley of Holiness, they also decide to travel in that direction. On the way, they meet one of The Boss's "sign board knights," knights who are advertising various products which The Boss wants to introduce into England. But it is not long before they learn that there is a problem in the Valley of Holiness that requires one of the Boss's spells to set right, so he sends a knight back to Camelot with a note to Clarence for supplies and helpers.
The problem in the Valley of Holiness is that the holy well, believed to be the product of a miracle in an earlier day, has gone dry. The Boss examines it and finds that a section of the wall has been broken. While he waits for his supplies and aides to arrive from Camelot, he insists that professional courtesy requires him to wait until Merlin gives up before he takes over. Merlin does finally admit that he has failed to fill the well, but he gives up just as two of The Boss's helpers arrive; when they do, they quickly repair the hole in the well's wall, and then they prepare to make a spectacle of the restoration of water to the well. The "miracle," of course, is a success, and The Boss's reputation is reaffirmed.
A short time later, however, another magician arrives, and for the moment, he eclipses The Boss's reputation. All is not lost, however. Using a telephone that has just been installed in one of the abandoned caves in the Valley, The Boss predicts that the king and his retinue will be in the Valley of Holiness in two days; the other magician insists that the king will be traveling in the other direction. When the king does arrive on time, the other magician is discredited.
While the king is there, he dispenses justice, he oversees the choosing of officers for the standing army (a process that The Boss is unhappy with), and he allows those who are ill to attempt to heal themselves by touching him. After this business is taken care of, The Boss and the king set out to travel into the countryside in disguise. The Boss wants to find out, firsthand, what the conditions of the country are, and the king thinks that it might be a lark to go along. Thus, the two set out.
The Boss and the king have a number of problems on their journey because the king simply will not, or cannot, act like a peasant; indeed, The Boss manages to save them from being killed several times, once by using a dynamite bomb to blow up a group of charging knights.
During one incident, they help a woman who is dying of smallpox, leaving just before her sons, who had been imprisoned by the local lord, escape and arrive home. As The Boss and the king move through the night, they see the glow of a fire in the distance, and they discover the corpses of a number of men who have been hanged. Near morning, they come to a hut, and they finally convince the woman who greets them to give them some hospitality. After they have slept, she feeds them, and they learn that the lord of that area has been killed and that all the freemen in the neighborhood have been out all night looking for whoever is responsible for the murder. The Boss notices that his host and hostess are terribly nervous, and he guesses that they are probably related to the boys who are responsible for the lord's death. Therefore, he goes out with his host, Marco, and they agree that they will say nothing about key suspects who escaped. Instead, they walk through the village talking to people. The Boss invites a number of them to dinner that Sunday, and he insists on paying for everything; thus a sumptuous spread is prepared at the store.
The Boss's purpose in gathering these people for a meal is to find out what they think about wages and about the relationship between wages and purchasing power; he wants to convince them that his way of thinking is better than theirs, but all he manages to do is make them suspicious of him. Then, before he can cover up his error and ease their suspicions, the king begins talking about agricultural matters in such a way that makes these people think that he is mad. As a result, the men set upon the king and The Boss. Although the king and The Boss are winning the fight, they notice that their hosts have left. Suspecting that they have gone for help to aid their neighbors, the king and The Boss flee.
They are finally captured, however, but before these villagers can beat them, as they intend to do, the king and The Boss are rescued by an earl named Grip. Although Grip feeds them, gives them a room for the night, and lends them horses to ride to the next town, once they are there, he has them bound and sold as slaves.
They are then driven to London, along with a number of other slaves. Along the way, they see several instances of the cruelty of the laws and the difficulties of the life of the common people. After a time, The Boss manages to steal a metal clasp with a long pin from a prospective slave buyer; he uses this as a lock pick, and he is able to free himself. Before he can escape, however, the slave master comes in. The Boss tries to catch him, but he scuffles with the wrong man, and both of them are arrested. In the morning, in court, The Boss tells the judge a story that effects his immediate release, and he uses a telephone to call Clarence in Camelot so that knights can be sent to the rescue.
In the meantime, he learns that the slaves had killed the slave-master in the night and that all of them are to be hanged. He tries to make some contacts with people he knows, but in doing so, he is captured and put in with the other slaves; the jailer tells him that they are all to be hanged in the middle of the afternoon.
At a climactic moment when three of the slaves have been hanged, and the blindfold has been put on the king, suddenly five hundred of Camelot's finest knights ride up on bicycles. They take charge of the situation and rescue the king and The Boss.
Just after they return to Camelot, The Boss learns that he must enter the tournament lists and must joust against Sir Sagramor.
Instead of conventional weapons, however, The Boss uses a lasso and ropes Sir Sagramor and yanks several other knights off their horses. After Merlin steals the rope, Sir Sagramor challenges The Boss again; this time, The Boss uses a revolver which he has made and shoots him. When one of the other knights challenges him, The Boss challenges all of them together, and he shoots nine of them before the rest turn and flee.
After this, The Boss has his own way for a time, and he makes many changes in England, revealing some of the earlier changes which he quietly accomplished. He also marries Sandy, and they have a child whom Sandy names Hello-Central. When Hello-Central falls ill, The Boss spends a great deal of time with her and, on the advice of doctors, he takes her to the seaside. She falls ill again while they are visiting a kingdom on the French coast. About a month later, after she is fully recovered, The Boss goes to England to see what has happened to the boat which they had sent to bring them supplies; they are worried, for it should have returned at least three weeks earlier. Once in England, The Boss learns that all of the changes which he had made have now fallen under an Interdict of the Catholic Church.
The Boss then makes his way to Camelot. He and Clarence make plans for a final battle against most of England, with only fifty-two of the people whom they trained as helpers. Working from Merlin's cave, they kill twenty-five thousand knights, using electric fencing, Gatling guns, and an ingeniously diverted stream. When The Boss goes out to see if they can give aid to any of those who still survive, one of the wounded enemies stabs him. Luckily, however, the wound is only slight. Yet all is far from being peaceful yet, for Merlin enters the cave in the guise of an old woman and casts a spell on The Boss that makes him sleep for thirteen hundred years. Thus the novel ends with the tourist's reaching The Boss's room just as The Boss dies, calling for Sandy and Hello-Central.