Skip to main content
Glama

Minecraft MCP 服务器


IMPORTANT

目前支持 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 游戏(以下设置已在 Microsoft Game Pass 包含的 Minecraft 1.21.8 Java 版上进行了测试)

  • 一个兼容 MCP 的客户端。我们将以 Claude Desktop 为例,但也支持其他 MCP 客户端

Related MCP server: MCP Server

入门指南

此机器人旨在通过模型上下文协议 (MCP) 与 Claude Desktop 一起使用。

运行 Minecraft

创建一个单人世界并将其开放给局域网 (ESC -> 对局域网开放)。机器人将尝试使用端口 25565 和主机名 localhost 进行连接。这些参数可以在下一步的 claude_desktop_config.json 中进行配置。

MCP 配置

确保已安装 Claude Desktop。打开 File -> Settings -> Developer -> Edit Config。它应该会打开安装目录。找到名为 claude_desktop_config.json 的文件并插入以下代码:

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

仔细检查是否使用了正确的 --port--host 参数。确保完全重启 Claude Desktop 应用程序(应在系统托盘中关闭)。

运行

确保 Minecraft 游戏正在运行且世界已开放给局域网。然后启动 Claude Desktop 应用程序,机器人应该会加入游戏。

Claude Desktop 启动 MCP 服务器可能需要一些时间。服务器成功启动的标志是:

你可以通过任何活跃的 Claude Desktop 聊天窗口向机器人发送指令。你还可以上传建筑图片并要求机器人建造它们 😁

别忘了在提示词中提到机器人应该在 Minecraft 中做些什么。因为提到这一点是运行 MCP 服务器的触发器。它会请求你的许可。

使用 Claude 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-blocks - 查找附近一个或多个特定类型的方块

熔炉

  • smelt-item - 使用熔炉类方块熔炼物品

实体交互

  • find-entity - 查找最近的特定类型实体

通信

  • send-chat - 在游戏内发送聊天消息

  • read-chat - 获取玩家最近的聊天消息

游戏状态

  • detect-gamemode - 检测游戏模式

贡献

欢迎提交拉取请求或提出改进建议。非常感谢所有的重构提交、功能和测试贡献、问题反馈以及讨论!

要开始贡献,请参阅 CONTRIBUTING.md


⭐ 如果你觉得这个项目有用,请考虑在 GitHub 上给它点个星!⭐

你的支持有助于让更多可能从中受益的人看到这个项目。

Install Server
A
license - permissive license
B
quality
B
maintenance

Maintenance

Maintainers
21hResponse time
3wRelease cycle
9Releases (12mo)
Issues opened vs closed

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/yuniko-software/minecraft-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server