mcp-minecraft
v1.0.28
Published
A Model Context Protocol (MCP) integration for Minecraft that enables AI assistants to interact with a Minecraft server. This integration allows AI models to observe and interact with the Minecraft world through a bot.
Downloads
1,725
Readme
Minecraft MCP Integration
A Model Context Protocol (MCP) integration for Minecraft that enables AI assistants to interact with a Minecraft server. This integration allows AI models to observe and interact with the Minecraft world through a bot.
Prerequisites
- Minecraft Java Edition v1.21
- Node.js 18 or higher
- Claude Desktop App
⚠️ Note: Currently only tested on macOS/Linux. Windows compatibility is not guaranteed.
Installation Steps
Download and Setup Minecraft Server
- Download Minecraft server v1.21 from minecraft.net/download/server
- Create a dedicated directory (e.g.,
~/minecraft-server/
) - Place the downloaded
server.jar
file in this directory - Note down the absolute path to your
server.jar
file
Configure Claude Desktop
- Install Claude Desktop
- Navigate to
~/Library/Application Support/Claude/claude_desktop_config.json
- Add the MCP server configuration:
{ "mcpServers": { "mcp-minecraft": { "command": "npx", "args": [ "-y", "mcp-minecraft@latest", "--server-jar", "/absolute/path/to/minecraft-server/server.jar" ] } } }
⚠️ Replace
/absolute/path/to/minecraft-server/server.jar
with your actual server.jar pathLaunch Claude Desktop
- Start Claude Desktop after completing the configuration
Connect to Server
- Launch Minecraft Java Edition
- Select "Multiplayer"
- Click "Add Server"
- Enter server details:
- Server Name:
Minecraft Server
- Server Address:
localhost:25565
- Server Name:
- Click "Done"
Features
Resources
The integration exposes these MCP resources:
minecraft://bot/location
- Current bot position in the worldminecraft://bot/status
- Bot connection status
Tools
Available MCP tools:
chat
- Send chat messages to the serverjump
- Make the bot jumpmoveForward
- Make the bot move forwardmoveBack
- Make the bot move backwardturnLeft
- Make the bot turn leftturnRight
- Make the bot turn rightplaceBlock
- Place a block at specified coordinatesdigBlock
- Break a block at specified coordinatesgetBlockInfo
- Get information about a block at specified coordinatesselectSlot
- Select a hotbar slot (0-8)getInventory
- Get contents of bot's inventoryequipItem
- Equip an item by name to specified destinationgetStatus
- Get bot's current status (health, food, position, etc.)getNearbyEntities
- Get list of nearby entities within rangeattack
- Attack a nearby entity by nameuseItem
- Use/activate the currently held itemstopUsingItem
- Stop using/deactivate the current itemlookAt
- Make the bot look at specific coordinatesfollowPlayer
- Follow a specific playerstopFollowing
- Stop following current targetgoToPosition
- Navigate to specific coordinates
Technical Details
- Server runs in offline mode for local development
- Default memory allocation: 2GB
- Default port: 25565
- Bot username: MCPBot
Troubleshooting
Common Issues
Server Won't Start
- Verify Java is installed
- Check server.jar path is correct
- Ensure port 25565 is available
Can't Connect to Server
- Verify server is running (check logs)
- Confirm you're using "localhost" as server address
- Check firewall settings
MCP Connection Failed
- Restart Claude Desktop
- Verify config.json syntax
- Check server.jar path is absolute
Java Process Persists After Closing
- If you experience issues reconnecting after closing Claude, check for lingering Java processes
- You may need to manually terminate the Java process:
- Windows: Use Task Manager (untested)
- Mac/Linux: Use
ps aux | grep java
andkill <PID>
- If process termination doesn't work, restart your computer
- This issue should auto-resolve in most cases with the latest version
Logs Location
- Server logs: Check the minecraft-server directory
- Claude Desktop logs:
~/Library/Logs/Claude/mcp*.log
Contributing
Contributions, big or small, are welcome!
License
This project is licensed under the MIT License - see the LICENSE file for details.