It depends which game you are playing.
In the first Kingdom Hearts, the recipe is a completion reward: synthesize every other item the Moogles offer and the Ultima Weapon becomes available. Nothing is handed to you early.
In Kingdom Hearts II, go to Twilight Town and find the room with the pods. The recipe is sitting in a chest there, so it is a matter of exploring rather than grinding. Either way the weapon itself still costs a stack of high-tier materials to make.