MCP HubMCP Hub
yuniko-software

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

39created 20/03/2025
Visit
Mineflayer
AI

📌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

  1. Create a singleplayer world and open it to LAN (ESC -> Open to LAN).
  2. The bot will connect using port 25565 and hostname localhost. These can be configured in claude_desktop_config.json.

MCP Configuration

  1. Install Claude Desktop.

  2. Open File -> Settings -> Developer -> Edit Config.

  3. 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"
          ]
        }
      }
    }
    
  4. Verify the --port and --host parameters.

  5. Completely restart the Claude Desktop application.

Running the Bot

  1. Ensure the Minecraft game is running and the world is open to LAN.
  2. 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 position
  • move-to-position - Move to specific coordinates
  • look-at - Look at specific coordinates
  • jump - Make the bot jump
  • move-in-direction - Move in a specific direction

Inventory

  • list-inventory - List items in inventory
  • find-item - Find a specific item
  • equip-item - Equip a specific item

Block Interaction

  • place-block - Place a block at specified coordinates
  • dig-block - Dig a block at specified coordinates
  • get-block-info - Get information about a block
  • find-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