mcp -mod
A Fabric mod that implements a Model Context Protocol (MCP) server, enabling AI assistants like Claude to interact with Minecraft through structured commands.
claude mcp add --transport stdio cuspymd-mcp-server-mod docker run -i cuspymd/mcp-server-mod
How to use
This MCP server is implemented as a Fabric mod that runs inside Minecraft and exposes an HTTP-based Model Context Protocol (MCP) interface. It enables AI assistants to interact with the game through structured commands in a safe, validated way. The server supports both single-player (integrated server) and multiplayer (dedicated server) modes, and exposes tools for command execution, player information, world scanning, and optional screenshots. You can connect an AI assistant to the endpoint http://localhost:8080/mcp and use the provided tools to issue commands, query player state, or inspect world blocks. The available tools are execute_commands, get_player_info, get_blocks_in_area, and take_screenshot, each with safety checks and structured responses to help the AI reason about results and next steps.
How to install
Prerequisites:
- Minecraft 1.21.11
- Fabric Loader 0.18.4 or higher
- Fabric API 0.141.3+1.21.11 or higher
- Java 21 or higher
Installation steps:
- Ensure you have a compatible Minecraft profile set up with Fabric Loader installed for Minecraft 1.21.11.
- Download the Fabric API mod from the official source and place the JAR in your Minecraft mods folder.
- Obtain the MCP server mod JAR (the cuspymd-mcp-server-mod) and place it in your mods folder alongside Fabric API.
- Launch Minecraft with the Fabric profile. The MCP server will start automatically when the mod is active. By default, the embedded HTTP endpoint will be available at localhost:8080.
- (Optional) Edit the mod configuration file at config/mcp.json to adjust server and safety settings as needed, then restart Minecraft to apply changes.
Additional notes
Tips and considerations:
- The MCP server runs inside the Minecraft process, so performance and safety checks are important. Use the safety-related configuration options to constrain commands and area operations.
- In client mode, the take_screenshot tool is available and can capture the game window for visual verification. In dedicated server mode, rendering is not available and take_screenshot is disabled.
- The server exposes endpoints and tools via HTTP; ensure your firewall allows access to localhost:8080 if you plan to connect from external tooling.
- Typical safety parameters include max_area_size, allowed_commands, and per-command validation. Adjust these in config/mcp.json to fit your use case.
- If you encounter issues starting the server, verify that your Java version is 21 or newer and that Fabric Loader and Fabric API are correctly installed and loaded with the Minecraft instance.