All works

III. 2026 · Personal project

MC Server Stats

A REST API that reports live player stats from a Minecraft server over RCON, with no mods.

For the Minecraft server on my home lab

The problem

Getting live player info out of a vanilla Minecraft server, like who’s online, where they are, and how they’re doing, usually means installing mods or plugins.

What I built

A FastAPI service that talks to the server over RCON, the remote console built into the game, and turns its text replies into JSON. It runs in Docker, reuses one connection for every request, and returns a clear 502 instead of crashing when the game server is down.

REST endpoints
7
mods or plugins needed
0
shared RCON connection
1

This FastAPI service connects to a Minecraft server over RCON, the remote console protocol built into the game. It sends ordinary console commands and turns the text replies into JSON: who’s online, the world seed, and each player’s health, position, hunger, and XP.

It keeps one RCON connection open and reuses it for every request. If the game server is down, the API still starts and returns 502 until the server comes back. It runs in Docker Compose, reads its settings from environment variables, and comes with interactive Swagger docs.

  • Python
  • FastAPI
  • RCON
  • Docker