That’s the first time I’ve heard of magpies taking eggs, but that sounds right. Some things eat eggs whole, some eat them on the spot, and a very few things, like raccoon, will carry them away a little but not scatter them like that. I could easily see a magpie or crow doing what you describe.
You can always set up a game camera to confirm what is getting them, but stopping magpies may not be real easy. I don’t know if it is one individual that has found your coop, a mated pair, or the entire flock. You want the one or ones that are eating your eggs.
Other than setting up some magpie-proof fencing, maybe using bird netting, to lock your chickens in and magpies out, I have only one suggestion. Trap them. I don’t know what your options are to dispose of them once you get them or what your local laws are, but that’s your business.
They are smart birds and your chickens won’t make this easy because you might wind up trapping them, but find a small live trap, say one sized for squirrels, and set that in your coop. Your feed store might have one. I don’t know what their favorite foods are for bait, probably the same thing your chickens would eat. Just try to figure out where to set that trap so you are more likely to catch the magpies that are eating your eggs than the chickens.
Good luck with it. This sounds like a challenge, partly because they are such smart birds and partly because your chickens will probably work against you.