Skip to main content

A client for handling Remote Commands (RCON) to a Minecraft server.

Project description

This library provides a straightforward implementation of Minecraft’s Rcon protocol in Python to provide a client for handling Remote Commands (RCON) to a Minecraft server.


The library is availble on PYPI and can be installed with pip:

pip install mcrcon


The recommend way to run this client is using the python ‘with’ statement. This ensures that the socket is correctly closed when you are done with it rather than being left open.


In [1]: from mcrcon import MCRcon
In [2]: with MCRcon("", "sekret") as mcr:
   ...:     resp = mcr.command("/whitelist add bob")
   ...:     print(resp)

While you can use it without the ‘with’ statement, you have to connect manually, and ideally disconnect:

In [3]: mcr = MCRcon("", "sekret")
In [4]: mcr.connect()
In [5]: resp = mcr.command("/whitelist add bob")
In [6]: print(resp)
In [7]: mcr.disconnect()

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
mcrcon-0.5.2.tar.gz (2.6 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page