A vacuum leak is a good probability. Do this test: remove airfilter, have a helper crank the car, gently push the airflow meter til the engine runs smooth. Have the person cranking tell you how fast it is running with you giving the fuel. If you are above 1500 rpm then you surely have a leak.
The concept here is that air is what determines engine speed. If you give it enough fuel to run you verify how much air is entering.
If the speed is less then you haven't set your base mixture adjustment.
Bosch Master, ASE Master, L1
33 years MB technician