As the legions of Stephen King fans know, a new opus has arrived. The much-anticipated “Castle Rock,” a seasonal anthology series, premieres Wednesday, July 25, on Hulu. “Dropping” on the streaming service along with the first several of the 10 first-season episodes is a short documentary about the places that inspire King and his storytelling.

Castle Rock is a fictional town that appears again and again in the Maine horror writer’s works. Some of its particulars seem drawn from the West Durham area where King grew up. But another recurring location comes from the Midcoast — Thomaston, specifically.

“Castle Rock” springs from a creative collaboration between King and another Midcoast connection, J.J. Abrams, who is known to show up here in the summer. The show weaves together bits and pieces and characters from many a King story, novel and novella, including Shawshank State Penitentiary, famously based on the original Maine State Prison. That’s what drew the documentary’s production crew to town for a short visit June 9 and filming June 13.

Thomaston Historical Society’s Peggy McCrea spoke with the crew, ushered the filmmakers to several sites in town and was interviewed at the THS’ museum for the documentary. That filming took place on the second floor, where MPS artifacts, photographs and more are displayed. The visitors were particularly drawn to the model of the original prison, as built in 1824. It is a grim thing to contemplate, as cruel as if King designed it for one of his stories.

“The prison was simply a room built on a platform with a roof over it. It was open on all the sides, but caged, fenced in, and there were dungeons below, carved into the lime rock,” said McCrea. “There was a ladder that was put down through a hatchway in the morning or whenever the prisoner entered at night; he would crawl down this ladder and be assigned.”

What the prisoners were provided in their assigned stone hovels were a hammock, a stump of wood to sit on and a Bible. A narrow slit in the door let in outside air year-round, while a small hole drilled into the damp limestone carried a little heat, sometimes.

The prison — created as a requirement when Maine became a state — was designed by its first warden, Dr. Daniel Rose, a devout man who expected the prisoners to think about their sins and repent, McCrea said.

“He recommended prison cells be, quote, ‘dark and comfortless abodes of guilt and wretchedness,’” she said.

Rose and his prison inform “Castle Rock,” although much less pegged into history as the local society has them.

“They're jumping all over and they interweave all the previous stories and characters, but Shawshank will figure into this quite a bit,” she said. “They were very secretive about the plot and everything else, so it was very hard to get a grasp of what they're actually doing!”

The crew was not shy about its interest in Warden Rose. They had hoped to film the Rose family’s house, but the current residents demurred. McCrea did take them to the prison cemetery plot and to Rose’s grave, in the Village Cemetery.

“It's a very nondescript stone, and I think they were kind of disappointed,” McCrea said. “They looked around and they saw the other marble ones and higher monuments and said, wasn't he kind of important?”

He certainly was to the infamous prison’s setup. It adhered to the Auburn System of prison reform, which advocated congregate work by day and solitary confinement by night — strictly enforced. The work was in the on-site quarry, one of the reasons the prison was built where it was. Even the prison inspectors and subsequent wardens complained about its wretched conditions. In 1843, a new, cells-in-the-middle building was built.

In 2002, the prison was demolished, after inmates were moved to the new MPS in Warren. A portion of one wall and the graveyard remain at the edges of the now open greenway in Thomaston. But memories of the original linger in local lore … and are documented and displayed at the Thomaston Historical Society’s museum at the foot of Knox Street. McCrea isn’t certain how much of her interview will make the final cut, but she’s sure the museum’s prison model will.

“Oh, they loved that model, just hovered over it,” she said.

For more information on the new filmed-in-Western-Massachusetts series, visit hulu.com/castle-rock; and watch the YouTube trailer — if you dare — posted below. Thomaston Historical Society’s museum is currently undergoing renovations; for more information, visit thomastonhistoricalsociety.com.