You can use the import option saying " Import from another catalog" which will help you to merge both catalogs and get the edits at one place.
But for this you need to take one of the catalog with images to the other computer.
File > Import From Another Catalog should do it, but you need to copy the MacBook catalog and image files over to the iMac. Put it all on the desktop or some place where you don't confuse it with the old catalog, afterwards you just delete it.
There is an option in the dialog for "changed existing photos", as well as importing new ones. I don't do this very often, so maybe someone else will have more detailed instructions.
I have iMac and MacBook. I work on my photos on both machines. Recently, I copied a folder containing a photoshoot pictures in both machines and started editing the photos. Some edits are now in iMac and some are in MackBook. I know, I should have edited the photos in one place, but unfortunately I couldn't do it. I was traveling and did some edit on this folder using my MacBook.
As recommended above, use File > Import from Another Catalog. But one extra precaution as you're doing this for the first time - on the iMac, back up the catalogue.
When you do Import from Another Catalog, it matches file names in the current catalogue with those coming in from the other catalogue. You then have an option to update the existing files with their metadata, metadata plus adjustments (probably choose this one), or not at all, and a separate option for virtual copies which I would leave unchecked. The matching process is pretty smart and should apply the most-recent settings, but review the results and step back to the backup catalogue if needed.