Lightweight Minecraft server status library — Java & Bedrock
Project description
MCStatusX v0.2.0
A transparent, zero-dependency Python library for checking Minecraft server status —
Java Edition & Bedrock Edition — with a built-in CLI tool.
The server decides what you see. MCStatusX never invents data.
What's new in 0.2.0
- Fixed VarInt encoding — proper SLP handshake, works with all hostnames
- Fixed Bedrock parsing — full RakNet
Unconnected Pongpacket parsing (no more raw text decode) - Retry support —
ping(..., retries=2)on timeout ping_many()— ping a list of servers concurrently (ThreadPoolExecutor)- MOTD cleaning —
§color/format codes stripped automatically favicon_bytes()— decode server favicon to raw PNG bytesStatus.to_dict()/Status.to_json()— serialization support__repr__on all models — proper debug output- Richer error types —
PacketError,ProtocolErrorwith clear messages - CLI tool —
mcstatusxcommand, use from terminal without writing code
Installation
git clone https://github.com/TerAlone6300/MCStatusX.git
cd MCStatusX
pip install -e .
CLI Usage
After install, mcstatusx is available as a terminal command.
# Full info (java, default port 25565)
mcstatusx play.example.com
# Specific port
mcstatusx play.example.com:24299
# Bedrock edition
mcstatusx play.example.com:19132 -v bedrock
# Get specific fields only
mcstatusx play.example.com:24299 -g motd
mcstatusx play.example.com:24299 -g motd playerlist
mcstatusx play.example.com:24299 -g playerlist -v java
mcstatusx play.example.com:27812 -g maxplayers -v bedrock
# JSON output
mcstatusx play.example.com --json
# Custom timeout + retries
mcstatusx play.example.com -t 5 --retries 3
Available -g fields
| Field | Description |
|---|---|
motd |
Server description (§ codes stripped) |
version |
Version name + protocol number |
players |
online/max count |
playerlist |
Player sample list (if server exposes it) |
maxplayers |
Max player slots only |
ping |
Latency in ms |
favicon |
Whether the server has a favicon |
json |
Full JSON dump |
Python API
Basic ping
import mcstatusx
# Java Edition
status = mcstatusx.ping("play.example.com", 25565)
print(status.online) # True
print(status.motd) # Plain text, § codes stripped
print(status.version.name) # "Paper 1.21.4"
print(status.version.protocol) # 769
print(status.players.online) # 42
print(status.players.max) # 100
for p in status.players.sample:
print(p.name, p.uuid)
print(status.ping, "ms") # 34 ms
print(status.favicon) # base64 PNG string or None
# Bedrock Edition
status = mcstatusx.ping("play.example.com", 19132, edition="bedrock")
print(status.motd)
print(status.players.online, "/", status.players.max)
Retry on timeout
status = mcstatusx.ping("play.example.com", retries=3, timeout=5)
Ping multiple servers at once
targets = [
"play.example.com:25565",
"eu1.freegamehost.xyz:24299",
("192.168.1.10", 25565),
]
results = mcstatusx.ping_many(targets)
for address, result in results.items():
if isinstance(result, mcstatusx.MCStatusError):
print(f"{address}: OFFLINE — {result.message}")
else:
print(f"{address}: {result.players.online}/{result.players.max} players, {result.ping}ms")
Serialization
status = mcstatusx.ping("play.example.com")
print(status.to_dict()) # Python dict
print(status.to_json()) # JSON string (pretty-printed)
Favicon
status = mcstatusx.ping("play.example.com")
if status.favicon:
png_bytes = status.favicon_bytes()
with open("server_icon.png", "wb") as f:
f.write(png_bytes)
Error Handling
import mcstatusx
try:
status = mcstatusx.ping("play.example.com")
except mcstatusx.ResolveError:
print("Could not resolve hostname")
except mcstatusx.TimeoutError:
print("Connection timed out")
except mcstatusx.ProtocolError:
print("Unexpected protocol response")
except mcstatusx.PacketError:
print("Malformed packet from server")
except mcstatusx.OfflineError:
print("Server is offline")
except mcstatusx.MCStatusError as e:
print("Other error:", e.message)
What MCStatusX does NOT do
- ❌ Does NOT log into servers
- ❌ Does NOT authenticate players
- ❌ Does NOT bypass online-mode
- ❌ Does NOT generate or guess UUIDs
- ❌ Does NOT scrape Mojang or Microsoft APIs
If a server hides data, MCStatusX respects that.
License
MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcstatusx-0.2.0.tar.gz.
File metadata
- Download URL: mcstatusx-0.2.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65e085bb53a812c39e84cfa4970229529255d2a234051e06e3ea03bfab489bd6
|
|
| MD5 |
b24aa9b89c925655a9f845311aa2a2a1
|
|
| BLAKE2b-256 |
828ad61516365bf57d4426e6f29df8535462a98b3cbacba6c1f90cced5911af0
|
Provenance
The following attestation bundles were made for mcstatusx-0.2.0.tar.gz:
Publisher:
pypi-public.yml on AxientStudio/MCStatusX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcstatusx-0.2.0.tar.gz -
Subject digest:
65e085bb53a812c39e84cfa4970229529255d2a234051e06e3ea03bfab489bd6 - Sigstore transparency entry: 1786362618
- Sigstore integration time:
-
Permalink:
AxientStudio/MCStatusX@48d5f4dca531d14da56d7fad614ae19c3874a808 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AxientStudio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-public.yml@48d5f4dca531d14da56d7fad614ae19c3874a808 -
Trigger Event:
release
-
Statement type:
File details
Details for the file mcstatusx-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcstatusx-0.2.0-py3-none-any.whl
- Upload date:
- Size: 13.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a386a030bffd7fd08a803cc8203f1539a01e2aa868c05b0b5054c767c5b2816
|
|
| MD5 |
3012afe4cdd337e9bb88285b53e6fe96
|
|
| BLAKE2b-256 |
9427101fa194f51378bf3b40c5a3f2e2a4ba3009a6bf8c5e1f4e799f49f7aac4
|
Provenance
The following attestation bundles were made for mcstatusx-0.2.0-py3-none-any.whl:
Publisher:
pypi-public.yml on AxientStudio/MCStatusX
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mcstatusx-0.2.0-py3-none-any.whl -
Subject digest:
4a386a030bffd7fd08a803cc8203f1539a01e2aa868c05b0b5054c767c5b2816 - Sigstore transparency entry: 1786363055
- Sigstore integration time:
-
Permalink:
AxientStudio/MCStatusX@48d5f4dca531d14da56d7fad614ae19c3874a808 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/AxientStudio
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi-public.yml@48d5f4dca531d14da56d7fad614ae19c3874a808 -
Trigger Event:
release
-
Statement type: