Minecraft Server MCP
# Minecraft Server MCP
单仓库维护的 Minecraft Java 版机器人 MCP 服务。MCP 工具层在 src,游戏运行层源码在 game-runtime,它是 Minecraft Server MCP 的一部分,不是独立安装或发布的包;不需要克隆另一个项目。保留源项目许可与署名,独立仓库不等于从零编写协议栈。
## 安装与运行
使用 Node.js 24.12+(24.x)和 npm,从仓库根目录运行:
npm ci
node dist/main.js --host 127.0.0.1 --port 25565 --version 26.3 --username MyBot
通过 MCP 客户端的 stdio 配置启动同一条 node 命令;将入口替换为实际绝对路径。运行会尝试连接指定服务器。示例默认为离线身份,正版服使用 --auth microsoft。不要提交认证缓存。
## 版本和验收
原生目标 Java 26.3(协议 777)。2026-12-01 在隔离的原版 26.3 实服上通过 MCP 登录、出生、读取坐标、背包与游戏模式,无代理。工具发现返回 48 项;不等于每项工具均已实服验收,也不代表所有 Paper 插件或客户端模组兼容。
npm run build
npm test
node scripts/native-26.3-smoke.mjs <测试服本机端口>
上面的实服测试要求已运行的隔离服允许离线测试账号 McpSmoke263。旧 26.2 回归与历史说明见 [迁移前文档](docs/legacy-26.2-readme.md),其中的旧 fork 安装命令不再适用。行为模式见 [说明](docs/behavior-modes.md)。
## 来源与修改
- MCP 层来自 zkonikishi/Minecraft-MCP-Server 87bef6941f5b5cad0abf42fdee3491aae745194b(Apache-2.0,见 LICENSE)。
- 游戏运行层沿用的代码来自 zkonikishi/Mineflayer f9e7db4447afda7838f08aa13430ec768738c178(MIT,见 game-runtime/LICENSE)。
- 26.3 机器人适配参考 [Mineflayer PR 4206](https://github.com/PrismarineJS/mineflayer/pull/4206),取自 ad4af12611fd55309bb387b2b416212bffb0eddf:移植挖掘、挥手、实体移动等逻辑,仅在 26.3 使用新的传送确认与物理调度。
- 原生数据来自 [suisarbre/minecraft-data](https://github.com/suisarbre/minecraft-data/tree/312f3cada17a7d9e2e1a1834fe26f17296163096);数据许可与来源见 vendor/minecraft-data/SOURCE.md。协议、区块与物理依赖按提交锁定,仍使用外部库。
- 项目参考:[VitaminMCP](https://github.com/Backas03/VitaminMCP)(服务端事件交叉验证);[MCPFabric](https://github.com/denfry/mcpfabric)(长任务);[aomarai/minecraft-mcp](https://github.com/aomarai/minecraft-mcp/blob/main/docs/version-matrix.md)(版本和权限测试矩阵)。它们不是运行依赖。
TDQS
Scored across 48 tools
Core domains are distinct, but several tools have blurred boundaries: inspect-item vs inspect-held-item vs inspect-window-slot, list-container vs list-current-window, and deposit/withdraw vs move-window-slot/quick-move-window-slot provide overlapping container and window paths. get-position also duplicates part of get-player-state, and interact-entity overlaps with use-held-item in context.
All tools use lowercase hyphen-separated names, mostly verb-first or verb-object patterns such as get-position, move-to-position, and list-inventory. Minor deviations like maid-follow-owner, jump, and look-at are still readable and do not break the overall convention.
At 48 tools, the server is far above the typical appropriate range even for a broad Minecraft bot domain. Many window/container and inspection tools could be consolidated without losing capability, making the surface feel heavy.
The surface covers movement, blocks, inventory, chat, commands, crafting, smelting, containers, GUI windows, entities, item use, player state, and waiting. A few niche actions such as sleeping, respawning, or explicit eating are absent, but most core workflows are supported.