...if this was the only condition for "what city becomes a capital." Looking at Germany, there's Hamburg, Köln, München...all on nice rivers, but none of them were the capital of Prussia when Germany was first unified - since Prussia was the essential driver of that political process, Berlin became the capital. Something of a coincidence in the grand scheme of things, really.
Beijing has multiple rivers traversing the current municipal area, and they were dammed and directed into channels, or directed underground as the city grew (same for London, by the way - London has multiple historical rivers that are now entirely or almost entirely underground, not just the Thames)
London, Rome, Athens, Lisbon, Dublin, Istanbul, Amsterdam, Venice, the list goes on and on (with the last two historic capitals being right in the water, not even coastal; and while I'm aware that Venice is not a capital these days, theirs was a formidable empire)
London used to be the seaport of England (before railways outsourced this to Southampton); whence do you consider the name Docklands (the huge area downriver of the Tower)? The rest is just nitpicking ("modern Piraeus is not part of Athens") and moving the goalposts (first it's "historic capitals", now it doesn't matter because Istanbul is not a de-iure capital at present, even though it de-facto is? Plus, there's a major stretch of history between Constantinople and present day)
Good harbors happen to be full of wetlands. The current reality, where there are practically no wetlands near large coastal cities, is very artificial.