If you just have the server address and the server is not on the public server list its very tricky to check number of players.
There was a discussion about a binary server querying format last year on #minetest-dev
If the server is in the public server list you just have to fetch
http://servers.minetest.net/list parse the JSON and find the server