James McGraw, also known as Captain James Flint (played by Toby Stephens) is the legendary pirate captain of Robert Louis Stevenson's Treasure Island. In Black Sails, we learn about the infamous pirate's backstory and learn how he came to be a pirate. 

Most of his youth was actually spent in the Royal Navy where he reached the rank of Lieutenant. In 1705 he met an aristocrat named Thomas Hamilton. His goal was to stop piracy in the Bahamas and turn New Providence Island into a British colony. As young Lieutenant McGraw got to know Hamilton and Hamilton's wife, Miranda, the three of them started having an affair. 

When the affair was discovered, Hamilton was made to disappear by his father and Flint took Miranda to Nassau. 

In Nassau, he takes up piracy, where he quickly becomes one of the most powerful pirate captains in the region. He continues his relationship with Miranda on Nassau, until she is killed at the end of season 2. 

In season 4 we learn that Thomas is still alive and the two are reunited.