By NEDRA PICKLER, Associated Press

KANSAS CITY, Mo. (AP) — Pointing the finger at Republicans for congressional inaction, President Barack Obama chided lawmakers Wednesday for spending the waning days before their month-long summer break trying to sue him rather than addressing economic issues that could boost the middle class.

"Stop being mad all the time. Stop just hating all the time. Come on," the president said in a boisterous and sharply partisan speech in Kansas City.

Addressing about 1,500 supporters at the historic Uptown Theatre, Obama cast the stalemate in Washington as a personal reaction to his presidency, accusing Republicans of choosing political stunts to undermine him over taking action on issues like immigration, transportation spending and tax reform.

Obama's tough talk came hours before Republicans were planning to push a bill through the House authorizing a lawsuit against Obama and accusing him of exceeding his powers in enforcing his health care law. Obama dismissed the suit as a waste of time, noting he'd likely be out of office by the time it's resolved and warning that taxpayers were on the hook for the legal expenses.

"I know they're not that happy that I'm president," Obama said. "I've only got a couple of years left. Come on, let's get some work done. Then you can be mad at the next president."

At the same time, Obama offered an optimistic assessment of an improving U.S. economy on the heels of new data showing strong growth in the second quarter of the year. "We hold the best cards," he said. "Things are getting better. The decisions we make now cold make things even better than that."

Embracing the populist economic message that Democrats are promoting ahead of the midterm elections, Obama said he was glad that stock markets and corporate profits were booming, but said the country must ensure that the middle class has opportunities to take part in that prosperity. It was a theme the president underscored the night before over ribs and beer as he shared a barbecue dinner with four Kansas City residents in an effort to highlight the struggles of working Americans.

After his speech, Obama meandered along picturesque Main Street in nearby Parkville, Missouri, popping in shops and greeting folks with an iced tea in hand. He cajoled patrons of Parkview Coffee to let him pay for their drinks. "It's not that often the president buys you a cup of coffee," Obama said.

___

Follow Nedra Pickler at http://twitter.com/nedrapickler