Step 0: Accept that true absolute security is impossible, but 98% is pretty easy.
Step 1: Place my yard complex somewhere within the jump limit, in its own solar orbit far away from objects likely to create their own pirate points. There will be regular flights to and from the system's inhabited world, as well as various local resource extraction operations.
Step 2: Establish regular patrols throughout the system to keep an eye on known jump points as well as their approaches, supplemented by varying patrols to/around/beyond the jump limit sphere,
some of which will be publicly known. After all, deterrence only works if the deteree knows of the deterer's existence.
Step 3: Start building a constellation of passive monitoring satellites, to keep an eye where the patrols aren't. Some will be parked near known points, some will be in orbits near the jump limit(or as close as possible), and some will be on elliptical orbits taking them deep into the system and far out into deep space. A small line at the yard complex all be devoted to producing new sats, to replace old ones as they wear out and to constantly grow the overall constellation.
Step 4: Regular defense forces appropriate to the yard's importance and reasonable expected threats.
Step 5: Instead of large stations, the various functions of the yard will be handled by multiple smaller stations, with a minimum distance from each other so that a nuke strike will kill one station, but not the whole yard. All of these stations will orbit a mutual gravitational barycenter with positions shifting periodically so that the odds of a successful ballistic strike from across the system using asteroids, mass driver shells, or relativistic paperclips are comfortably astronomical.
Step 6: Laser AMS on every station. You don't need many such guns per station, since that many stations will quickly build one hell of an overlapping defense net.
Step 7: Since this spaceborne city has been placed deep in an inhabited system with easy access to resources and a healthy happy workforce, sit back and watch as the yard is far more productive than those isolated secret ones. 8)
How does that work if the yards are not at a pirate point?
Of course, you'd have to tow new jump ships to jump points, but that's part of the security.
Or the JumpShips could fly out under their own power. They've got perfectly good sublight drives of their own. So do space stations. Neither class is immobile(an Olympus-class recharge station could probably fly rings around even a fully fueled space shuttle), people just forget that the "mobile" units in the setting are really Really REALLY fast.