Minecraft MCP 服务器
⚠️重要兼容性警告:截至 2025 年 3 月 25 日,Minecraft 1.21.5 刚刚发布。此机器人目前与 Minecraft 1.21.5不兼容。在我们发布支持 1.21.5 的更新之前,请使用 Minecraft 1.21.4。
https://github.com/user-attachments/assets/6f17f329-3991-4bc7-badd-7cde9aacb92f
一个由大型语言模型和Mineflayer API驱动的 Minecraft 机器人。该机器人使用模型上下文协议(MCP) 来使 Claude 和其他受支持的模型能够控制 Minecraft 角色。
先决条件
- Git
- Node.js
- 正在运行的 Minecraft 游戏(以下设置已使用 Microsoft Game Pass 中包含的 Minecraft 1.21.4 Java 版进行测试)
- 克劳德桌面
入门
该机器人设计用于通过模型上下文协议 (MCP) 与 Claude Desktop 一起使用。
运行 Minecraft
创建一个单人游戏世界并将其开放至局域网 ( ESC -> Open to LAN
)。机器人将尝试使用端口25565
和主机名localhost
进行连接。这些参数可以在下一步中在claude_desktop_config.json
中进行配置。
MCP 配置
确保已安装Claude Desktop 。打开File -> Settings -> Developer -> Edit Config
。它会打开安装目录。找到名为claude_desktop_config.json
的文件,并插入以下代码:
仔细检查--port
和--host
参数是否正确。确保彻底重启 Claude Desktop 应用程序(应在系统托盘中关闭)。
跑步
确保 Minecraft 游戏正在运行,并且世界已向局域网开放。然后启动 Claude 桌面应用程序,机器人应该就能加入游戏了。
Claude Desktop 启动 MCP 服务器可能需要一些时间。服务器启动成功的标志是聊天窗口旁边出现的锤子图标。
您可以通过任何活跃的 Claude 桌面聊天室向机器人发出任何命令。您还可以上传建筑物图片,并让机器人建造它们 😁
别忘了在提示中提到机器人应该在 Minecraft 中执行某些操作。因为这会触发 MCP 服务器的运行。它会请求你的权限。
使用 Claude 3.7 Sonnet 可能会给你带来一些有趣的结果。这个机器人代理会非常智能🫡
用法示例:共享 Claude 聊天
可用命令
一旦连接到 Minecraft 服务器,Claude 就可以使用以下命令:
移动
get-position
- 获取机器人的当前位置move-to-position
- 移动到特定坐标look-at
- 让机器人查看特定坐标jump
- 让机器人跳跃move-in-direction
- 沿特定方向移动一段时间
航班
fly-to
- 让机器人直接飞到特定坐标
存货
list-inventory
- 列出机器人库存中的所有物品find-item
- 在库存中查找特定物品equip-item
- 装备特定物品
区块互动
place-block
- 在指定坐标处放置一个块dig-block
- 在指定坐标处挖掘一个块get-block-info
- 获取有关区块的信息find-block
- 查找特定类型的最近块
实体交互
find-entity
- 查找特定类型的最近实体
沟通
send-chat
- 在游戏中发送聊天消息
贡献
这个应用程序仅用了两天就完成了,代码简洁明了。非常感谢所有重构提交、功能和测试贡献、问题和讨论!
欢迎随时提交 Pull Request 或开放 Issue 以改进代码。以下是一些可以改进的地方:
- 其他文档
- 更强大的错误处理
- 针对不同组件的测试
- 新功能和命令
local-only server
The server can only run on the client's local machine because it depends on local resources.
Tools
一个由 Mineflayer API 驱动的 Minecraft MCP 服务器。它允许实时控制 Minecraft 角色,允许 AI 助手通过自然语言指令建造建筑、探索世界并与游戏环境互动。
Related Resources
Related MCP Servers
- -securityAlicense-qualityMCP Server simplifies the implementation of the Model Context Protocol by providing a user-friendly API to create custom tools and manage server workflows efficiently.Last updated -43TypeScriptMIT License
- -securityAlicense-qualityMCP Server provides a simpler API to interact with the Model Context Protocol by allowing users to define custom tools and services to streamline workflows and processes.Last updated -132TypeScriptMIT License
- -securityFlicense-qualityAn MCP server that enables AI agents like Claude to play Minesweeper through natural language interaction, connecting to a separate Minesweeper game server.Last updated -80JavaScript
- AsecurityAlicenseAqualityAn MCP server that connects to the Teamwork API, providing a simplified interface for interacting with Teamwork projects and tasks.Last updated -35126TypeScriptMIT License