Minecraft Command Execution MCP Server
Minecraft 命令执行 MCP 服务器
一个 MCP (Model Context Protocol) 服务器,使 Claude 能够通过 MasterControl API 执行 Minecraft 命令并获取 Tab 补全。
功能
此 MCP 服务器提供两个工具:
1. execute_command
以已验证玩家的身份远程执行任何 Minecraft 命令。
玩家必须在线且在服务器上
执行命令时,玩家会在游戏内收到通知
返回命令输出或错误消息
获取帮助:在任何命令后附加 "help"(例如:"island help", "island upgrade help")
示例:
execute_command("gamemode creative")
execute_command("island help") # Shows island command help
execute_command("island upgrade help") # Shows upgrade subcommand help
execute_command("island upgrade speed 5")2. tab_complete
获取部分命令的 Tab 补全建议。
发现可用的命令和子命令
查找有效的参数和选项
工作方式与在 Minecraft 中按 Tab 键完全相同
示例:
tab_complete("gamemode ") # Returns: survival, creative, adventure, spectator
tab_complete("island ") # Returns: available island subcommandsRelated MCP server: MCP Minecraft Remote
先决条件
Python 3.10 或更高版本
uv包管理器 (在此安装)运行中的带有命令 API 的 MasterControl 服务器
您的 Minecraft 玩家的有效 API 密钥
安装
克隆仓库:
git clone https://github.com/<your-user>/minecraft-mcp-server.git
cd minecraft-mcp-server安装依赖:
uv sync配置环境变量:
cp .env.example .env使用您的设置编辑
.env文件:
# Required: Your Midnight API key
MIDNIGHT_API_KEY=your-api-key-here
# Optional: MasterControl API URL (defaults to localhost:8080)
MIDNIGHT_API_URL=http://your-server:8080/api/v2使用方法
本地测试
直接运行服务器进行测试:
uv run server.py它将等待 stdio 输入 — 这是 MCP 服务器的预期行为。按 Ctrl+C 退出。
与 Claude Code 集成
将服务器添加到 Claude Code(使用您克隆仓库的绝对路径):
claude mcp add midnight \
--transport stdio \
--env MIDNIGHT_API_KEY=your-key-here \
--env MIDNIGHT_API_URL=http://localhost:8080/api/v2 \
-- uv --directory /absolute/path/to/minecraft-mcp-server run server.py验证安装
在 Claude Code 中,检查服务器是否正在运行:
/mcp您应该看到 midnight 列出且状态为 ✓ Connected。
对话示例
执行命令:
You: "Change my gamemode to creative"
Claude: [Uses execute_command("gamemode creative")]
✓ Command executed successfully获取命令帮助:
You: "How do I use the island upgrade command?"
Claude: [Uses execute_command("island upgrade help")]
Shows the help output for island upgrade探索命令:
You: "What island commands are available?"
Claude: [Uses tab_complete("island ")]
Lists: upgrade, create, delete, invite, members...配置
环境变量
变量 | 必需 | 默认值 | 描述 |
| 是 | - | 您的玩家 API 密钥 |
| 否 |
| MasterControl API 基础 URL |
API 端点
POST /api/v2/command/execute— 执行命令POST /api/v2/command/tabComplete— 获取 Tab 补全
故障排除
"MIDNIGHT_API_KEY environment variable not set!"
创建一个 .env 文件:
echo "MIDNIGHT_API_KEY=your-key-here" > .env"Failed to execute command"
请检查:
MasterControl API 是否正在运行
API 密钥是否正确
玩家是否在线且在服务器上(不在代理服务器的等待状态中)
安全性
切勿提交
.env文件 — 它包含您的 API 密钥(已通过.gitignore排除)命令以您的玩家权限执行
AI 可以运行您在游戏中能运行的任何命令
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Tools
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables management of Minecraft servers through the MCSManager API. Supports executing server commands, checking player status, retrieving server information, and controlling game settings like weather.191MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to remotely control a Minecraft player, including navigation, mining, building, and interaction with the world and other players.MIT
- FlicenseNot gradedqualityBmaintenanceEnables natural language control of a Minecraft bot, allowing it to execute tasks like mining, exploring, and item management via AI-powered commands.1
- AlicenseAqualityBmaintenanceExposes Minecraft server commands via RCON as a tool, and optionally powers an in-game AI chat listener that answers player questions using Claude.2MIT
Related MCP Connectors
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Augments MCP Server - A comprehensive framework documentation provider for Claude Code
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mattlack15/midnightsky-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server