Friedrich Dürrenmatt’s dark satire The Visit turns on a macabre bargain offered to an economically depressed and, as it turns out, morally bankrupt town. The musical version by John Kander, Fred Ebb and Terrence McNally has the same edgy irony, even cynicism, that drove the trio’s collaboration Kiss of the Spider Woman and Kander and Ebb’s Cabaret and Chicago. But McNally’s adaptation, and some of the songs, soften the edges of the 1956 play and blur its chilling impact.

The show was first seen in Chicago in 2001 and has yet to appear on Broadway, despite its creators’ list of hits, and the current production at the Williamstown Theatre Festival might be intended as another out-of-town tryout.

The Visit takes place in a tight little central European town (Dürrenmatt was Swiss) that has fallen on hard times. A much-anticipated visit from Claire Zachananassian, who grew up here, was driven out by prejudice and scandal, and has since become the world’s richest woman, holds the promise of a reversal of the town’s down-at-heel fortunes. Economic salvation, though, has a human price tag. In exchange for the gift of an astounding sum, the old woman demands a death: the local shopkeeper, Anton Schell, who years ago loved and betrayed her.

The piece is a parable of greed and hypocrisy, as the townsfolk begin to acquire gaudy possessions on credit (represented here by bright yellow shoes, contrasting with their shabby monochrome garments) while assuring Anton he won’t be harmed. Director John Doyle has given the piece an appropriately Brechtian feel, with harsh, expressionistic makeup shadowing the villagers’ faces and Claire’s two blind eunuchs in whiteface masks.

In a program note, McNally calls the piece “a tragic love story … sort-of-like Romeo and Juliet,” and the musically sappy and stylistically incongruous “You, You, You” underlines that take on it. But the Shakespearean parallel, if any, should be Titus Andronicus: a terrible wrong provokes a gruesome reprisal.

The script follows the original pretty closely, while adding two silent characters: the young Claire and Anton, joyfully and carelessly in love, who observe and sometimes entwine with their older selves. There are also some apt and arresting images. Claire arrives with a pile of suitcases atop a sleek black coffin, which remains on stage as a versatile prop and a constant reminder of her purpose. Scott Pask’s set evokes both a gloomy cloister, its pillars overgrown with vines, and a ruined glass cathedral overarched with broken skylights.

Chita Rivera, a frequent Kander and Ebb leading lady, is Claire, imperious in an ice-white outfit and delivering her numbers in a fittingly Brechtian singspiel approximation of the notes. She’s a magnificent presence, but oddly lacking the steely resolve that has made her character survive the villagers’ old taunts and Anton’s cowardly rejection, and that now drives her to take a ghoulish revenge on them all. Perhaps it’s due to the love-rekindled theme that’s been foregrounded in this version, which muddies the through-line and the final payoff. Roger Rees, a former WTF artistic director, returns as Anton, bringing a poignant mix of panic and submission to the man’s impending doom.

The piece explores issues of morality, justice, corruption and human nature in engaging and often satisfying ways, both dramatically and musically. It’s that dangerous tendency in American musical theater, the urge toward romance and sentiment, that practically sinks it.•

Through Aug. 17 at Williamstown Theatre Festival, 1000 Main St., Williamstown, (413) 597-3400, wtfestival.org.