“My Ex-Life” by Stephen McCauley. Flatiron Books, New York, 2018. $25.99. 324 pages.

What fun to turn to “My Ex-Life” this summer, a diverting and thoroughly pleasurable new novel by Massachusetts author Stephen McCauley. Underneath the veneer of hilarity is a taut and worrisome unease. Like life itself.

David Hedges, a gay man in mid-life, travels from San Francisco to Beauport, Massachusetts, to help his ex-wife, Julie, and her daughter. Mandy is in her late teens, smart and independent, but she’s having trouble with college admissions. She contacts David, ostensibly because he’s a consultant who helps college-bound students fulfill the requirements for admission.

David is making do after breaking up with his partner. He’s polite and clever, slow to anger and unlikely to be disruptive. That doesn’t mean he’s quiet or passive. From David we get a book-load of smart verbal jousting. We can almost see Oscar Wilde hovering in the wings, nodding enthusiastically. David had been living in enviable, affordable digs that realtor and friend Renata tries to sell out from under him. Suddenly his footing feels terribly precarious.

Julie, his ex-wife, is troubled in ways similar to David. Her marriage has just ended and she wants to stay put in her big old house on the hill in the seaside village of Beauport. The house is run-down but she can make ends meet running a small Airbnb operation. Unfortunately her husband wants his half of the value of the house as part of the divorce settlement and she’s having trouble coming up with the cash.

Mandy’s struggles are scary. Young, bright and contrary, she is about to get herself in a lot of trouble. Beauport may be a small town, known for its pretty views and small shops, but it is not immune to contemporary dangers lurking on the internet, in vans and school yards. Like young women everywhere these days, Mandy is vulnerable.

Nobody in this book is predictable. Renata is hostile and mean. Julie’s soon-to-be ex-husband goads and prods. Mandy’s boss fires her. Sweet and vulnerable lovers betray, nonetheless. But no character can be pigeon-holed. Good things happen only when characters and their temperaments align. Bad things are just as likely to occur. Again, like life itself.

Reading “My Ex-Life” sometimes feels like a long and especially brilliant New York Times Modern Love installment, full of modern twists and turns. But it’s more than that. It’s a provocative search for the essence of home — a village, a house, a community, a co-mingling of souls with certain affinities that somehow find each other and are fortunate enough to recognize what they have.

Of special interest is Beauport, which happens to be my home. McCauley’s spot-on characterization captures the odd allure of the place. Beauport has charm, quaint views and eccentricities. But there’s something special there, something that fosters the happiness and ease that feels like home.

— Rae Padilla Francoeur can be reached at rae@raefrancoeur.com.