I have a 5701 rear derailleur. Here is a picture of it and the box. As you can see the max cassette cog is 30T. I bet a 32 would work easily. A 34T maybe with the B screw all the way in. Otherwise a Wolf tooth thingy would make it work.
There are a few tables comparing derailleurs and pull ratio. I can t find mine but I bet a 9 speed mountain derailleur has the same ratio as a road 10s. I do remember the 10s Shimano road and mountain are different. One needs a cable adapter to alter the ratio.
Oh. I went with this to replace a 10s Ultegra short cage so I could go with a larger cassette. I have a 12-30 but will try a x-34 for some light rail trail touring. Should have sold all the Ultegra parts and wai D until summer for a new proper bike.