minecraft-mcp
Enables AI agents to control a Minecraft bot for movement, building, crafting, and instant schematic-based structure spawning via MCP tools.
README
⛏️ Minecraft MCP Server — AI-Powered Minecraft Agent
Built by Soumyadeep, AI/ML Lead
What Is This?
This is an AI agent for Minecraft, powered by the Model Context Protocol (MCP). It connects any MCP-compatible AI client (Claude Desktop, Cursor, Kiro, Windsurf, etc.) directly to your Minecraft world, turning the AI into a fully capable in-game bot.
The AI can move, build, craft, chat, and now — instantly spawn entire structures from schematic files using a single command.
✨ What's New — Schematic Builder (The Star Feature)
The biggest addition to this fork is the Schematic Builder System — a set of 3 new MCP tools that let the AI construct massive, complex structures in seconds using .schem / .schematic files.
Instead of the AI tediously calling place-block hundreds of times (slow, error-prone, wrong), it now:
- Checks its bundled library of schematic files
- Parses the file to understand its dimensions and blocks
- Fires a stream of
/setblockcommands via the bot to build the entire structure instantly in Creative mode — no inventory, no pathfinding, no failures
The 3 New Tools
| Tool | Description |
|---|---|
list-schematics |
Lists all .schem files bundled with the server. The AI always calls this first before attempting any build. |
schematic-info |
Inspects a schematic file — shows dimensions, fill %, and top block types — without touching the world. |
build-schematic |
Builds the structure at given world coordinates using rapid /setblock commands. Accepts a short name ("smallhouse1") or a full path. |
Supported Formats
| Format | Extension | Notes |
|---|---|---|
| Sponge Schematic | .schem |
✅ Primary format (WorldEdit, modern) |
| MCEdit Schematic | .schematic |
✅ Legacy format, read-only |
| NBT Structure | .nbt |
✅ Vanilla Minecraft structure files |
How the AI Uses It
The AI is instructed to always check the bundled library first. So when you say:
"Build a viking house near me"
The AI will:
- Call
list-schematics→ findsviking-house1 - Call
schematic-info("viking-house1")→ reads dimensions - Call
build-schematic("viking-house1", x, y, z)→ spawns it instantly
No manual block placement. No hallucinated geometry. Just a real, human-designed structure in seconds.
🛠️ Full Tool Reference
Movement
| Tool | Description |
|---|---|
get-position |
Get the bot's current world coordinates |
move-to-position |
Pathfind to specific coordinates |
look-at |
Make the bot look at coordinates |
jump |
Make the bot jump |
move-in-direction |
Move in a direction for a duration |
fly-to |
Fly directly to coordinates |
Building (Schematic)
| Tool | Description |
|---|---|
list-schematics |
★ List all bundled schematic files |
schematic-info |
Inspect a schematic's metadata |
build-schematic |
Instantly build a structure from a .schem file |
Blocks
| Tool | Description |
|---|---|
place-block |
Place a single block at a position |
dig-block |
Dig/break a block |
get-block-info |
Get info about a block at coordinates |
find-blocks |
Find nearby blocks of a given type |
Inventory & Crafting
| Tool | Description |
|---|---|
list-inventory |
List all items in the bot's inventory |
find-item |
Find a specific item |
equip-item |
Equip an item |
list-recipes |
List craftable recipes |
craft-item |
Craft an item |
get-recipe |
Get detailed recipe information |
can-craft |
Check if the bot can craft an item |
smelt-item |
Smelt items in a furnace |
Entities & Chat
| Tool | Description |
|---|---|
find-entity |
Find a nearby entity |
send-chat |
Send an in-game chat message |
read-chat |
Read recent chat messages |
detect-gamemode |
Detect the current game mode |
🚀 Setup Guide
Prerequisites
- Node.js ≥ 20.10.0
- Git
- Minecraft Java Edition (tested on 1.21.x)
- An MCP-compatible AI client (Claude Desktop, Cursor, Kiro, etc.)
Step 1 — Clone & Install
git clone https://github.com/soumyadeo/minecraft-mcp-server.git
cd minecraft-mcp-server
npm install
Step 2 — Build
npm run build
This compiles TypeScript to dist/main.js.
Step 3 — Add Schematic Files (Optional but Recommended)
Drop any .schem files into the schematics/ folder at the root of the project:
minecraft-mcp-server/
schematics/
smallhouse1.schem ← already included
viking-house1.schematic ← already included
my-castle.schem ← add your own!
The AI will automatically discover them via list-schematics.
Step 4 — Configure Your MCP Client
Claude Desktop
Open File → Settings → Developer → Edit Config and add:
{
"mcpServers": {
"minecraft": {
"command": "node",
"args": [
"C:\\path\\to\\minecraft-mcp-server\\dist\\main.js",
"--host", "localhost",
"--port", "25565",
"--username", "ClaudeBot"
]
}
}
}
Cursor / VS Code (mcp.json)
{
"mcpServers": {
"minecraft": {
"command": "node",
"args": [
"C:\\path\\to\\minecraft-mcp-server\\dist\\main.js",
"--host", "localhost",
"--port", "25565",
"--username", "ClaudeBot"
],
"type": "stdio"
}
}
}
Replace
C:\\path\\to\\with the actual path on your machine.
Step 5 — Start Minecraft
- Launch Minecraft Java Edition
- Open or create a Singleplayer world
- Press ESC → Open to LAN
- Note the port number shown (usually
25565) - In the chat, give the bot operator permissions:
/op ClaudeBot⚠️ Operator permissions are required for
/setblockcommands to work (used by the schematic builder)
Step 6 — Restart Your AI Client & Test
Fully restart your MCP client (close from system tray if needed). The bot should join the game automatically.
Test prompt:
"Check what schematics are available and build the smallhouse at my current position."
📦 Adding More Schematics
The schematic library is just a folder. To add more structures:
-
Find
.schemfiles online:- Planet Minecraft — search and filter by "schematic"
- Minecraft-Schematics.com
- WorldEdit's built-in
//copy+//schem savecommand in-game
-
Drop the file into
minecraft-mcp-server/schematics/ -
Restart the MCP server
The AI immediately picks it up — no code changes needed.
⚙️ Server Arguments
| Argument | Default | Description |
|---|---|---|
--host |
localhost |
Minecraft server hostname |
--port |
25565 |
Minecraft server port |
--username |
ClaudeBot |
Bot's in-game username |
node dist/main.js --host localhost --port 25565 --username ClaudeBot
🏗️ Architecture
src/
main.ts — MCP server entry point, tool registration
bot-connection.ts — Mineflayer bot lifecycle management
tool-factory.ts — MCP tool registration wrapper
tools/
schematic-tools.ts — ★ Schematic builder (new)
block-tools.ts — Block placement & digging
position-tools.ts — Movement & pathfinding
inventory-tools.ts — Inventory management
crafting-tools.ts — Recipe lookup & crafting
furnace-tools.ts — Smelting
entity-tools.ts — Entity detection
chat-tools.ts — In-game chat
flight-tools.ts — Flight control
gamestate-tools.ts — Game mode detection
schematics/ — Bundled schematic file library
smallhouse1.schem
viking-house1.schematic
Key Libraries:
mineflayer— Minecraft bot frameworkprismarine-schematic— Schematic file parsermineflayer-pathfinder— Pathfinding@modelcontextprotocol/sdk— MCP server SDK
Forked and extended from yuniko-software/minecraft-mcp-server
🗺️ Roadmap
- [ ]
mode: "bot_place"— physical survival-mode building viamineflayer-builder - [ ]
.litematicformat support via@kleppe/litematic-reader - [ ]
search-and-buildtool — scrape and download schematics by keyword - [ ]
run-builder-script— execute procedural build scripts (for pyramids, domes, etc.) - [ ] Chest & storage tools
- [ ] Villager trading tools
- [ ] Combat & survival tools
🤝 Contributing
Pull requests are welcome! See CONTRIBUTING.md for guidelines.
📄 License
MIT — see LICENSE
Built and extended by Soumyadip Debnath, AI/ML Lead Original project by Yuniko Software
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。