There is currently no API to do account creation (https://www.mediawiki.org/wiki/API:Account_creation is a draft, and IIRC there is nobody actively working on it). There was a GSoC student working on it last year (https://www.mediawiki.org/wiki/Extension:SignupAPI) but I don't think that's in any state to be deployed soon.