Minecraft MCP Server

by peterson047

Not rated
GitHub

About

A Python MCP server to control a Minecraft server via RCON using FastMCP.

Details

Author
peterson047
Categories
Developer Tools, Other, Infrastructure, Cloud Service

Setup

Install Minecraft MCP Server in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/peterson047/Minecraft-MCP-Server

Follow the installation instructions in the repository README, then restart your MCP client.

Python MCP Server to control a Minecraft server via RCON, using FastMCP.

- 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)

mcp_server/ ├── __pycache__/ ├── .env # Environment variables for Gemini and paths ├── commands.json # Commands dictionary and examples ├── mcp_chat_client.py # NEW: Client that listens to @ai messages from chat ├── server.py # Main MCP server ├── .gitattributes ├── .gitignore ├── readme.md └── requirements.txt

- Clone the repository:

cd Minecraft-MCP-Server/mcp_server
python -m venv venv venv\Scripts\activate pip install -r requirements.txt

In thecommands.jsonfile, you will have a list of commands like/give,/weather,/gamemode, etc., with descriptions and examples.

Don’t forget to enable RCON in the Minecraftserver.propertiesfile:

enable-rcon=true rcon.password=minemcp rcon.port=25575
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

Activate the virtual environment and run:

venv\Scripts\activate python mcp_server/server.py

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

After starting the server, in a new terminal, run the chat client:

venv\Scripts\activate python mcp_server/mcp_chat_client.py

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.

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

{ "mcpServers": { "minecraft-controller": { "type": "stdio", "command": "/home/qkeq/Documentos/GitHub/Minecraft-MCP-Server/venv/bin/python3", "args": ["C:\\...\\mcp_server\\server.py"], "env": {"PATH": "%PATH%"} } } }

Then restart Claude — the ‘minecraft-controller’ server will appear.

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())

- 🎯FastMCPautomatically loads tools and resources (medium.com,github.com)
- Resourceminecraft://commandsprovides the commands dictionary
- Toolrun_minecraft_commandusesmcrconto send commands to Minecraft

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

- Support for HTTP/SSE transport with Docker
- Argument validation/autocomplete via commands dictionary
- Logging extra actions:/start,/stop,/backup,/whitelist

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Manage your Bedrock server with natural language commands using the Bedrock Server Manager API.

Read-only SSH server diagnostics: 38-command whitelist, secret-redacted.

An MCP server that provides SSH-based remote management tools, acting as proxy

Core AWS MCP server providing prompt understanding and server management capabilities.

An MCP server for 1Panel, a modern Linux server operation and maintenance panel.

A server for managing Counter-Strike 2 servers using the RCON protocol.

DevOps MCP — Secure MCP Server for Linux Server Automation

A three-tier access control MCP server that allows AI assistants (Claude Code, Cursor, Windsurf) to safely scan, plan, and operate Linux servers via SSH without full write access. Includes an out-of-band human consent token gate, automated port-conflict scanning, and a completely read-only default safe mode to eliminate accidental destructive commands on production environments.

An AI-powered interface for managing the Dokploy infrastructure platform.

An AI-powered interface for managing the Dokploy infrastructure platform.

Integrate with Foreman to manage hosts and other infrastructure resources.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.