Jimmy the Baker is dead. That doesn't stop Castle from trying the free cupcake samples in his shop. They were made before Jimmy was shot dead into vat of chocolate sauce. The victim's assistant says his boss got nervous when a black muscle car drove by earlier. Jimmy kept a briefcase filled with $50k in cash in his office. Beckett believes the bakery could be a front for the mob. A ruthless Irish mafia man named Bobby S owns a muscle car like the one that was seen at the shop. A bar owner named Siobhan O'Doul (guest star Cara Buono) had been in contact with the victim. She has a past with Detective Kevin Ryan back when was known as Fenton O'Connell.
Siobhan gives Ryan a passionate, flying lip-lock right in front of his wife, Jenny. Then she slaps him hard upon finding out he's a cop. Ryan explains that he worked undercover for 14 months with the Irish mob before joining homicide. He ran with Bobby S. He also had a serious relationship with Siobhan, who is ticked because he left seven years ago without a word. Special Agent Sam Walker lets the team know that Jimmy the Baker was his informant. Siobhan is also working for him. They were trying to get a book known as the bible. It's a ledger that could bring down Bobby S and his entire operation.
Agent Walker wants to send Siobhan back in. Ryan knows that's way too dangerous. He volunteers to return Staten Island as Fenton O'Connell. No one is happy about this. Ryan hasn't done undercover work in seven years. He's bound to be rusty. Ryan heads off on his mission as Jenny stares at him without saying a word. Tears are in her eyes. It's a delicate time for the couple. They've been trying to start a family. They are awaiting word from a fertility specialist to see if that's even possible. Ryan assures Esposito that he knows what he's doing just before he leaves with no gun, no wire and no backup.
Ryan enters Kelly's Tavern. The place is filled Irish mafia. Ryan announces the triumphant return of Fenton O'Connell. He's met with a whack to the face from Maggie, the wife of Bobby S's number two man, Liam. Ryan meets with Bobby S. He wants to get back in business with him. Bobby S wonders why he shouldn't just put a bullet in his head. Ryan disarms Liam with lighting speed. He hands the gun to Bobby telling him to pull the trigger himself if he truly doubts his intentions. It's an intense scene, but Bobby buys into Ryan's act. He welcomes his old friend back into the mix as a man of honor. Liam and his wife are skeptical of the new guy.
The team realizes that Bobby S isn't the person who killed Jimmy. He's being set up. Esposito tells Ryan, who still plans on attending a pool game in Bobby S's basement. It's his only chance to get the bible. It's also his only chance to get Siobhan safely into the witness protection program. During the pool game, Liam gets a call saying they have a rat in the house. Ryan sneaks off to swipe the bible from Bobby's wall safe. He hides when the mob man comes inside to grab his gun. Later, Liam lets Ryan know that they are taking a ride. The two of them get into a brief scuffle, but Ryan ultimately has no choice but to comply.
Beckett lets a worried Jenny know that they have no idea where her husband is. She also says the reason Ryan is doing all this is because he just wants to do the right thing. That's who he is. As for Ryan, he arrives at the docks with Liam. Others are there as well. Siobhan is pulled from a car. Bobby S knows that she's the snitch. Ryan is asked to show his loyalty by blowing her brains out. Siobhan bravely tells him to do it. That's not going to happen. Ryan can't shoot Siobhan. However, he has no problem shooting Bobby. Too bad the gun they gave him has an empty clip.
Ryan lets the bad guys know that he swiped Liam's cell phone when they tussled. He placed a call to his partner who heard exactly where they were going. Esposito pops out of the darkness with an assault rifle aimed squarely at the bad guys. Beckett joins him from the other direction. Castle is also there, but he waits in the background since he forgot to wear his vest. The rest of the cavalry arrives. Ryan assures Bobby that he's going down for good this time thanks to his bible. As for Jimmy the Baker's murder, that came at the hands of Liam's wife, Maggie. She was trying to eliminate Bobby so her hubby could take over a mob leader. Case closed.
Lately, Castle has been mentioning the name Jordan in his sleep. It's the topic of a term paper he paid someone to write for him at boarding school. He got raves for the paper. He learned how to write so that he could truly be worthy of the acclaim. Castle still feels like he's trying to prove himself. He fears this story will change how Beckett sees him. He's right about that. It makes her like him just a little bit more. In other relationship news, Ryan says goodbye to Siobhan before returning home to Jenny. His wife wants to know that he'll always be there for her especially now that she's pregnant. Looks like they didn't need those fertility tests after all!