Sponsored by Deepsite.site

Minecraft MCP Server

Created By
Peterson0476 months ago
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.
Content

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%"
      }
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Amap Maps高德地图官方 MCP Server
Playwright McpPlaywright MCP server
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Serper MCP ServerA Serper MCP Server
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
ChatWiseThe second fastest AI chatbot™
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
WindsurfThe new purpose-built IDE to harness magic
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Tavily Mcp
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
CursorThe AI Code Editor
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"