check the iacv
If I were you I would probably check the idle air control valve(iacv) . When it goes bad you will have a surge in the engine at idle mostly when the car is first started. I have always bypassed it instead of replacing it and never had any problems but if you want to do it right replace it. Hopefully that is what you are experiencing.