The cat may be clogged/deteriorated so badly that it's choking the engine, sending crazy signals from the O2 sensor to the computer, causing it to surge.
It could also be a bad maf, just unplug the maf, and restart the car and see if it's any better, if not it's probably the Cat.