minecraft-mcp-server
by: yuniko-software
A Minecraft MCP Server powered by Mineflayer API. It allows to control a Minecraft character in real-time, allowing AI assistants to build structures, explore the world, and interact with the game environment through natural language instruction
📌Overview
Purpose: The Minecraft MCP Server enables interaction between large language models, like Claude, and Minecraft, allowing users to control in-game characters through commands processed via the Model Context Protocol.
Overview: This bot, leveraging the Mineflayer API, integrates AI-driven capabilities into the Minecraft environment. Users can command the bot to perform various tasks within the game, enhancing gameplay with AI interaction.
Key Features:
-
AI Bot Control: The bot can execute commands sent via Claude Desktop, enabling users to interact with Minecraft through natural language, enhancing user experience with AI assistance.
-
Comprehensive Command Set: Includes movements, inventory management, block interaction, and entity communication, giving extensive control over gameplay actions.
-
Image-Based Building: Users can upload images for the bot to replicate structures in Minecraft, demonstrating the AI's application in creative and user-driven building tasks.
Minecraft MCP Server
⚠️ IMPORTANT COMPATIBILITY WARNING: As of March 25, 2025, Minecraft 1.21.5 was released. This bot is currently NOT compatible with Minecraft 1.21.5. Please use Minecraft 1.21.4 until an update with 1.21.5 support is released.
A Minecraft bot powered by large language models and the Mineflayer API. This bot uses the Model Context Protocol (MCP) to enable Claude and other supported models to control a Minecraft character.
Prerequisites
- Node.js
- A running Minecraft game (tested with Minecraft 1.21.4 Java Edition)
- Claude Desktop
Getting Started
This bot is designed to work with Claude Desktop through MCP.
Run Minecraft
- Create a singleplayer world and open it to LAN (
ESC -> Open to LAN
). - The bot will connect using port
25565
and hostnamelocalhost
. These can be configured inclaude_desktop_config.json
.
MCP Configuration
-
Install Claude Desktop.
-
Open
File -> Settings -> Developer -> Edit Config
. -
Locate
claude_desktop_config.json
and insert the following code:{ "mcpServers": { "minecraft": { "command": "npx", "args": [ "-y", "github:yuniko-software/minecraft-mcp-server", "--host", "localhost", "--port", "25565", "--username", "ClaudeBot" ] } } }
-
Verify the
--port
and--host
parameters. -
Completely restart the Claude Desktop application.
Running the Bot
- Ensure the Minecraft game is running and the world is open to LAN.
- Start the Claude Desktop application; the bot should join the game.
You can give commands through any active Claude Desktop chat. Mention that the bot should do something in Minecraft to trigger the MCP server.
Available Commands
Once connected to a Minecraft server, Claude can use these commands:
Movement
get-position
- Get the current positionmove-to-position
- Move to specific coordinateslook-at
- Look at specific coordinatesjump
- Make the bot jumpmove-in-direction
- Move in a specific direction
Inventory
list-inventory
- List items in inventoryfind-item
- Find a specific itemequip-item
- Equip a specific item
Block Interaction
place-block
- Place a block at specified coordinatesdig-block
- Dig a block at specified coordinatesget-block-info
- Get information about a blockfind-block
- Find the nearest block of a specific type
Entity Interaction
find-entity
- Find the nearest entity of a specific type
Communication
send-chat
- Send a chat message in-game
Contributing
This application was developed quickly, and contributions are welcome. Areas for enhancement include:
- Additional documentation
- More robust error handling
- Tests for components
- New functionality and commands