Cooper got the idea for his story from John Jay, best known for becoming the first Chief Justice of the Supreme Court. According to Cooper, during the Revolutionary War, Jay headed a secret committee of the Continental Congress that had as its task limiting British attempts to raise local troops. In carrying out this task, Jay employed a spy:
He was poor, ignorant, so far as the usual instruction was concerned; but cool, shrewd, and fearless by nature. It was his office to learn in what part of the country the agents of the crown were making their efforts to embody men, to repair to the place, enlist, appear zealous in the cause he affected to serve, and otherwise to get possession of as many of the secrets of the enemy as possible. The last he of course communicated to his employers, who took all means in their power to counteract the plans of the English, and frequently with success.
It was dangerous work, and in fact more than once the American spy narrowly avoided being executed by Americans. Jay was made an ambassador, and so had to leave his position, but before he did he convinced Congress to pay the spy for his services. When Jay tried to give him the money, however, the spy refused to take it, saying that his country had more need of it than he did. This basic anecdote served as the seed for Cooper's own spy character, Harvey Birch.
The Spy was a worldwide bestseller, even, it is said, being translated into Arabic and Farsi. It was even bigger at home, where the very idea of a historical novel about exciting American events involving fighting and intrigue was itself novel. A number of people claimed to be the original on whom Harvey Birch was based -- but, of course, Cooper did not know who the original spy was, having nothing more to go on than his memory of Jay's anecdote. Probably the most popular candidate for the role is Enoch Crosby, a simple shoemaker who probably did do some spying of this sort in the Westchester area for the New York Committee of Safety, on which Jay did indeed serve. As there were almost certainly not a few spies in such a crucial area, it's unclear whether Crosby, or some other man whose name has simply been lost, was the spy in question.
I'm reading this in a Heritage Press (New York) edition, one of the very nicest Heritage Press volumes I have from my grandfather, with a dark blue cover and silver decoration. It has illustrations by Henry Clarence Pitz, who was the author of a large number of books on illustrating and drawing techniques, and who actually wrote a bestselling book on book illustration, The Brandywine School, discussing the illustrators following in the footsteps of Howard Pyle, one of Pitz's heroes. The typeface is 12-point Bell. It has a nice introduction by John T. Winterich, a well-known bibliophile who seems to have written a lot of introductions to a lot of books; he had been an editor for Stars and Stripes in World War I.