I believe it's Montana that passed a law several years back requiring a person with a firearm within the vehicle to notify an approaching police officer of the presence of a gun prior to the officer reaching the vehicle.
Yes, what a wonderful way to start a traffic stop. Roll down your windown and yell to the cop, "I've got a gun!"
Personally, in MA and NH, you are under no obligation to disclose the presence of a firearm to a police officer unless asked, and I wouldn't elevate his situational threat level by telling him if he doesn't ask. I don't believe you are actually required to inform that officer if he asked, but you'll likely get a better result from the officer if he does.
My father was a police officer for 26 years and I had the liberty of watching some of his training and discussing things with him. During a traffic stop, a lot of items are at the disgression of the officer: How long the stop will last, if you recieve a ticket, what the ticket will be for (if there are multiple infractions) so it's often best to try and put the officer at ease. If you try to put the officer in his place and you've done ANYTHING wrong, he's much more likely to "stick it to you"
Here are some hints:
Be considerate of the officer when you choose a location to pull over. Pulling over at a narrow part of a street, blocking a driveway or parking lot or (one of the biggest offenses) on an ON or OFF ramp makes the situation more dangerous for the officer and will likely annoy the officer, you're more likely to get a ticket if you pull into an inconvient location.
Roll down your window and get your driver's licence and registration ready before he gets to the car. You both know that he's going to ask for it, so things will likely go smoother if you have it ready.
I'm not sure about MA law but in NH you are REQUIRED to present ID to a requesting officer. NH Supreme Court has ruled that a driver's licence is the property of the state issued into an individual's care and thus requesting a driver's licence is not a search. This also means they can run tests on a licence without a warrant or permission (Two specific cases were a Mayor's Wife who refused to hand over her license and a man who's license tested positive for traces of cocaine as he'd used it to cut lines with)
Once you have those ready, place them visibly on the passenger seat and return your hands to 2 o'clock and 10 o'clock on the steering wheel. Officers are taught "95% of threats come from a person's hands, keep a person's hands in plain sight" Hiding your hands, even one of them, increases an officer's threat level.
Watch the officer in your rear view mirror as he approaches, this keeps you looking ahead while you monitor the officer's approach. Again, if you turn to watch the officer, lean out the window or (huge no-no) get out of the car, you will place the officer in an increased threat situation.
When the officer reaches the window, be polite and wait for him to ask for your license and registration. I use sir, ma'am or officer, but that's my nature. An aggressive, disrespectful or argumentative response will aggrivate the officer and likely increase your chances of getting a ticket AND slow down the process.
I like to politely ask the officer why I was stopped, "Hello officer, may I ask why you stopped me?" if they don't immedately ask, "Do you know why I stopped you?" Do NOT ask the officer, "Why the hell did you stop me?"
If you are asked to step out of your car, you do have the RIGHT to ask for a second officer of your sex to be present. Keep in mind this will normally annoy the officer AND lengthen the process while you both wait for a second officer to arrive.
If an officer asks to search your car, you again have the RIGHT to refuse to give permission. If he believes he has probable cause, he can request a warrant - He has you stopped and has access to his radio. He has the oppertunity to call dispatch to request a warrant and there is no risk of evidence being distroyed while he waits for a warrant (since he is there watching) This will make the stop take MUCH longer and you will almost ALWAYS get a ticket for the original offense if you refuse permission for a search.
All this being said, when I'm pulled over, I approach an officer as an advisary - He is typically looking for illegal activity to get you in trouble for, however I do not act advisarial. Even if an officer is looking to get you in trouble, it's usually not for the purpose of getting you in trouble. Most officers are honestly trying to serve their communities.