I know this is four years later, but if you're still wondering, Minecraft servers by default (at least now) do not connect to external scripts. If you're trying to make a discord bot for your server I would make a plugin. It's generally a bad idea to enable query or other things to allow external scripts to read things about your server (see the Copenheimer bot). Hope this helps!