@Gargron Others have already mentioned #XMPP. And @mike has put up https://git.chinwag.org/chinwag/ejabberd-auth-mastodon as auth script for authentication of ejabberd using Mastodon as a user backend.
@lars XMPP is federated.
And ejabberd is quite easy to setup, so maybe you just want to try it out on your server? 🙂
All friendly creatures are welcome. Be excellent to each other, live humanism, no nazis, no hate speech. Not only for nerds, but the domain is somewhat cool. ;) No bots in general! (only with prior permission) - Registration temporarily closed/approval required, contact me if you want an invite!