返回市场
MCP我的世界远程服务器

MCP我的世界远程服务器

作者:nacal11 星标更新:2025-07-20

项目介绍

MCP Minecraft 远程控制

该项目受到 mcp-minecraft 的启发。虽然原始项目仅支持本地 Minecraft 服务器连接,但本项目从零开始创建,以添加对远程 Minecraft 服务器连接的支持。

使用 MCP(模型上下文协议)进行 Minecraft 远程控制。

功能

  • 通过AI助手连接并控制Minecraft玩家
  • 导航、挖掘、建造并与Minecraft世界互动
  • 在服务器上与其他玩家聊天
  • 检查库存、玩家位置和服务器信息
  • 高级移动控制,包括跳跃、潜行和冲刺
  • 实体交互,包括攻击和跟随
  • 容器使用(箱子、熔炉等)
  • 物品制作和村民交易
  • 详细的库存管理

安装

通过 Smithery 安装

要通过 Smithery 自动安装 Minecraft 远程控制到 Claude Desktop:

npx -y @smithery/cli install @nacal/mcp-minecraft-remote --client claude

快速安装(推荐)

npx -y @smithery/cli install mcp-minecraft-remote --client claude

按照 CLI 提示完成设置。

手动安装

# 从 npm 安装
npm install -g mcp-minecraft-remote

# 或者克隆仓库
git clone https://github.com/nacal/mcp-minecraft-remote.git
cd mcp-minecraft-remote

# 安装依赖
npm install

# 构建项目
npm run build

使用方法

与 Claude Desktop 一起使用

  1. 导航到 Claude Desktop 配置文件:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json
    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. 将 Minecraft 远程控制 MCP 配置添加到您的配置文件中:

{
  "mcpServers": {
    "minecraft-remote": {
      "command": "npx",
      "args": ["-y", "mcp-minecraft-remote@latest"]
    }
  }
}

如果您已全局安装:

{
  8"mcpServers": {
    "minecraft-remote": {
      "command": "mcp-minecraft-remote"
    }
  }
}

如果您已本地克隆了仓库:

{
  "mcpServers": {
    "minecraft-remote": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-minecraft-remote/build/index.js"]
    }
  }
}
  1. 保存文件并重启 Claude Desktop
  2. 开始与 Claude 的新对话,并开始使用 Minecraft 控制命令

重要服务器需求

  • 服务器在线模式:Minecraft 服务器必须在 server.properties 文件中设置 online-mode=false。这允许机器人无需验证即可连接到 Minecraft 的会话服务器。
  • 如果使用带有身份验证的服务器,则需要提供有效的高级账户凭据进行连接。

可用工具

核心功能

  • connectToServer: 使用指定凭据连接到 Minecraft 服务器
  • disconnectFromServer: 从 Minecraft 服务器断开连接
  • sendChat: 向服务器发送聊天消息
  • getServerInfo: 获取有关已连接服务器的信息

移动

  • getPosition: 获取当前玩家位置
  • moveTo: 移动到特定坐标
  • moveControl: 基本移动控制(前进、后退、左转、右转、跳跃、冲刺、潜行、停止)
  • lookAt: 让玩家看向特定方向或坐标

世界交互

  • digBlock: 在特定坐标挖掘方块
  • placeBlock: 在特定坐标放置方块

库存管理

  • checkInventory: 基本库存检查
  • inventoryDetails: 获取关于库存物品的详细信息
  • equipItem: 将库存中的物品装备到手中或护甲槽
  • tossItem: 投掷库存中的物品

实体交互

  • getNearbyPlayers: 获取附近玩家列表
  • getNearbyEntities: 获取附近所有实体的列表
  • attackEntity: 攻击特定实体
  • useOnEntity: 对特定实体使用手持物品
  • followEntity: 跟随特定实体

容器交互

  • openContainer: 在特定坐标打开容器(箱子、熔炉等)
  • withdrawItem: 从打开的容器中取出物品
  • depositItem: 将物品放入打开的容器
  • closeContainer: 关闭当前打开的容器

制作

  • getRecipes: 获取可用的制作配方列表
  • craftItem: 使用现有材料制作物品

交易

  • listTrades: 列出附近村民提供的可用交易
  • tradeWithVillager: 与附近的村民进行交易

示例提示

基本控制

  • "连接到位于 play.example.com 的 Minecraft 服务器,用户名为 player1"
  • "我在游戏中的当前位置是什么?"
  • "将我移动到坐标 x=100, y=64, z=-200"
  • "让我向前走3秒"
  • "让我跳起来并向那座山冲刺"

库存及物品

  • "详细检查我的库存里有什么"
  • "将我的钻石剑装备到手中"
  • "从我的库存中投掷5个泥土方块"

方块交互

  • "挖掘坐标 x=10, y=65, z=20 处的方块"
  • "在坐标 x=11, y=65, z=20 处放置一个石头方块"

实体交互

  • "附近有其他玩家吗?"
  • "在我周围20个方块内有哪些实体?"
  • "攻击ID为12345的僵尸"
  • "跟随名叫 Steve 的玩家"

容器使用

  • "打开坐标 x=100, y=64, z=200 处的箱子"
  • "从箱子中取出10个铁锭"
  • "将5个石块放入箱子"
  • "关闭容器"

制作与交易

  • "我可以制作木镐的配方有哪些?"
  • "使用我库存中的木材制作4根棍子"
  • "检查附近村民提供的交易"
  • "与村民交易以获得10颗绿宝石"

通信

  • "向聊天发送一条问候消息"
  • "告诉所有人我找到了钻石"

要求

  • Node.js 18+
  • 支持 MCP 的AI助手(如 Claude)
  • Minecraft Java 版服务器(版本1.8或更高)

注意:此工具已在 vanilla Minecraft 1.21 中测试并验证其功能。尽管它可能适用于其他版本或修改过的服务器,但兼容性无法保证。

许可证

MIT