minecraft-mcp

minecraft-mcp

A 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.

Category
访问服务器

README

minecraft-mcp

A local MCP server that lets AI harnesses (Claude Code, Codex, Hermes, ...) perform every action a Minecraft player can — move, jump, break/place blocks, fight, manage inventory, chat — plus op-level extras (teleport, gamemode, weather/time, summon entities, console commands).

Architecture

AI Harness (Claude Code / Codex / Hermes)
   │  stdio (MCP protocol)
   ▼
src/  Node + TypeScript MCP server  (this repo, `npm run dev` / dist/index.js)
   │  WebSocket, JSON frames (see docs/bridge-protocol.md)
   ▼  ws://127.0.0.1:8765
plugin/  Java Paper plugin `minecraft-mcp-bridge`
   │  Bukkit/Paper API
   ▼
Local PaperMC server (server/ dir) — you join as the controlled player

The harness controls whoever is online on the server (you). Every tool accepts an optional player argument to target a specific online player.

Prerequisites

  • Node.js ≥ 18
  • JDK ≥ 21 to build the plugin (JDK 24 works; the plugin is compiled for Java 21 bytecode)
  • A Minecraft Java Edition client matching the server version

Quick start

npm install                          # install MCP server deps
node scripts/setup-server.mjs 26.2   # download Paper 26.2 into server/, accept EULA
npm run start:server                 # build plugin, install it, launch the server

Notes:

  • setup-server.mjs takes an optional version argument (26.2, 1.21.11, ...). Without one it downloads the latest 1.21.x.
  • Paper 26.1+ requires Java 25 to run (not just build). If a portable JDK is extracted under .jdk/ (e.g. .jdk/jdk-25.0.4+7/), start-server.mjs uses it automatically instead of the system java.
  • Join localhost with a client matching the server version. The server runs with online-mode=false for local dev.

To verify everything end-to-end (requires the server running and a player online):

npm run smoke:bridge        # exercises every tool against the live server

Harness configuration

The MCP server runs over stdio. Build first (npm run build), then register:

Claude Code (claude mcp add):

claude mcp add minecraft -- node /path/to/minecraft-mcp/dist/index.js

Codex / other harnesses — equivalent stdio entry:

{
  "mcpServers": {
    "minecraft": {
      "command": "node",
      "args": ["/path/to/minecraft-mcp/dist/index.js"]
    }
  }
}

Environment variable MINECRAFT_MCP_BRIDGE_URL overrides the bridge address (default ws://127.0.0.1:8765).

Tools

All tools take an optional player (defaults to the first online player).

Category Tool What it does
Movement look_at Face a block/position
move_to Walk/sprint toward coordinates (timeout-aware)
jump / sprint / sneak / stop Movement state control
Interaction break_block / place_block Block manipulation
use_item / attack / interact_entity Right-click / combat
Inventory get_inventory / equip_item / drop_item / swap_hands Full inventory control
Info get_player_state / get_block_at / get_nearby_entities / get_time_weather World & player queries
Chat send_chat Chat as the player
Extras teleport / set_gamemode / give_item / set_time / set_weather / summon_entity / run_command Beyond player capabilities

The full tool/command contract is documented in docs/bridge-protocol.md.

Development

npm run typecheck     # TS typecheck
npm run build         # compile MCP server to dist/
npm test              # bridge unit tests (mock socket, no Minecraft needed)
npm run build:plugin  # build the Paper plugin jar (Gradle shadowJar)

Plugin jar output: plugin/build/libs/minecraft-mcp-bridge-0.1.0.jar. Bridge port is configurable in plugin/src/main/resources/config.yml (runtime copy: server/plugins/minecraft-mcp-bridge/config.yml).

Known limitations (v0.1)

  • move_to is velocity-based steering, not pathfinding; it hops over 1-block obstacles but won't route around walls.
  • Survival break_block uses a fixed 1s delay regardless of tool/hardness.
  • use_item / interact_entity fire the Bukkit events but don't reproduce vanilla effects (eating, trading, mounting).
  • Controls an online player; fake-player NPCs are future work.

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选