If you're a diver, make sure to stop just outside of the Gloucester Breakwater and dive the Chester Poling. It's tough to find the marker buoy as it's disguised as a lobster pot but she's a big metal ship on a flat bottom so you'll be able to sound it out nicely. It's in 90' of water, upright, and makes an excellent New England wreck dive.
Inside the harbor you can anchor just inside the breakwater but I prefer heading deep inside and picking up a mooring or anchoring in Gloucester's Inner harbor. Shops abound; it's very touristy and the food is excellent. Holding is good but be prepared to clean muck off the anchor after pulling it up. An alternative to the inner harbor is across on the other side of the harbor where there's a few moorings at the state park.
The trip up the Annisquam is not one to be missed. The entrance , just outside of the inner harbor, is very narrow and with a drawbridge and there's usually a line to get through. The current can be very strong but dies down immediately after the bridge so I wouldn't plan based on current. Deep draft sailboats should only traverse the river at mid tide and only then while it's rising. There are beautiful homes along this stretch but watch the channel carefully. It's a lazy, comfortable trip and easy to get caught up in looking at the landscape while quietly missing that buoy you should be heading for way off to your starboard. Not to worry, it's mostly sand and you're doing this on a rising tide, right......
It's an hour to get through the river and you can stop along the way, pick up a mooring riverside, and jump over for a swim. It's warm....at least 70 in some spots.
Once out of the river, either head north to the Isles of Shoals or take a sharp right and head over to Rockport.