Harry J. McGuirk came out swinging today. With only 34 days left until the Democratic primary, the underdog gubernatorial candidate abandoned his low-key, run-on-my-record approach to his campaign and went on the attack against Gov. Harry Hughes.

The Baltimore state senator used the belated opening of a headquarters here as a backdrop for his offensive, standing in the middle of his North Charles Street campaign office waving a yellow-and-white Hughes brochure and questioning the claims made in the literature.

"All this is a lot of campaign rhetoric," McGuirk told about 150 supporters. "My opponent is taking credit for tax credits and tax reductions that were put through because of what the legislature did, not because of him. He says there have been less deaths on the highway during the first six months of the year because of his drunk driving package when that package didn't even go into effect until June 1. He talks about 14,000 new jobs in Maryland and I ask if there are so many new jobs, how come we have so much unemployment in this state?"

Pointing to Hughes' mention of a new prison to be built in Hagerstown, McGuirk said the bonding for it was passed in 1978 and "only this year are we beginning to get that prison built.

"If the governor doesn't like what I'm saying about this brochure I'm willing to debate him on these issues at any time, any place," McGuirk said. "Twice I've gone to debates expecting to debate the governor and walked in to find (Ocean City) Mayor (Harry) Kelly (another Democratic candidate) as my opponent."

Hughes spokesman Lou Panos said that the governor plans to debate McGuirk at least once before the Sept. 14 primary, most likely on television the last weekend of this month.

As for McGuirk's comments about the brochure, Panos said, "Certainly the legislature deserves credit for legislation that passes. I guess you can't have legislation without a legislature. But there were 84 administration-sponsored bills, 77 of them originating with the administration, for which the administration deserves some credit." Panos said the traffic statistics (116 fewer deaths) were cited because of several bills passed in 1981 and because of overtime expenditures for night patrols by state police.

McGuirk apparently hoped to use this day to shore up his campaign, which received unfavorable publicity Tuesday night when Bob Reid, a Frederick newspaper reporter hired just 12 days earlier as press secretary, resigned because of differences with campaign manager Elayne Hettleman. That news came just 10 days after McGuirk's running mate, Lt. Gov. Samuel W. Bogley, openly questioned the viability of the campaign.

Today, McGuirk received a small boost when Mayor William Donald Schaefer made a brief appearance as McGuirk was finishing his speech. Although Schaefer has made it plain that he does not like Hughes, the mayor apparently will not go so far as to endorse McGuirk or Republican Robert A. Pascal. Instead, Schaefer shows up at functions such as today's, makes a brief speech singing the praises of the Hughes opponent and then disappears.

Bogley also showed up, but his late arrival prompted jokes about where he might be. "Free Sam," was one of the calls before Bogley walked in at noon, just as McGuirk was cutting the ribbon to open the headquarters.