跳到正文

MCPFabric

作者:denfry

Give AI agents full control of Minecraft. A Fabric mod + MCP server that lets Claude and other MCP clients observe and play the game — 50+ tools, for Minecraft 1.21.1–26.3.

收藏

介绍

中文介绍正在准备中,下面暂时显示原文。

MCP Fabric is a Minecraft Fabric mod that gives AI agents full read and control access to the game through the Model Context Protocol (MCP). Connect Claude — or any MCP client — to Minecraft and let it observe the world, play as your character, or act as a server operator, using 50+ tools across Minecraft 1.21.1 – 26.3.

It ships in two parts: a Fabric mod that embeds a local HTTP bridge inside Minecraft, and a small MCP server that connects to that bridge and exposes the tools to your AI assistant.

  • AI plays Minecraft — movement, mining, building, combat, navigation, and vision (screenshots for vision models).
  • Server operator powers — run any command, edit the world, manage entities and players.
  • Full observation — blocks, entities, inventory, chat, time/weather, and live game events.
  • Works with any MCP client — Claude Desktop, Claude Code, and more.
  • Broad version support — one mod, 14 jars, Minecraft 1.21.x and the 26.x line.
  • Local & token-secured by default — the bridge binds to 127.0.0.1 and requires a bearer token.

What can the AI do?

Once connected, your AI assistant can both see and act:

  • Play as your character (client): move, look, jump, mine and place blocks, use and drop items, attack, manage the hotbar and inventory, and pathfind to coordinates with built-in A\* navigation.
  • See the game (client): read your status, inventory and equipment, capture screenshots for vision models, and get a text description of the surroundings.
  • Operate a world/server: read and write blocks, fill regions, summon and remove entities, set time and weather, and run any operator-level command with output captured back.
  • Manage players (server): list players, teleport, set gamemode, give items, apply effects, message, or kick.
  • Stay aware: poll recent events — damage, deaths, chat, spawns, and player join/leave.

How does it work?

Claude / any MCP client
        │  MCP (stdio or streamable HTTP)
   mcp-server  (Node / TypeScript)
        │  HTTP: POST /rpc (JSON-RPC) + GET /events (SSE), bearer token, 127.0.0.1 only
   Fabric mod "mcpfabric"  (HTTP server embedded in Minecraft)
        │  all game access runs on the main thread
   common (env *): info · world · entities · players · command · chat · events
   client (env): player · control · interact · inventory · vision · navigation

Reads use Minecraft’s native API for structured data. Writes (setblock, summon, give, teleport, effects, weather, time) go through the command dispatcher with output capture. Player control uses the vanilla input pipeline (KeyMapping), screenshots use the vanilla screenshot system, and navigation is a custom A\* pathfinder.

Supported Minecraft versions

A single source tree targets many versions with Stonecutter. Each version ships its own jar named mcpfabric-<modVersion>+<mcVersion>.jar.

| Line | Minecraft versions (one jar each) | Java |
|——–|——————————————————————————–|——|
| 1.21.x | 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11 | 21 |
| 26.x | 26.1.2 (installs on 26.1 – 26.1.2), 26.2, 26.3 | 25 |

Requirements: Fabric Loader ≥ 0.19.5, the matching Fabric API build, and Node.js ≥ 20 for the MCP server.

Installation

  1. Download the jar for your Minecraft version and drop it — together with Fabric API — into your mods/ folder.
  • Client (AI plays as you): your Fabric instance’s mods/ folder.
  • Server (AI as admin): your dedicated Fabric server’s mods/ folder.
  • Both sides at once is fine.
  1. Launch the game once. The mod creates config/mcpfabric.config.json and starts the bridge on http://127.0.0.1:25599.
  2. Copy token from config/mcpfabric.config.json — the MCP server needs it. (The token is never printed to the log.)

Full setup for the MCP server and connecting to Claude Desktop / Claude Code is in the README on GitHub.

Tools (50+)

  • info — get_status, list_capabilities
  • world (read) — get_block, get_blocks_region, find_blocks, get_time_and_weather, list_dimensions, raycast
  • world (write) — set_block, fill_blocks, set_time, set_weather
  • entities — query_entities, get_entity, summon_entity, remove_entity
  • players (admin) — list_players, get_player, teleport_player, set_gamemode, give_item, apply_effect, message_player, kick_player
  • command — run_command (any operator-level command, with output capture)
  • chat — send_chat, get_recent_chat
  • player (client) — get_self, get_inventory, get_equipment, get_status_effects
  • control (client) — set_movement, stop_movement, look, look_at, jump, start_using_item, stop_using_item
  • interact (client) — break_block, place_block, use_item, attack_entity, use_entity, drop_held_item
  • inventory (client) — select_hotbar_slot, drop_slot, swap_slots
  • vision (client) — screenshot, describe_scene
  • navigation (client) — navigate_to, navigation_status, stop_navigation
  • events — poll_events

Server tools require a running server (integrated or dedicated); client tools require the client. Call get_status first — it reports which side you’re on and which tool groups are available.

Example prompts

  • “Look around and describe what’s nearby” → get_self + describe_scene (+ screenshot for a vision model).
  • “Walk to these coordinates and mine diamonds” → find_blocks → navigate_to → break_block.
  • “What’s happening on the server?” → list_players + poll_events.
  • “Build a wall here” → fill_blocks or a series of set_block / run_command.

Is it safe?

The bridge listens on 127.0.0.1 only and requires a bearer token by default. Operator-level capabilities (run_command, world writes, player control) are on by default, giving the AI full control — you can disable capability groups with the enable* flags in the config. Don’t expose the bridge externally without an authenticated reverse proxy in front of it. See the security policy.

Source code & license

Open source under the MIT license. Code, full documentation, and issue tracker live on GitHub — contributions and bug reports welcome.

常见问题

MCPFabric 支持哪些 Minecraft 版本?

MCPFabric 支持 Minecraft Java 版 1.21.1–26.3,共 16 个版本,可用的加载器:Fabric / NeoForge。下载时注意选择和你游戏版本一致的文件。

MCPFabric 怎么安装?

先用 PCL2 或 HMCL 启动器安装对应版本的 Fabric / NeoForge,再把下载的 .jar 文件放进游戏目录的 mods 文件夹,重新启动游戏即可。开启了版本隔离的,mods 文件夹在 versions/版本名 下面。运行环境:客户端和服务端都要装。

评论

登录后评论和评分

denfry 的其他作品

查看全部 →