YS

yuniko-software/minecraft-mcp-server

开发工具官方

本页由 AI 翻译,技术细节请以原文为准。 查看原文

799 stars 104 forks 质量 64 趋势 24Apache-2.0

一个由Mineflayer API驱动的Minecraft MCP服务器。它允许实时控制Minecraft角色,让AI助手建造建筑、探索世界并与游戏互动......

概览

目前支持 Minecraft 版本 1.21.11。新版本可能无法支持该 MCP 服务器,但我们会尽快添加支持。 https://github.com/user-attachments/assets/6f17f329-3991-4bc7-badd-7cde9aacb92f 一个由大型语言模型和 Mineflayer API 驱动的 Minecraft 机器人。该机器人使用模型上下文协议(MCP)使 Claude 及其他支持的模型能够控制 Minecraft 角色。 - Git - Node.js (>= 20.10.0) - 运行中的 Minecraft 游戏(以下设置是用 Game Pass Microsoft中包含的 Minecraft 1.21.8 Java 版测试的)- 一个兼容 MCP 的客户端。以 Claude Desktop 为例,但也支持其他 MCP 客户端 该机器人设计用于通过模型上下文协议(MCP)与Claude Desktop配合使用。 创建一个单人世界并打开局域网(ESC -> 打开局域网)。机器人会尝试通过25565端口和主机名localhost连接。这些参数可以在下一步claude_desktop_config.json中配置。

概述(AI 翻译)


[!重要] 目前支持 Minecraft 版本 1.21.11。新版本可能无法支持该 MCP 服务器,但我们会尽快添加支持。

https://github.com/user-attachments/assets/6f17f329-3991-4bc7-badd-7cde9aacb92f

一个由大型语言模型和 Mineflayer API 驱动的 Minecraft 机器人。该机器人使用模型上下文协议(MCP)使 Claude 及其他支持的模型能够控制 Minecraft 角色。

先修条件

  • 走
  • Node.js (>= 20.10.0)
  • 一款运行中的Minecraft游戏(以下设置是用Microsoft Game Pass中附带的Minecraft 1.21.8 Java Edition测试的)
  • 一个兼容MCP的客户端。以Claude Desktop为例,但也支持其他MCP客户端

开始

该机器人设计用于通过模型上下文协议(MCP)与Claude Desktop配合使用。

运行 Minecraft

创建一个单人世界并打开局域网(ESC -> Open to LAN)。机器人会尝试使用端口25565和主机名localhost。这些参数可以在下一步在claude_desktop_config.json中配置。

MCP 配置

确保安装了Claude Desktop。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Minecraft MCP Server


[!IMPORTANT] Currently supports Minecraft version 1.21.11. Newer versions may not work with this MCP server, but we will add support as soon as possible.

https://github.com/user-attachments/assets/6f17f329-3991-4bc7-badd-7cde9aacb92f

A Minecraft bot powered by large language models and Mineflayer API. This bot uses the Model Context Protocol (MCP) to enable Claude and other supported models to control a Minecraft character.

Prerequisites

  • Git
  • Node.js (>= 20.10.0)
  • A running Minecraft game (the setup below was tested with Minecraft 1.21.8 Java Edition included in Microsoft Game Pass)
  • An MCP-compatible client. Claude Desktop will be used as an example, but other MCP clients are also supported

Getting started

This bot is designed to be used with Claude Desktop through the Model Context Protocol (MCP).

Run Minecraft

Create a singleplayer world and open it to LAN (ESC -> Open to LAN). Bot will try to connect using port 25565 and hostname localhost. These parameters could be configured in claude_desktop_config.json on a next step.

MCP Configuration

Make sure that Claude Desktop is installed. Open File -> Settings -> Developer -> Edit Config. It should open installation directory. Find file with a name 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"
      ]
    }
  }
}

Double-check that right --port and --host parameters were used. Make sure to completely reboot the Claude Desktop application (should be closed in OS tray).

Running

在 GitHub 查看完整 README

安装

npx -y github:yuniko-software/minecraft-mcp-server --host localhost --port 25565 --username ClaudeBot
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "minecraft": { "command": "npx", "args": [ "-y", "github:yuniko-software/minecraft-mcp-server", "--host", "localhost", "--port", "25565", "--username", "ClaudeBot" ] } } }