LAS MERCEDES, Nicaragua (AP) _ Survivors of an early morning raid by Contra rebels on a northern farming cooperative said they were taken completely by surprise.

The rebels struck Tuesday at Las Mercedes, 94 miles northwest of Managua. The town had last been touched by combat in 1983.

''The attack came all of a sudden as we were getting ready for work,'' said Juan Vicente Castillo Ramirez, a 42-year-old farmer, speaking Wednesday from his hospital bed in Leon, 70 miles southwest of the farming cooperative.

''We never expected combat there (Las Mercedes),'' he said. ''The only thing I did was try to save myself.''

Among the seven people reported killed in the raid were three of Castillo Ramirez' eight children. They were killed when his house was hit by a rocket- propelled grenade. Eight people were wounded in the attack.

The Contras have stepped up their attacks inside Nicaragua since the U.S. Congress approved $100 million in military and non-lethal aid for the rebels last year.

The Contras are fighting to oust the leftist Sandinista government, which came to power in July 1979 after overthrowing the pro-American regime of Anastasio Somoza. The rebels operate mostly in northern Nicaragua and have bases in neighboring Honduras.

The Reagan administration says the Sandinista government is a threat to security in Central America.

A Nicaraguan Defense Ministry source, who spoke on condition of anonymity, said the attack was the 12th this month by Contra rebels on farms and farming cooperatives in the country.

Up to now, the fertile valley in which Las Mercedes lies had up to now been considered safe from Contra attacks. The cooperative is in the foothills of a mountain range that extends into the war zone.

Las Mercedes is one of the few state-run cooperatives in the region.

The Contras' tactic of attacking farming cooperatives, which are organized by the government, is controversial. Civilian casualties are considered inevitable because wives and children of the farmers and militiamen live on the cooperatives.

But the rebels maintain that once a farmer carries arms given him by the Sandinista government, he ceases to be a civilian and becomes a target.

In the latest attack, the rebels quickly penetrated the cooperative's weak defenses, surprising the militiamen guarding the farm. The Sandinistas withdrew, witnesses said. Witnesses estimated Contra numbers at between 30 to 150.

It was during a similar Contra raid on a government hydroelectric project in April that an American volunteer, Benjamin Linder, died.

Castillo Ramirez, who said he has a weapon but did not use it, was outside the family's cinder-block house when the grenade hit.

''The children did not have a chance,'' Castillo Ramirez said as he fought back tears.

Among the dead were his 19-year-old and 6-year-old sons and 2-year-old daughter. Three of his other children were injured, including one requiring hospitalization.

His wife also suffered injuries, Castillo Ramirez said.

Castillo Ramirez' legs were wrapped in bandages that covered bullet and shrapnel wounds.

''The Contras came in here and did what they wanted and then they left,'' said Mario Sergio Castillo Ramirez, as he stood next to the rubble of what had been the cooperative's supply center.

Three other buildings were burned by the rebels.

Also Tuesday, two government soldiers were killed and two others wounded in an attack by rebels in the eastern part of the country, another military source said.

The source, who also spoke on condition of anonymity, said Contras ambushed a government security patrol near Villa Sandino, a small town 123 miles east of the capital.