Mary Goodnight first appeared as 00-Section secretary in the Ian Fleming novels On Her Majesty's Secret Service, You Only Live Twice and The Man with the Golden Gun, and was also briefly mentioned in The Property of a Lady.
On Her Majesty's Secret Service
Mary Goodnight is a former Wren who is now the secretary to the 00 Section, which includes James Bond. Replacing the section's previous secretary, Loelia Ponsonby, Goodnight has a less severe, more bubbly and adventuresome personality than her predecessor. Making her first appearance in On Her Majesty's Secret Service, she is described as "a honey," and there was speculation among the 00 agents as to which of them would be able to seduce her first. (Bond was tied with 006 as the favourite, though she may have preferred Bond anyhow, due to her reactions in The Man With The Golden Gun, but backed out of the competition after becoming involved with his future wife Tracy.) She has an excellent figure and has blue-black hair, although two novels later, in The Man with the Golden Gun her hair is blond to the point that it shines almost silver in moonlight. (We have no evidence that she uses hair coloring, and some circumstantial evidence that she doesn't, so this colour change may be a lapse on author Ian Fleming's part.)
You Only Live Twice
Goodnight later becomes a bit more serious than she was in On Her Majesty's Secret Service, showing concern for Bond as he slips into a round of self-destructive behavior following Tracy's death. Her appearance in this novel is little more than a cameo, although she is permitted to add a few lines to Bond's premature obituary.
The Man with the Golden Gun
In the final Fleming novel in which she appears, Goodnight's role is expanded. Having transferred to the Secret Service's Kingston station in Jamaica after Bond's presumed death, she assists Bond in building a cover for himself as he goes after the gunman Francisco Scaramanga, at one point posing briefly as Bond's fiancée. When Scaramanga tricks Bond into believing that the mannequin across the tracks of the small railroad on which they are traveling is Goodnight, the deception triggers a running gun battle between Bond and Felix Leiter on the one hand and Scaramanga and his associates on the other.
In all three novels in which she appears, Mary Goodnight shows what appears to be some genuine affection for Bond. Despite having a pronounced wholesome, modest, and almost sisterly aspect to her personality, at the end of The Man With the Golden Gun she invites a hospitalized Bond to finish his recuperation in her rented villa in the Blue Mountains. Since Bond is required to have careful supervision upon his release from the hospital this may in fact be an innocent offer on her part though it may not because of her comment on the community not minding unmarried couples sharing a house, and Fleming leaves unanswered the questions of whether Bond takes her up on her offer and of whether, if he does, the two end up sleeping together.
After an abscence of 46 years, Goodnight returns in the contemporary reboot, reprising her role as the O branch's secretary. It is claimed that she resembles the actress Kate Winslet. As such, in this appearance her hair is blonde.