- Home
- MCP servers
- Minecraft
Minecraft
- python
3
GitHub Stars
python
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
You can run a Python-based MCP server that talks to your Minecraft server over RCON, letting you issue commands and manage gameplay from an MCP client or editor. This setup exposes a commands dictionary, executes commands on the server, and supports local development or production HTTP/SSE transport.
How to use
You connect to the MCP server from an MCP client or editor. The server loads a set of available commands from its internal dictionary and uses RCON to send those commands to your running Minecraft server. You can also integrate a chat client that listens for player input and triggers actions through the MCP tool run_minecraft_command. Start the MCP server first, then start any optional client or chat tooling. You typically run commands locally for testing and switch to a production transport for remote control.
How to install
Prerequisites: Python installed on your machine, a running Minecraft server with RCON enabled, and network access to the server. You may also want a virtual environment to isolate dependencies.
python -V
pip -V
# Step 1: Set up a virtual environment
python -m venv venv
venv\Scripts\activate # on Windows
source venv/bin/activate # on Unix-like systems
# Step 2: Install dependencies
pip install -r requirements.txt
# Step 3: Run the MCP server
python mcp_server/server.py
# Optional: run the chat client after starting the server
python mcp_server/mcp_chat_client.py
Configuration and usage notes
Enable RCON on your Minecraft server by editing server.properties and setting: enable-rcon=true, rcon.password=minemcp, rcon.port=25575. Create a .env file with paths and API keys needed by the MCP server components.
MINECRAFT_LOG_PATH=C:\Users\YourUser\Desktop\mineserver\logs\latest.log
MCP_SERVER_PATH=mcp_server/server.py
GEMINI_API_KEY=your_gemini_api_key
Running the MCP server and chat client
Start the MCP server in a dedicated terminal or background process. This runs the Python script that wires commands to the Minecraft server via RCON.
venv\Scripts\activate
python mcp_server/server.py
Chat client usage with @ai
Open a second terminal after the server is running. Activate the same virtual environment and start the chat client. The client watches the Minecraft server log for messages that begin with @ai, forwards them to the Gemini API, and executes the resulting command on the server through MCP.
venv\Scripts\activate
python mcp_server/mcp_chat_client.py
Integration with Claude Desktop
You can integrate the MCP server with Claude Desktop by registering a server entry in Claude’s configuration so Claude can communicate with the MCP server via the stdio transport.
What to customize
You can customize the commands dictionary in commands.json to add or refine the commands available to the MCP server. The server uses mcrcon to send commands to the Minecraft server, so ensure the commands match what is supported by your Minecraft version.
Troubleshooting and notes
If the chat client reports memory overflow when starting before the server, start the MCP server first and then launch the chat client. Monitor the server log for RCON connections and command execution results to diagnose issues.
Available tools
run_minecraft_command
Sends a command string to the Minecraft server via the MCP tool and returns the result, enabling dynamic server control from the MCP client.