Skip to content
Use minecraft's new-fangled Rcon
Branch: master
Clone or download
#1 Compare This branch is 3 commits ahead of CraftySpaz:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore add gitignore and remove unwanted files Apr 15, 2018
COPYING.txt Refine library Apr 15, 2018
README.rst Refine library Apr 15, 2018 fixed issues with _send rename and __enter__ not returning Apr 15, 2018 fixed issues with _send rename and __enter__ not returning Apr 15, 2018



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()
You can’t perform that action at this time.