MCP Fabric 通过 Model Context Protocol 将 Minecraft 与 AI 智能体连接起来。该模组在游戏内运行一个轻量级的 HTTP 桥接服务,而 MCP 服务器将其转化为工具,供 Claude Desktop、Claude Code 或任何其他 MCP 客户端调用。智能体可以扮演你的角色进行游戏、读取世界信息,或作为服务器的操作员执行任务。
智能体能做什么
在客户端上,它可以行走和寻路、挖掘、放置方块、战斗、合成、打开箱子并截取屏幕截图。它能读取方块、实体、聊天信息和游戏事件,并提供视野内内容的简短文本描述。在服务器上,它可以编辑世界、运行命令、更改时间和天气,以及管理玩家。
MCP 服务器在此基础上增加了智能体运行时功能。记忆、目标以及已探索区块的地图会在会话之间按世界保存。旅行、探索、收集方块、合成一系列配方以及建造结构等长时间运行的操作会作为后台作业执行。建筑方案可以从 WorldEdit .schem 文件导入或导出。对于一连串的操作调用,智能体可以编写一个脚本并将其保存为技能以便日后复用。
1.0.0 版本新增内容:
mcpfabric-test:由真实客户端参与的服务器、模组和插件的端到端测试,附带 JUnit 报告。测试可以通过实际游玩过程来录制。
- 开发者工具:游戏日志、崩溃报告、已加载的模组、注册表、刻冻结与步进、区域内的方块变化以及实体的 AI 行为。
- 来自插件的商店菜单:向智能体展示物品名称和描述,并标记为“来自游戏的文本”,而非指令。
- 在一台机器上运行多个游戏实例,以及一个 MCP 服务器同时驱动多个机器人。
- 一套精简的工具集,包含 31 个工具,适用于小型本地模型。
安装位置
| 安装在 |
智能体能做什么 |
| 客户端 |
以本地玩家身份游玩:移动、视角控制、交互、物品栏、导航、截图 |
| 专用服务器 |
操控世界、实体、命令、事件和玩家 |
| 两者兼有 |
执行活跃端允许的所有操作 |
每个 Minecraft 版本都有独立的 jar 包。Fabric 支持:1.21.1 至 1.21.11 以及 26.1 至 26.3,需要 Fabric Loader 0.19.5 或更高版本及对应的 Fabric API。NeoForge 支持:1.21.1、1.21.3 至 1.21.11,以及 26.1.2 至 26.3。
安装步骤
- 安装 Fabric Loader 和 Fabric API,或者 NeoForge。
- 将与你确切的 Minecraft 版本和加载器匹配的 jar 包放入
mods/ 目录。
- 启动游戏。该模组会将地址和令牌写入
~/.mcpfabric/bridge.json,该文件仅对你可读,MCP 服务器通过它找到游戏,因此无需复制令牌。
- 将 MCP 服务器添加到你的客户端:
npx -y mcpfabric-mcp-server。快速入门指南 提供了适用于 Claude Desktop、Claude Code 及其他客户端的现成配置。
该桥接服务赋予 AI 操作员级别的游戏控制权。它仅在 127.0.0.1 上监听,并且需要令牌。任何智能体不应执行的操作都可以在 config/mcpfabric.config.json 中关闭,通用 UI 控制和开发者工具默认处于关闭状态,直到你手动开启它们。在将其暴露于你自己的机器之外之前,请阅读 安全策略。
可以尝试的问题
- “环顾四周并告诉我附近有什么。”
- “找到铁矿,挖取一组并带回家里的箱子旁。”
- “用圆石建造一座 7x7 的房子,门朝向河流。”
- “谁在线?聊天里最近发生了什么?”
源代码、文档和发布版本均在 GitHub 上。
MCP Fabric connects Minecraft to AI agents through the Model Context Protocol. The mod runs a small HTTP bridge inside the game, and an MCP server turns it into tools that Claude Desktop, Claude Code or any other MCP client can call. The agent can play as your character, read the world, or act as an operator on a server.
What the agent can do
On a client it walks and pathfinds, mines, places blocks, fights, crafts, opens chests and takes screenshots. It reads blocks, entities, chat and game events, and gets a short text description of what is in view. On a server it edits the world, runs commands, changes time and weather, and manages players.
The MCP server adds an agent runtime on top. Memory, goals and a map of explored chunks are kept per world between sessions. Long actions such as travelling, exploring, gathering blocks, crafting a chain of recipes and building a structure run as background jobs. Builds can be imported from and exported to WorldEdit .schem files. For a long sequence of calls the agent can write one script and save it as a skill to reuse later.
New in 1.0.0:
mcpfabric-test, end-to-end tests for servers, mods and plugins played by the real client, with JUnit reports. Tests can be recorded by playing.
- Developer tools: the game log, crash reports, loaded mods, registries, tick freeze and step, block changes in a region, and what a mob's AI is doing.
- Shop menus from plugins: item names and lore are shown to the agent, marked as text from the game, not instructions.
- Several games on one machine, and one MCP server that drives several bots at once.
- A compact tool set of 31 tools for small local models.
Where to install it
| Installed on |
What the agent can do |
| Client |
Play as the local player: move, look, interact, inventory, navigation, screenshots |
| Dedicated server |
Operate the world, entities, commands, events and players |
| Both |
Everything the active side allows |
There is a separate jar for every Minecraft version. Fabric: 1.21.1 to 1.21.11 and 26.1 to 26.3, with Fabric Loader 0.19.5 or newer and the matching Fabric API. NeoForge: 1.21.1, 1.21.3 to 1.21.11, and 26.1.2 to 26.3.
Install
- Install Fabric Loader and Fabric API, or NeoForge.
- Put the jar for your exact Minecraft version and loader in
mods/.
- Start the game. The mod writes its address and token to
~/.mcpfabric/bridge.json, readable only by you, and the MCP server finds the game through it, so there is no token to copy.
- Add the MCP server to your client:
npx -y mcpfabric-mcp-server. The quick start has ready configs for Claude Desktop, Claude Code and others.
The bridge gives an AI operator-level control of the game. It listens on 127.0.0.1 only and needs a token. Anything the agent should not do can be switched off in config/mcpfabric.config.json, and generic UI control and the developer tools are off until you turn them on. Read the security policy before exposing it beyond your own machine.
Things to ask
- "Look around and tell me what is nearby."
- "Find iron, mine a stack and bring it back to the chest at home."
- "Build a 7 by 7 cobblestone house with a door facing the river."
- "Who is online, and what has been happening in chat?"
Source, documentation and releases are on GitHub.
评论 0
登录后参与评分
还没有评论,来抢沙发吧