$wgLegalTitleChars via Title::legalChars() is exposed in action=query&meta=siteinfo but because it's a regex class designed for PHP, it's really hard to use outside of PHP.
I'm currently working on a Rust equivalent to mediawiki-title and this is a problem. It would be easier if instead of using regexes, they were referenced by some abstraction that each client could transform. For example:
$wgLegalTitleCharacters = [ 'characters' => " %!\"$&'()*,-.:;=?@^_`~", // + 'plus' => true, // / and \ 'slashes' => true, // A-z, 0-9 'alphanumeric' => true, // \x80-\xFF+ 'non-ascii' => true, ];