Server Country Flags is a Fabric mod which shows the flag of the country where the server is located, and the city when hovering over the flag, in the server list.
It uses a publicly available IP Geolocation API - https://ip-api.com/
Requires the Fabric API to work.
The mod is configurable, its config file is in the config/servercountryflags/servercountryflags.properties file.