mcpylib
Python library for controlling Minecraft servers with python code.
What it is and what it does
MCPyLib is a client library that connects to a Minecraft server over the network and lets you control it programmatically from Python code. It provides methods to place and query individual blocks, fill regions, teleport players, change game modes, and manipulate world time and weather. The library depends on python-dotenv for configuration management and requires Python 3.11 or later.
The package is in active development (alpha status) with a small but growing user base. It is licensed under a Non-Commercial License, which means it is free to use for personal projects and learning but cannot be used in commercial or monetized applications without explicit permission. The library is straightforward to install and has low dependency friction, making it accessible for hobby Minecraft server automation and scripting.
Use it for:
- Automate world-building tasks like filling large regions with blocks or placing structures programmatically.
- Build admin tools that teleport players, change game modes, or manage world time without manual commands.
- Create event systems or game logic that responds to server state by querying player positions and modifying the world.
- Develop testing or validation scripts for Minecraft server configurations and world state.
- Integrate Minecraft server control into a larger application or bot framework for community management.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
MCPyLib is a Python client library for remotely controlling Minecraft servers, allowing you to place and query blocks, manage players, and manipulate world state through a programmatic API.
Yes, if you are building a non-commercial Minecraft server automation tool or hobby project. The package is actively maintained, has low install friction, and provides a clean API for common server control tasks. However, the non-commercial license is a hard blocker for any monetized or commercial use, and the alpha status means the API and behavior may change. Verify that your target server software supports the remote control API MCPyLib expects before committing to it.
Install
mcpylib on PyPI
pip
pip install mcpylibuv
uv add mcpylibpoetry
poetry add mcpylibInstalling mcpylib
Before you install
Low install friction with a pure-Python wheel and only one runtime dependency (python-dotenv). The package is actively maintained with recent commits, though it is still in alpha status (Development Status :: 3 - Alpha).
License in practice
Licensed under a Non-Commercial License. This restricts use to non-commercial purposes only—commercial projects or monetized applications would need explicit permission or an alternative license.
Quickstart
pip install mcpylib
from mcpylib import MCPyLib
mc = MCPyLib(ip="127.0.0.1", port=65535, token="your_token")
mc.setblock(100, 64, 200, "minecraft:diamond_block")
block = mc.getblock(100, 64, 200)
print(f"Block: {block}")
Requires Python 3.11 or later. A running Minecraft server with the appropriate remote control API enabled and a valid authentication token are also required.
Verify before relying
- Which Minecraft server software (Bukkit, Spigot, Paper, etc.) or plugin is required to expose the remote control API that MCPyLib connects to.
- Whether the server-side setup and token generation process is documented or straightforward for new users.
- Performance characteristics and latency impact when issuing commands to a remote server.
Package facts
| License | Non-Commercial License - See LICENSE file for details (noncommercial) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — python-dotenv |
| Maintenance | actively maintained — 156 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 544,889/month — #6,080 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: mcpylib-1.1.1-py3-none-any.whl
Keywords: minecraft, bukkit, spigot, api, python, library, remote, server
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
mcstatusQueries Minecraft servers (Java, Legacy, and…
permissive · top 15,000 on PyPI
nbtlibRead, write, and edit NBT (Named Binary Tag)…
permissive · top 15,000 on PyPI
amulet-coreAmulet Core reads and writes Minecraft world…
unclear · top 15,000 on PyPI
amulet-leveldbProvides a Cython wrapper around Mojang's…
unclear · top 15,000 on PyPI
music-assistant-clientPython async client library for connecting to…
permissive · top 15,000 on PyPI
pysqueezeboxAsynchronous Python library to control Logitech…
permissive · top 15,000 on PyPI
pybluControl and query BluOS audio players over the…
permissive · top 15,000 on PyPI
yoto-apiAsync Python client for controlling Yoto player…
permissive · top 15,000 on PyPI
aioshellyAsynchronous Python library for controlling…
permissive · top 15,000 on PyPI