minecraft-mcp
A set of MCP servers that allow AI assistants to control a Minecraft server and client, including running commands, managing plugins, taking screenshots, and calling arbitrary API methods via reflection.
README
minecraft-mcp
MCP (Model Context Protocol) servers for AI-assisted Minecraft development. Lets tools like Claude Code interact directly with a running Minecraft server and client — viewing logs, running commands, installing plugins, taking screenshots, controlling the player, and calling arbitrary Bukkit/Paper/Minecraft API methods via reflection.
Repository layout
minecraft-mcp/
├── packages/
│ ├── shared/ TypeScript protocol types + WebSocket connection class
│ ├── mcp-server-paper/ MCP server (stdio) ↔ Paper/Spigot plugin
│ └── mcp-server-fabric/ MCP server (stdio) ↔ Fabric client mod
└── minecraft/
├── paper-plugin/ Paper/Spigot plugin (Java 21, Gradle)
└── fabric-mod/ Fabric client mod for MC 26.1.2 (Java 25, Gradle 9.4, fabric-loom 1.16)
Architecture
┌──────────────────────┐ stdio ┌────────────────────────────┐
│ Claude Code / LLM │ ◄──────────────────► │ mcp-server-paper (Node) │
└──────────────────────┘ └──────────┬─────────────────┘
│ WebSocket
┌──────────▼─────────────────┐
│ Paper plugin (Java) │
│ ws://localhost:25575 │
└────────────────────────────┘
┌──────────────────────┐ stdio ┌────────────────────────────┐
│ Claude Code / LLM │ ◄──────────────────► │ mcp-server-fabric (Node) │
└──────────────────────┘ └──────────┬─────────────────┘
│ WebSocket
┌──────────▼─────────────────┐
│ Fabric mod (Java) │
│ ws://localhost:25576 │
└────────────────────────────┘
The Minecraft side (plugin / mod) runs a local WebSocket server. The Node.js MCP servers connect to it as clients. Claude Code (or any MCP host) runs the Node.js processes and talks to them over stdio.
Quick start
Prerequisites
| Tool | Version |
|---|---|
| Node.js | ≥ 20 |
| tsx | any (npm install -g tsx) |
| Java | 21 (Paper plugin) / 25 (Fabric mod – MC 26.1.2 ships Java 25 bytecode) |
| Gradle | 8.8+ for the Paper plugin wrapper. The Fabric mod has its own checked-in wrapper pinned to 9.4. |
1. Install Node packages
npm install
2. Build the Paper plugin
cd minecraft/paper-plugin
gradle wrapper --gradle-version 8.8 # once only
./gradlew shadowJar
# Output: build/libs/minecraft-mcp-paper-0.1.0.jar
Copy the jar into your Paper server's plugins/ directory and start the server.
3. Build the Fabric mod
cd minecraft/fabric-mod
./gradlew build # uses the bundled wrapper (Gradle 9.4) – needs Java 25 on JAVA_HOME
# Output: build/libs/minecraft-mcp-fabric-0.1.0.jar
Copy the jar into your Fabric client's mods/ directory and launch Minecraft.
4. Configure Claude Code (.claude/mcp.json)
{
"mcpServers": {
"minecraft-paper": {
"command": "node",
"args": ["--import", "tsx/esm", "/path/to/packages/mcp-server-paper/src/index.ts"],
"env": {
"PAPER_WS_URL": "ws://localhost:25575"
}
},
"minecraft-fabric": {
"command": "node",
"args": ["--import", "tsx/esm", "/path/to/packages/mcp-server-fabric/src/index.ts"],
"env": {
"FABRIC_WS_URL": "ws://localhost:25576"
}
}
}
}
Available tools
Paper / Spigot server (mcp-server-paper)
| Tool | Description |
|---|---|
get_server_logs |
Tail logs/latest.log, optional text filter |
subscribe_server_logs |
Push future log lines to the MCP client |
run_console_command |
Run a console command, capture output |
list_online_players |
List online players |
list_plugins |
List loaded plugins |
install_plugin |
Copy a jar into plugins/, optional hot-load |
reload_plugin |
Disable + re-enable a named plugin |
restart_server |
Restart or stop the server |
reflect_invoke |
Call any server-side method via reflection |
reflect_get_field |
Read a field value via reflection |
reflect_set_field |
Set a field value via reflection |
reflect_new_instance |
Construct a new object instance |
get_class_info |
List declared methods and fields of a class |
var_get / var_list / var_delete / var_clear |
Manage named variables across calls |
search_javadocs |
Search Paper/Folia/Velocity javadoc index |
fetch_javadoc_page |
Fetch and strip HTML from a javadoc page |
Fabric client mod (mcp-server-fabric)
| Tool | Description |
|---|---|
get_chat_log |
Recent chat HUD messages |
send_chat_message |
Send chat text or /command |
get_player_state |
Position, health, inventory, game mode |
player_move_to |
Teleport player to coordinates |
player_look_at |
Set yaw/pitch or look toward a world point |
player_jump |
Trigger a jump |
player_break_block |
Break block at coordinates |
player_place_block |
Place held item against a block face |
player_interact |
Right-click a block |
get_block_at |
Block type and state at coordinates |
get_nearby_entities |
Entities within a radius |
take_screenshot |
Capture client view as base64 PNG |
client_reflect_invoke |
Call any client-side method via reflection |
client_reflect_get_field |
Read a client-side field |
client_reflect_set_field |
Set a client-side field |
client_get_class_info |
List methods/fields of a Minecraft class |
client_var_get / client_var_list / client_var_delete / client_var_clear |
Variable management |
Reflection & variable system
The reflection tools let you call any method on any allowed class and chain results together using named variables:
# Get the overworld World object and store it as $overworld
reflect_invoke(
class_name="org.bukkit.Bukkit",
method_name="getWorld",
args=[{type:"java.lang.String", value:"world"}],
assign_to="overworld"
)
# Use $overworld to get the player list
reflect_invoke(
class_name="org.bukkit.World",
target="$overworld",
method_name="getPlayers",
assign_to="players"
)
# Read a field on a non-serialisable object returned as an opaque handle
# (the handle ID looks like "obj_42")
reflect_get_field(
class_name="org.bukkit.entity.Player",
field_name="exp",
target="obj_42"
)
Non-serialisable return values are stored in an in-memory registry and returned as:
{"__type": "object_ref", "__id": "obj_42", "__class": "org.bukkit.World"}
Pass "__id" or "$varName" back as a target or argument value in subsequent calls.
Configuration
Paper plugin (plugins/MinecraftMcp/config.yml)
websocket:
host: "0.0.0.0"
port: 25575
reflection:
allowed-packages:
- "org.bukkit.*"
- "io.papermc.*"
- "net.kyori.adventure.*"
- "net.minecraft.*"
- "java.util.*"
- "java.lang.*"
blocked-packages:
- "java.lang.Runtime"
- "java.lang.ProcessBuilder"
max-object-refs: 1000
Fabric mod (.minecraft/config/mcp.json)
{
"websocket": { "host": "127.0.0.1", "port": 25576 },
"reflection": {
"allowedPackages": ["net.minecraft.*", "com.mojang.*", "net.fabricmc.*"],
"blockedPackages": ["java.lang.Runtime"],
"maxObjectRefs": 1000
}
}
Security notes
- The WebSocket servers bind to
127.0.0.1by default (Fabric) and0.0.0.0(Paper — change to127.0.0.1if the MCP server runs on the same host). - Reflection is gated behind configurable package allow/block lists.
java.lang.Runtimeandjava.lang.ProcessBuilderare blocked by default.- The Paper plugin's command sender runs with OP-level permissions; restrict MCP bridge access on shared servers.
Development
# Run Paper MCP server (connects to ws://localhost:25575)
npm run dev:paper
# Run Fabric MCP server (connects to ws://localhost:25576)
npm run dev:fabric
# Override the WebSocket URL
PAPER_WS_URL=ws://192.168.1.10:25575 npm run dev:paper
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。