minecraft-ai-mcp
An MCP server that enables AI agents to play Minecraft with full bot capabilities including pathfinding, block interaction, crafting, combat, and more.
README
🎮 Minecraft MCP Server
An MCP (Model Context Protocol) server that allows AI agents to play Minecraft! Built with Mineflayer and the official MCP TypeScript SDK.
🚀 Features
Connection Management
- Connect/disconnect to any Minecraft server
- Support for offline and Microsoft authentication
- Automatic version detection
Movement & Navigation
- Pathfinding: Navigate to any coordinates using A* pathfinding
- Follow players: Dynamically follow other players
- Look at: Point the bot's view at specific coordinates
- Jump: Make the bot jump
Block Interaction
- Dig blocks: Break blocks at specific coordinates
- Place blocks: Place blocks from inventory
- Find blocks: Search for specific block types nearby
- Activate blocks: Interact with chests, buttons, doors, etc.
- Collect blocks: Navigate to and mine specific blocks
Inventory Management
- View inventory: See all items in inventory
- Equip items: Equip items to hand, off-hand, or armor slots
- Drop items: Discard items from inventory
Crafting
- Craft items: Automatically craft items with available recipes
- Get recipes: Query available recipes for any item
Combat
- Attack entities: Attack mobs or players
- Stop attacking: Cease combat
- Get nearby entities: List all entities within range
Chat & Communication
- Send chat: Send public chat messages
- Whisper: Send private messages to players
- Get players: List all players on the server
Survival Features
- Auto-eat: Automatic food consumption when hungry
- Eat: Manually eat specific food items
- Sleep: Find and sleep in nearby beds
- Get status: Full status report (health, hunger, position, etc.)
📦 Installation
Quick Start (Recommended)
Run directly with npx - no installation required:
npx -y minecraft-ai-mcp
Global Installation
npm install -g minecraft-ai-mcp
minecraft-ai-mcp
From Source
# Clone the repository
git clone https://github.com/harjjotsinghh/minecraft-mcp.git
cd minecraft-mcp
# Install dependencies
npm install
# Build the project
npm run build
# Run the server
npm start
🔧 Configuration
Claude Desktop Configuration
Add to your Claude Desktop config file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"minecraft": {
"command": "npx",
"args": ["-y", "minecraft-ai-mcp"]
}
}
}
Cursor Configuration
Add to your .cursor/mcp.json file:
{
"mcpServers": {
"minecraft": {
"command": "npx",
"args": ["-y", "minecraft-ai-mcp"]
}
}
}
Alternative: Using Global Installation
If you installed globally, you can use the command directly:
{
"mcpServers": {
"minecraft": {
"command": "minecraft-ai-mcp"
}
}
}
🎯 Available Tools
| Tool | Description |
|---|---|
connect |
Connect to a Minecraft server |
disconnect |
Disconnect from the server |
get_status |
Get bot's current status |
goto |
Navigate to coordinates |
follow_player |
Follow a specific player |
stop_movement |
Stop all movement |
jump |
Make the bot jump |
look_at |
Look at coordinates |
dig_block |
Break a block |
place_block |
Place a block |
get_block_info |
Get info about a block |
find_blocks |
Find nearby blocks |
get_inventory |
View inventory contents |
equip_item |
Equip an item |
drop_item |
Drop items |
craft_item |
Craft an item |
get_recipes |
Get crafting recipes |
attack_entity |
Attack an entity |
stop_attack |
Stop attacking |
get_nearby_entities |
List nearby entities |
send_chat |
Send chat message |
whisper |
Private message a player |
get_players |
List online players |
use_item |
Use held item |
eat |
Eat food |
sleep |
Sleep in a bed |
wake |
Wake up |
collect_block |
Collect specific blocks |
activate_block |
Interact with a block |
💡 Example Usage
Connecting to a Server
Connect to my local Minecraft server at localhost:25565 with username "AIBot"
Mining Diamonds
Find diamond ore near me and navigate to collect it
Building
Build a 3x3 cobblestone platform at my current position
Combat
Find and attack any zombies within 20 blocks
Crafting
Craft a wooden pickaxe using the wood in my inventory
🏗️ Development
# Run in development mode with auto-reload
npm run dev
# Build for production
npm run build
# Start the built server
npm start
🔐 Authentication
Offline Mode (Default)
For servers with online-mode=false:
Connect with auth: "offline"
Microsoft Account
For online servers (requires Microsoft account):
Connect with auth: "microsoft"
Note: Microsoft authentication will open a browser window for login.
⚠️ Known Limitations
- No GUI: The bot operates headlessly - no game window is displayed
- Server Compatibility: Works best with vanilla Minecraft servers
- Version Support: Supports Minecraft 1.8 through 1.21+
- Single Bot: Currently supports one bot connection at a time
🤝 Contributing
Contributions are welcome! Please feel free to submit issues and pull requests.
📄 License
MIT License - feel free to use this in your own projects!
🙏 Credits
- Mineflayer - The amazing Minecraft bot framework
- PrismarineJS - For all the Minecraft tooling
- Anthropic - For the MCP specification
- Built with ❤️ by Harjot Singh Rana for the AI gaming revolution
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。