mcp-minecraft
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: ainpcengine
入门指南
此机器人旨在通过模型上下文协议 (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 上给它点个星!⭐
你的支持有助于让更多可能从中受益的人看到这个项目。
Available Tools
22 toolscan-craftA
Check if the bot can craft a specific item with current inventory
Inputs: itemName (required).
craft-itemC
Craft an item using a crafting recipe
Inputs: outputItem (required), amount.
detect-gamemodeB
Detect the gamemode on game
Inputs: no named parameters.
dig-blockB
Dig a block at the specified position
Inputs: x (required), y (required), z (required).
equip-itemC
Equip a specific item
Inputs: itemName (required), destination.
find-blocksA
Find one or more nearby blocks of a specific type
Inputs: blockType (required), maxDistance, count.
find-entityB
Find the nearest entity of a specific type
Inputs: type, maxDistance.
find-itemB
Find a specific item in the bot's inventory
Inputs: nameOrType (required).
fly-toC
Make the bot fly to a specific position
Inputs: x (required), y (required), z (required).
get-block-infoB
Get information about a block at the specified position
Inputs: x (required), y (required), z (required).
get-positionA
Get the current position of the bot
Inputs: no named parameters.
get-recipeB
Get detailed information about a specific recipe
Inputs: itemName (required).
jumpB
Make the bot jump
Inputs: no named parameters.
list-inventoryA
List all items in the bot's inventory
Inputs: no named parameters.
list-recipesA
List all available crafting recipes the bot can make with current inventory
Inputs: outputItem.
look-atB
Make the bot look at a specific position
Inputs: x (required), y (required), z (required).
move-in-directionB
Move the bot in a specific direction for a duration
Inputs: direction (required), duration.
move-to-positionC
Move the bot to a specific position
Inputs: x (required), y (required), z (required), range, +1 more.
place-blockB
Place a block at the specified position
Inputs: x (required), y (required), z (required), faceDirection.
read-chatB
Get recent chat messages from players
Inputs: count.
send-chatB
Send a chat message in-game
Inputs: message (required).
smelt-itemB
Smelt items using a furnace-like block
Inputs: x (required), y (required), z (required), inputItem (required), +5 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 22 tools
Each tool targets a distinct action or query, with clear boundaries between checking and performing (e.g., can-craft vs craft-item, list-recipes vs get-recipe). Movement tools are differentiated by mode (fly vs walk).
All tools follow a consistent verb-noun pattern with hyphens, using imperative verbs like 'dig', 'place', 'find', 'list', 'craft'. No mixing of conventions or vague names.
22 tools cover a broad range of Minecraft bot operations without being overwhelming. Each tool serves a distinct purpose, and the count aligns well with the domain's complexity.
Covers core workflows: movement, block manipulation, inventory management, crafting, smelting, chat, and entity detection. Missing actions like attacking or dropping items are minor gaps that don't severely hinder typical tasks.
Maintenance
Related MCP Connectors
- mcp-soraDeprecatedio.github.AceDataCloud
MCP server for OpenAI Sora AI video generation
MCP server for Hailuo (MiniMax) AI video generation
MCP server for Grok Imagine AI video generation
MCP server for AI dialogue using various LLM models via AceDataCloud
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceAn MCP server that lets Claude control a Minecraft bot with 40+ actions including movement, combat, crafting, and inventory management. Built on Mineflayer, it supports Microsoft authentication, pathfinding, and auto-reconnect.3MIT
- FlicenseNot gradedqualityCmaintenanceMCP server for creating, managing, and interacting with AI-powered NPCs with persistent memory, supporting dialogue, game events, and persona generation for coding agents.49 npm1-
- AlicenseNot gradedqualityBmaintenanceAn MCP server that enables Claude to generate Minecraft structures from natural language descriptions.1MIT
- AlicenseAqualityDmaintenanceA local MCP server that lets AI assistants control a Minecraft player on a local Paper server, enabling movement, block breaking/placing, combat, inventory management, chat, and op-level commands like teleport, gamemode, and summoning.27MIT