As with all foreign countries, Mexico has formalities to entering and transiting their country by foreign vessels. These protocols are descendent from the times of the trading vessels that cruised from port to port in search of goods to buy, sell or trade. Entering and travelling in a foreign country by boat is often covered by different customs and immigration laws than those that pertain to air travelers.
In Mexico there is no need to pull into a harbor and raise the "Q" flag and wait for the inspectors. They are not coming. We have heard that for several weeks they were inspecting boats in Cabo San Lucas but it was only after checking in. In Mexico you arrive in a port and go ashore to check in.
Your first stop is always Immigration. If it is your first time in the country you will receive a 6 month visa. If it is your first time checking in to the country you need to visit the Aduana we know as Customs. Here you declare dutiable goods (yeah, right) and you receive a 6 month importation clearance for your boat. Next you visit the place to pay your port tax. This is only a couple of dollars. Last you visit the Port Captain. At each stop you hand over a copy of your crew list so you need to start with 6 copies. You may also need a copy of your boat documentation and copies of your passports. An example crew list may be picked up at Downwind Marine.
Once in the country it is a good idea to get a 20 year permit for your boat. Even if you plan to leave in 6 months you is a good idea to get it because plans change. The Aduana will give you a simple form to fill out in triplicate. It is Spanish and English. You turn this in with a few pesos and they arrange to inspect your boat. They only want to verify the hull number. You do need to do this when you plan to spend a couple of weeks in one city because the inspection appointments may be rearranged a couple of times.
Services will offer to do all of these services but they are usually pretty expensive for the service provided. Is San Diego we had a service prepare our crew lists and get our fishing permits and they charged around $40. We had friends do it themselves in about an hour. You do need a fishing license for every person on board as well as the sailboat and the dinghy. In total it was around $300 but you will get in a lot of trouble if you are caught without these and any fishing gear onboard. The Mexican Navy conducts periodic inspections of boats and their paperwork. We have talked to people that have had these inspections and they said that the Navy was very courteous but thorough.