Minecraft-MCP-Server
Python MCP Server to control a Minecraft server via RCON, using FastMCP.
π§ Features
Exposes a set of commands (dictionary) to contextualize the LLM
Executes commands on the Minecraft server via RCON
Integration with Claude Desktop or any MCP client
Simple structure:
stdio(local development) or HTTP/SSE (production)
π¦ Project Structure
βοΈ Installation
Clone the repository:
cd Minecraft-MCP-Server/mcp_serverCreate an environment and install dependencies:
python -m venv venv venv\Scripts\activate pip install -r requirements.txt
π Setup
In the commands.json file, you will have a list of commands like /give, /weather, /gamemode, etc., with descriptions and examples.
Donβt forget to enable RCON in the Minecraft server.properties file:
Create a .env file like this:
π Running the MCP Server
Activate the virtual environment and run:
Monkey patch: starts MCP server in STDIO by default (, , )
π¬ Running the Chat Client (@ai)
After starting the server, in a new terminal, run the chat client:
This script monitors the Minecraft server log and listens for player chat messages that start with @ai. It sends the message to the Gemini API and executes the resulting command on the server via MCP.
β οΈ Important: The server must be started before running the client.
Current version has a known memory overflow bug if the client starts before the server.
βοΈ Integration with Claude Desktop
In claude_desktop_config.json (e.g., %APPDATA%\Claude\):
Then restart Claude β the βminecraft-controllerβ server will appear.
π§ͺ Local Test with Python
π§° How It Works
π―
FastMCPautomatically loads tools and resources (, )Resource
minecraft://commandsprovides the commands dictionaryTool
run_minecraft_commandusesmcrconto send commands to Minecraft
π References
[FastMCP v2 β Sample README] ()
[mcrcon β Python RCON client] ()
π Next Steps
Support for HTTP/SSE transport with Docker
Argument validation/autocomplete via commands dictionary
Logging extra actions:
/start,/stop,/backup,/whitelist
Ready to make your server smart! π