Skip to main content
← Back to Thoughts

MCServer StatBot: Minecraft Server Monitor

March 9, 2019mcserver-statbot

MCServer StatBot

MCServer StatBot Icon

An asyncio-based Telegram bot for monitoring Minecraft Java server status in real-time. Built with Python and Docker for 24/7 reliability.

View Source Code on GitHub

The Problem

Running a private Minecraft server for friends means someone always asks: "Is the server up?" Rather than checking manually or logging into a panel, I built a Telegram bot that answers this question instantly.

How It Works

The bot uses Python's asyncio framework to efficiently handle multiple concurrent status queries without blocking. It connects to any Minecraft Java Edition server using the standard server query protocol, retrieving:

  • Online status: Whether the server is reachable
  • Player count: Current and maximum player slots
  • Version info: Which Minecraft version the server is running
  • Latency: Response time to the server

Architecture

The bot runs inside a Docker container for easy deployment and 24/7 uptime on any VPS or home server. The containerized approach means setup is a single docker-compose up command.

Key design decisions:

  • Modern Libraries: Built on python-telegram-bot v22 and mcstatus 12.x
  • Asyncio over threading: Efficient handling of concurrent Telegram API calls and server pings
  • Docker-ready: Reproducible deployment via docker-compose, or lightweight enough to run natively in a python venv
  • Minimal footprint: The bot consumes negligible resources, running comfortably alongside the game server itself

Open Source

The bot is MIT licensed and available on GitHub with full documentation for self-hosting.

GitHub Repository

END_OF_FILE