The mass airflow sensor (MAF) is located inside the engine compartment and is used to measure the amount and temperature of air that is entering the engine at any one time.
Older-style meters used on fuel injection systems in the 1980s measured air volumetric flow, which worked fine. But then you also needed a separate sensor to figure out how cold or dense the air was. The mass airflow sensor senses the total amount of air passing the sensor and allows the fuel injection system to adjust the fuel mixture to compensate for cold weather and/or high altitude conditions.
The MAF also incorporates an internal intake air temperature sensor that measures the temperature of the intake air.

The first indication that you might have a problem with the MAF is the presence of check engine light(CEL) on your dashboard, the check engine lamp can be caused by a wide variety of problems with the engine.
You need to read the codes fiom the computer to get a starting clue as to what the problem is .
It perfectly safe to continue to drive the car while the CEL is on, as long as it is not flashing.
However, the engine will not be operating at peak efficiency, and you will most likely experience a loss in power and a decrease in gas mileage as a result.
It's best to get the problem taken care of relatively quickly, as running the engine in this condition can potentially cause damage to other components, such as the catalytic converters.
The computer will know if something is wrong with the MAF because it will compare the values being output by the sensor with "expected" values that it should be receiving. This commonsense check by the computer helps diagnose problems wirh every component in the system.
If the MAF becomes dirty and is falsely indicating to the engine that the car is receiving very little air while at full throttle, then the computer will most likely kick back an error code.
To gain more infor'mation about the problem, you can try disconnecting the sensor completely and take the car for a drive. If you take short drives (30 minutes or less) with the sensof disconnected, it shouldn't cause any major damage to your car. The engine managetment system (DME) will enter into a type of "limp mode" that will compensate for the missing MAF. If engine performance improves dramatically when disconnecting the MAF, then the problem quite likely lies with the MAF.

Vacuum leaks and other air leaks in the system can cause MAF sensor errors.
If you have a crack or leak in your air intake downstream of the sensor, then the MAF will be sensing less air than the engine is actually receiving. If the clamp on the throttle body happens to come loose and fall off, then the MAF will indicate almost no air being sucked through the intake, yet the engine will be sucking air directly from the engine compartment into the throttle body. The bottom line is that you should carefully inspect all of your hoses, clamps, and intake tubes for air leaks prior to replacing the sensor.
The MAF is located on the left side of the engine compartment, just behind the air filter.
For some reason, Porsche made it unusually difficult to remove the MAF by securing it with a T20 tamper-proof Torx screw.

Torx screw of MAF

You need the special tamper-proof Torx drivers, which are not typically found in everyone toolbox, but usually can be purchased at a good local auto parts store.

Tamper proof Torx T20 driver

Although the holes on the MAF look symmetrical, they are not, and the unit can only be installed in one direction. See Photo for a close-up of the MAF. Removal is easy once you have the tool.
Simply remove both screws holding it in place and pull it out. Boxsters from 2005 and later have a MAF with an integrated housing-- simply unclamp the housing kom the intake tube and remove it.
It is very important to keep the sensor clean. If the air cleaner isn't working too well, it could allow dust and debris to collect on the MAF.
If you've had a problem with your air-oil separator it may have contaminated the sensor as well.

Clean MAF sensor

Oil sucked into the engine intake from a defective separator can easily find its way back to the imake tube. If you have had major engine problems (like a blown-up engine), then you may find a ruined MAF. If you have an aftermarket reusable air filter, beware of how much cleaning and filtering oil you use on it. Excess oil may get sucked into the intake and find its way onto the MAF. To keep your MAF healthy, I recommend changing or cleaning your air filter often.
If you are replacing your sensor it is extremely important that you get the proper one for your car. There are two basic types, one for the cars that use a traditional throttle cable (up to 1999) and one for cars with an E-gas electronic throttle (2000 and later}. In addition the later- style E-gas sensor has been updated at least twice as of this writing. Porsche updated the sensors in the Boxster in mid- 2000 and also released a new version of the DME software that is a required update, if you are going to use this new and improved sensor (see Porsche Tech Bulletin Boxster 1a/00 2445).
Below is a chart that shows the differences between all of the sensors:

First updated sensor for E-gas cars (discontinued and replaced with version 125.01 below)

986.606.125.01

0-280-218-055

Mid 2000-2004 Boxster/ Boxster S

Latest updated sensor

987.606.125.00

0-280-218-145

2005-All Boxster/Cayman

Integrated housing design

If you own a 2000 Boxster or 2000 Boxster S, then you need to make sure that you have the proper sensor installed. Much confusion lies in the fact that most people don't know if their car has been updated by Porsche or not. If the old sensor that you removed is 996.606.124.00, then you need ro replace it with the same part number (or have Porsche update your DME software to accommodate the newer-style sensor -- see Technical Service Bulletin 1/00 2445 Air Flow Sensor, dated 4-18-00}. If the old sensor you're removing ends in 125.00 or 125.01, then replace it with 986.606.125.01 (the latest version available).

After reinstallation, reset your CEL using your code reader.
You can also disconnect the battery for a short while to reset the lamp, but I don't really recommend this approach.On 1997-2002 Boxsters, you can disconnect the battery for more than 20 seconds, but less than 50 seconds, to clear the trouble codes without having to enter your code back into your radio.On pre- 2003 cars, the computer's CEL memory, is cleared after being disconnected for 20 seconds, but the radio code is needed after 50 seconds disconnected.

After you have replaced or cleaned the sensor and cleared the code, you need to go drive the car and see if the code returns. If the same error code appears, then the problem probably lies elsewhere. Most of the time when you have an error code indicating a problem with the mass airflow sensor, it is usually solved by the installation of a new sensor. However the computer can become confused sometimes and give misleading error messages. Wire harness issues, DME problems, and secondary air injection equipment problems may all give false MAF error codes. At this point it is best to dive into the factory manuals and start going through the laborious test procedures contained in there.