VOOZH about

URL: https://mcp.so/server/minecraft-mcp-server/Peterson047

⇱ Minecraft MCP Server MCP Server


Minecraft MCP Server

@Peterson047

Python-based MCP server for seamless Minecraft server management via RCON. Integrates FastMCP for easy command execution, supports interaction with Claude Desktop and other MCP clients, and offers a flexible architecture for local development and production use.
Overview

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

mcp_server/
β”œβ”€β”€ commands.json # Commands dictionary and examples 
β”œβ”€β”€ server.py # Main MCP server 
β”œβ”€β”€ commands.json # Minecraft commands for context 
└── (venv/) # Virtual environment (optional) 

βš™οΈ Installation

  1. Clone the repository:

     cd Minecraft-MCP-Server/mcp_server
    
  2. Create an environment and install dependencies:

    python -m venv venv
    venv\Scripts\activate
    pip install mcp[cli] mcrcon
    

πŸ“ 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:

enable-rcon=true
rcon.password=minemcp
rcon.port=25575

πŸš€ Running

Activate the virtual environment and run:

venv\Scripts\activate
python server.py

Monkey patch: starts MCP server in STDIO by default (apidog.com, reddit.com, github.com)


βš™οΈ Integration with Claude Desktop

In claude_desktop_config.json (e.g., %APPDATA%\Claude\):

{
 "mcpServers": {
 "minecraft-controller": {
 "type": "stdio",
 "command": "C:\\...\\venv\\Scripts\\python.exe",
 "args": ["C:\\...\\mcp_server\\server.py"],
 "env": {"PATH": "%PATH%"}
 }
 }
}

Then restart Claude β€” the β€˜minecraft-controller’ server will appear.


πŸ§ͺ Local Test with Python

from fastmcp import Client
import asyncio
async def test():
 client = Client("mcp_server/server.py")
 async with client:
 res = await client.call_tool("run_minecraft_command", {"command": "/list"})
 print("Players:", res)
 cmds = await client.read_resource("minecraft://commands")
 print("Commands:", list(cmds.keys())[:5])
asyncio.run(test())

🧰 How It Works

  • 🎯 FastMCP automatically loads tools and resources (medium.com, github.com)
  • Resource minecraft://commands provides the commands dictionary
  • Tool run_minecraft_command uses mcrcon to send commands to Minecraft

πŸ“š References

  • [FastMCP v2 – Sample README] (pypi.org)
  • [mcrcon – Python RCON client] (pypi.org)

πŸ›  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! πŸš€


Server Config

{
 "mcpServers": {
 "minecraft-controller": {
 "type": "stdio",
 "command": "C:\\...\\venv\\Scripts\\python.exe",
 "args": [
 "C:\\...\\mcp_server\\server.py"
 ],
 "env": {
 "PATH": "%PATH%"
 }
 }
 }
}
Β© 2025 MCP.so. All rights reserved.

Build with ShipAny.