minecraft-mcp-server
Enables AI agents to control a Minecraft bot inside a Java Edition world via MCP, providing tools for movement, building, mining, combat, farming, trading, inventory, and world perception.
README
<div align="center">
██╗ ██╗██╗███╗ ██╗███████╗ ██████╗██████╗ █████╗ ███████╗████████╗
██║ ██║██║████╗ ██║██╔════╝██╔════╝██╔══██╗██╔══██╗██╔════╝╚══██╔══╝
██╔████╔╝██║██╔██╗ ██║█████╗ ██║ ██████╔╝███████║█████╗ ██║
╚██╔╝██╔╝██║██║╚██╗██║██╔══╝ ██║ ██╔══██╗██╔══██║██╔══╝ ██║
╚═╝ ╚═╝ ██║██║ ╚████║███████╗╚██████╗██║ ██║██║ ██║██║ ██║
╚═╝╚═╝ ╚═══╝╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝
M C P S E R V E R
🟫🟩🟫 Give any AI agent a body inside Minecraft. 🟫🟩🟫
Connect · Build · Mine · Fight · Farm · Trade · Chat — one MCP server, any AI, any world.
</div>
⛏️ What is this?
minecraft-mcp-server is a Model Context Protocol server that puts an AI agent inside a real Minecraft Java Edition world through mineflayer. It exposes 61 tools covering movement, building, mining, combat, farming, inventory, villager trading, and world perception — so any MCP-compatible client can spawn a bot that actually sees the world, walks around it, and acts on it.
This is not tied to any single AI product. It speaks plain MCP over stdio, so it works with any MCP host — Claude Desktop, Claude Code, Cursor, Cline, Windsurf, your own custom MCP client, or anything else that can launch a local MCP server. If your agent can talk MCP, it can play Minecraft.
Built for singleplayer worlds opened via "Open to LAN", offline-mode/cracked servers (e.g. TLauncher), and standard online-mode servers.
🧰 Tool chest — what your agent can do
| Category | Tools |
|---|---|
| 🔌 Connection | connect, disconnect, status |
| 👀 Perception | position, nearby blocks, block lookup, find block, nearby entities, inventory |
| 🚶 Movement | goto position, goto player, follow player, look at, look direction, stop, jump |
| 🧱 Building | place block, dig block, build cuboid structure, clear area |
| 🖐️ Interaction | chat, equip item, toss item, craft item, attack entity, activate block, eat, sleep, collect block (mine + auto-pickup) |
| 🎒 Inventory | open/deposit/withdraw/close container, use furnace, give item (creative), move item slot |
| ⚔️ Combat | sprint, sneak, use held item (block/draw/drink), shoot bow |
| 🌾 Farming | till soil, plant seed, harvest crop |
| 🌍 World | biome lookup, light level, get time, read sign |
| 🗣️ Social | whisper, list players, open villager trades, execute trade |
| 🧭 Misc | mount, dismount, respawn, wait |
Every tool returns structured JSON and actionable error messages — no raw stack traces dumped on your agent.
📦 Installation
git clone https://github.com/AhmadTariq1337/minecraft-mcp-server.git
cd minecraft-mcp-server
npm install
npm run build
This compiles TypeScript from src/ into dist/, producing dist/index.js — the entry point your MCP host will launch.
🔧 Configuring your MCP client
Any host that supports local (stdio) MCP servers can use this. The server is launched as:
node /path/to/minecraft-mcp-server/dist/index.js
Claude Desktop / Claude Code
Add to your MCP config (claude_desktop_config.json or equivalent):
{
"mcpServers": {
"minecraft": {
"command": "node",
"args": ["/absolute/path/to/minecraft-mcp-server/dist/index.js"]
}
}
}
Cursor / Cline / Windsurf / other MCP hosts
The pattern is the same everywhere — point your client's MCP server config at node + the absolute path to dist/index.js. Consult your client's docs for where that config file lives.
🔑 No API keys, no cloud dependency. Everything runs locally over stdio.
🎮 Quick start in-game
- Open your Minecraft world (singleplayer works great).
- Press Escape → Open to LAN — note the port number shown in chat.
- Ask your agent to connect:
"Connect to localhost on port
<port>as<bot-name>, auth offline." - That's it — your agent can now see the world, move, mine, build, and chat.
{
"host": "localhost",
"port": 12345,
"username": "AgentBot",
"auth": "offline"
}
Use auth: "microsoft" only if connecting with a real Mojang/Microsoft account to an online-mode server.
🧱 Supported Minecraft versions
This server rides on mineflayer, which determines actual protocol support. At time of writing, the published mineflayer release supports up through Minecraft 1.21.x. Mojang's 2026 year.drop versioning scheme (e.g. 26.1.x) is not yet supported upstream — connecting to a newer world will fail with a protocol/version mismatch until mineflayer ships support. Older clients like OptiFine 1.21.11 or vanilla 1.21.x work out of the box.
If you hit a version-mismatch error, launch a world on a supported version (TLauncher makes this easy) while upstream support catches up.
🏗️ Project layout
minecraft-mcp-server/
├── src/
│ ├── index.ts entry point — registers every tool group
│ ├── bot.ts mineflayer connection lifecycle
│ ├── types.ts shared types
│ ├── constants.ts tunable limits (scan radius, timeouts, etc.)
│ └── tools/
│ ├── connection.ts
│ ├── perception.ts
│ ├── movement.ts
│ ├── building.ts
│ ├── interaction.ts
│ ├── inventory.ts
│ ├── combat.ts
│ ├── farming.ts
│ ├── world.ts
│ ├── social.ts
│ └── misc.ts
└── dist/ compiled output (npm run build)
🤝 Contributing
Issues and PRs welcome — especially around mineflayer version-support tracking, new tool coverage, and better pathfinding heuristics. Keep tool descriptions actionable (what it does, what it returns, common error cases) so any agent — not just one AI vendor's — can use them well without guesswork.
📜 License
MIT — see LICENSE.
<div align="center">
🟩🟫🟩🟫🟩 Built block by block. 🟩🟫🟩🟫🟩
</div>
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。