Using an iPhone application to auction off your street parking space to someone circling the block might sound tailor-made for a tech-savvy, parking-space-starved, high-cost-of-living city like San Francisco.

It might, except it’s illegal.

That’s the opinion of City Attorney Dennis Herrera, who sent a cease-and-desist letter Monday to MonkeyParking, threatening the Rome-based tech startup with a lawsuit, saying the business model for its mobile app is entirely premised on illegal transactions.

Herrera, in a letter to MonkeyParking CEO Paolo Dobrowolny, says city law prohibits anyone from buying or selling public street parking spaces. The company must cease activity in San Francisco by July 11 or face legal action, Herrera wrote. The letter, a copy of which was sent to Apple’s general counsel, also request that Apple remove MonkeyParking from its App Store, saying the program is illegal and may result in physical harm because of crashes by distracted drivers.

The dispute is just the latest between the fast-moving tech industry and existing laws, and San Francisco has been a crucible of that friction, particularly over ride services like Uber and Lyft, vacation rentals through companies like Airbnb, or tech firms illegally using public bus stops for corporate shuttles.

MonkeyParking, where drivers can auction off their space starting at $5 with default options up to $20, was also seen by some as only exacerbating San Francisco’s fast-growing divide between rich and poor by using a public resource to provide parking only to those who could afford it.

“Technology has given rise to many laudable innovations in how we live and work,” Herrera said in a statement. “MonkeyParking is not one of them.”

Dobrowolny could not immediately be reached for comment, but he told The Chronicle’s Vivian Ho in May that his company was just a facilitator between those looking for parking spots and those who need some incentive to leave a space.

“We’re just providing information when someone is leaving,” he said when MonkeyParking was rolled out in San Francisco. “That is valuable information for everybody.”

Dobrowolny disputed that the app would cut out those unable to pay up to $20 each time they need to step out of their car.

“It’s a fair business for anybody,” Dobrowolny said. “It’s not just for rich people. If you think you can get that money back when you leave that parking spot, you can earn back the money when you leave the spot.”

MonkeyParking, currently only available for Apple mobile devices, allows parked drivers to list their location and a minimum dollar amount for their space. Drivers searching for a space can use the app to bid on one nearby.