IE 11 is not supported. For an optimal experience visit our site on another browser.

Just in time for summer: Dwindling supply of Cape Cod mansions

The Obamas' favorite summer retreat is getting more expensive.

Sales and rental prices on Cape Cod in Massachusetts have surged in recent years, with the rising stock market and housing recovery. Prices and demand are especially strong at the top end of the market, brokers say, with ocean-front estates and lavish family compounds quickly getting snapped up for millions.

Brokers said many wealthy Cape Codders are trading up. Other buyers see the Cape as a strong investment, with bigger properties still selling at a 20 percent to 50 percent discount to the Hamptons in New York.

CNBC has learned that billionaire William Koch—the sailor, wine-collector and brother of famed conservatives David and Charles—is putting his historic compound on the private island of Oyster Harbors up for sale. Robert Paul Properties, an affiliate of Luxury Portfolio International, is about to list the property for $15 million.

Koch is selling after he purchased a nearby estate previously owned by Rachel "Bunny" Melon for $19.5 million, according to reports.

The property Koch is selling was built in 1929, and has been expanded and renovated to include a state-of-the-art wine cellar, chef's kitchen, beach house and guest quarters. Since Koch is a longtime sailor—his boat "America" won the America's Cup in 1992—the property also features a 106-foot dock and a "ship's room modeled on the captain's quarters of a Napoleonic-era frigate," or boat of its time.

The Cape has always been the less-expensive, more laid-back cousin to Newport, R.I. and the Hamptons. But the Cape is quickly gaining in price and luxury, to the consternation of many longtime residents. Two of the most expensive listings this summer are priced at around $20 million.

(Read More: Mansion Shortage Could Slow Sales in Rich Towns)

The top listing in Martha's Vineyard, the Obamas' favorite summer retreat, is a property called Herring Creek Farm, a 25-acre estate on the market for $19.5 million. The farm sits on a private corner of land off Slough Cove. Located on the southeast part of the island, the property features sweeping views of Edgartown Great Pond and the Atlantic.

The main house of Herring Creek Farm is 5,615 square feet. But the property can include another family home and guest house if the buyer wants to expand, said Thomas Wallaceof Wallace & Co. Sotheby's International Realty, the real-estate firm listing the property.

The Obamas summered on the Vineyard in 2009, 2010 and 2011, and they are expected there again this year. Yet it's unclear where they will stay, since their previous vacation home—the 28-acre Blue Heron Farm—was sold in 2011 to British architect Norman Foster for $21.9 million.

The top listing in Nantucket is a historic mansion called Long Hill, which is listed at $20 million. The 7,211 square-foot home is perched on one of the highest points in town and overlooks the Harbor and Coatue. The renovated home also comes with formal English gardens and a separate building lot.

Gary Winn, principal and owner of Maury People Sotheby's International Realty, which is listing Long Hill, said inventory in Nantucket has fallen by 40 percent, as buyers scoop up top properties.

"This year there is less inventory (in the high end) but we're selling more units and having more closing," he said. "Last year we had an unbelievable year in the high-end market."