A library to connect to Source Dedicated Servers CS:GO, CSS, TF2, ... and support for Minecraft Query Protocol

Get started

Import the library (make sure to check for the latest version).

    source_server: ^1.1.0

And call the SourceServer constructor.

It contains both RconServer and QueryServer instances, if you wish to use just one protocol you can still use one of those classes.

// The SourceServer constructor requires an InternetAddress and a port, if you wish to
// use the rcon connection as well you need to provide a password as well.
var server = SourceServer((await InternetAddress.lookup('')).first, 27015);

The only required parameter is the first, password, the ip and port by default are: localhost:27015

To establish a connection to the server call the connect method. It will return a Future<void> that will be completed when the connection to the server is successfully established.

await server.connect();

Sending commands to the RCON


var reply = await server.send('status');

the method command will return a Future<String> what will return the command reply.

the SourceServer provides also a way to parse the status command.

var status = wait server.getStatus();

Example reply:

		hostname: Server name, 
		version: 886/7424 secure  [G:1:xxxxxxx], 
		udp/ip:  (public ip:, 
		os: Linux, 
		type: community dedicated, 
		map: de_mirage, 
		players: 0 humans, 0 bots (16/0 max) (not hibernating)
	//If the server is not empty it will return a list containing all the players in the server (and it's info)
	players: []

Sending commands using the query protocol

Look in the API documentation for all the available methods, here is an example:

var info = server.getInfo();

Returns a Future<Map> holding all the (parsed) server info.

Example for Minecraft Implementation

(Currently it's only supported the RconProtocol)

  var server = MinecraftServer(InternetAddress(''), 27015, 'mypassword');
  await server.connect();
  print(await server.send('say hello'));


Check the issues page on github


Support for both Query and RCON Source protocols. Refer to: for the protocols documentations.
Support for both RCON protocol. Refer to: for the protocol documentation.