One issue you would have "venting" the energy of a volcano is that the magma can be hot enough to melt your gear. It is molten rock, but that does not mean it's just barely molten. It can be much hotter than the melting point of a rock. Water melts around 0 degrees Celsius, but that does not mean all water is 0 degrees celsius. It can easily be 95 degrees celius.
Another issue is that magma tends to clog pipes...when it hardens into rock.
There are various kinds of rock, that have different melting points. Making it flow through a pipe without melting the pipe or clogging would be difficult. Think of piping sewage, but with molten rock. You can have some magma hot enough to melt your fancy alloy pipe, while other bits of slag are coagulting to block off the pipe.
So, let's say to drop a heat exchanger into the center of a large magma chamber. Let's say it doesn't melt. Let's say it doesn't clog. How do you avoid the magma working its way up through the rock and coming out where you weakened it with your drill? Reinforcing rock is difficult.
If you do manage to get a heat exchanger working, you will quickly suck the heat out of that local area. Rocks do not conduct heat well, especially when they cool and fracuture.
You might be better off trying something a bit easier, like reflecting lots of sunlight on (purified) water so it boils, then runing that steam (which is now under pressure) through a fan (stem turbine) to turn a generator.
If you think you can tap magma, good luck. I'll stick to things that seem very simple.
RecycledElectrons