A cheap tap and die set won't do it.
Threads are not a singular fixed measurement. There are various thread pitches, as well as metric and several imperial standards.
Metric threads are set on 2 variables. The width of the hole or shank, and the distance between each tooth on the thread (pitch). For a standard metric thread you have a table of figures that tell you exactly the pitch to shank/hole relationship.
The trouble been that is not a standard thread pitch by the looks.
It looks to be about M12 but it also looks to be 1.25mm pitch rather than the standard 1.75mm pitch at that diameter.
Now you might think that would be your answer... But you are wrong. 1/2inch imperial standard fine (UNF) could also be pretty close, and if you run the wrong tap and die set you will bugger it up royally.
Since you don't know the thread or the diameter of the fitting, and you don't know if it's metric or imperial you need a tool that tells you these things, You can't just buy a stock tap and die set.
Threads can be totally convoluted, A single metric 12mm shank may have up to 5 thread pitches. 12x 0.75/1/1.25/1.5/1.75 So it's just not worth the risk of going in blind.
The tool you need first is a thread gauge. Preferably one that does metric and imperial. You are not looking for a near match on the thread pitch you are looking for a perfect match. Once you have the perfect thread pitch you then select the hole part on the same scale (metric or imperial) and get the hole size. Using the male part is easier than trying to work in the hole.
With these 2 numbers you can then go and get the correct set of tap and dies for that exact fitting.
https://www.machinemart.co.uk/p/gunson-77106-universal-thread-gauge/
View attachment 39232
If you run a few of these mags having the set is quite valuable. And the thread gauges are very useful. Lost screw? - you can measure one of the others and order the exact same part as a replacement. It takes all of the guesswork away from replacing screws on your guns.