According to mIRC help file:
$server(N/address)
Returns the address of the Nth server in your irc servers list.
Properties: desc, port, group, pass
$server(0) returns the total number of servers in the servers list
$server(2) returns the address of the 2nd server
$server(2).desc returns the description of the 2nd server
$server(3).port returns the port(s) of the 3rd server
If you specify an irc server address and it is in your servers list, it returns its associated info.
You can then use a while loop with $server() to list all the servers you're connected to.