It's now possible to request a parsed wiki page via the MediaWiki API. You have to have node (and all the dependencies) installed. See the README file in the modules/parse directory. It simply shells out to node.js. A more clever version might make use of a node.js daemon, but it was just easier to reuse the STDIN/STDERR/STDOUT model this way.
It's implemented as a 'property' of a title, i.e.:
http://wiki.ivy.local/w/api.php?action=query&prop=parsetree&titles=M...
If I've read the docs right, this should work well with caching.
It doesn't work with format=xml, for some reason.
https://bugzilla.wikimedia.org/show_bug.cgi?id=34058