About five years ago, at the request of his then-record label, J.D. McPherson wrote and recorded a Christmas song.

Even though the propulsive “Twinkle (Little Christmas Lights)” was a terrific addition to the genre, the retro-minded roots-rocker vowed to himself: Never again.

Oh well …

“You know what happens when you say never again,” McPherson says from his home in Nashville.

Not only has he written another holiday song, he has written (or cowritten) 10 of them. The resulting album, Socks, which also includes “Twinkle” (appearing on CD for the first time), is a swinging blast from start to finish. And it stands up to the standard of excellence he established with his first three albums.

“I always loved that time of year, musically speaking,” the 41-year-old Oklahoma native says. But the real impetus for the album came from his family situation. He and his wife and two daughters had just moved from Tulsa to Nashville, and they spent their first Christmas in their new home last year.

“My family had our own Christmas for the first time — we weren’t traveling to three houses in one day,” he says. “We were self-sufficient in our Christmas for the first time, and I thought, ‘ I really love this.’ "

He ran into a lot of skepticism when he revealed his plans for a Christmas album, especially from fellow musicians.

“J.D. McPherson and his band have finally jumped the shark. They needed some money right away. Or something [like that],” he said of the reactions.

So the singer-guitarist and former teacher set some stiff challenges for himself. The songs had to be all originals, while having plenty of humor and avoiding clichés. Most of all, they couldn’t be saccharine.

McPherson’s main inspiration, even though they weren’t Christmas songs, was the work the legendary songwriting team of Jerry Leiber and Mike Stoller did with the Coasters, the great vocal group of “Charlie Brown” and “Yakety-Yak” fame.

“I really wanted to get that sense of humor and the bit of cantankerousness mixed with that tight writing style,” says McPherson, who will be playing the album’s songs on Wednesday, Dec. 5, at Underground Arts as part of his “Rock ‘n’ Roll Christmas Tour.”

So on Socks you get the title track, about the ultimate in disappointing gifts, and “Ugly Sweater Blues,” which mines the same theme.

“Bad Kid” is a lean rocker about an unrepentant juvenile delinquent, and “Claus vs. Claus” playfully chronicles some domestic tension between St. Nick and his long-suffering wife, played by Lucie Silvas.

“Every Single Christmas” echoes Fats Domino as it celebrates the joys of the season, “Santa’s Got a Mean Machine” channels Chuck Berry, and “Hey, Skinny Santa!” is a jump-blues culinary travelogue about getting the big man up to his usual portly proportions for the season.

Another influence on the album, though not so obvious, he says, is Nick Lowe’s 2013 Christmas album, Quality Street. It’s in the compact writing style (Socks’ 11 tracks clock in at 32 minutes) and the lack of actual jingle bells. On the new songs on Socks, you will hear church organ, celeste, and glockenspiel, but no sleigh bells.

It’s all part of the effort to avoid cliché and achieve one of McPherson’s ultimate goals, which was to make Socks an album you could listen to at any time of year.

As he puts it: “It’s a rock-and-roll record.”

With Eddie Angel’s Guitar Party, 8 p.m. Dec. 5 at Underground Arts, 1200 Callowhill St. Tickets: $22 and $25. 215-627-1332.