Minecraft Command Execution MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Minecraft Command Execution MCP Server give me 64 diamonds"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Minecraft Command Execution MCP Server
An MCP (Model Context Protocol) server that enables Claude to execute Minecraft commands and get tab completions through the MasterControl API.
Features
This MCP server provides two tools:
1. execute_command
Execute any Minecraft command remotely as the authenticated player.
Player must be online and on a server
Player receives in-game notification when commands are executed
Returns command output or error messages
To get help: Append "help" to any command (e.g., "island help", "island upgrade help")
Examples:
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
Get tab completion suggestions for partial commands.
Discover available commands and subcommands
Find valid arguments and parameters
Works exactly like pressing Tab in Minecraft
Examples:
tab_complete("gamemode ") # Returns: survival, creative, adventure, spectator
tab_complete("island ") # Returns: available island subcommandsRelated MCP server: MCP Minecraft Remote
Prerequisites
Python 3.10 or higher
uvpackage manager (install here)A running MasterControl server with the command API
Valid API key for your Minecraft player
Installation
Clone the repo:
git clone https://github.com/<your-user>/minecraft-mcp-server.git cd minecraft-mcp-serverInstall dependencies:
uv syncConfigure environment variables:
cp .env.example .envEdit
.envwith your settings:# 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
Usage
Testing Locally
Run the server directly to test:
uv run server.pyIt will wait for stdio input — that's expected for an MCP server. Ctrl+C to exit.
Integrating with Claude Code
Add the server to Claude Code (use the absolute path to your cloned repo):
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.pyVerify Installation
In Claude Code, check that the server is running:
/mcpYou should see midnight listed with status ✓ Connected.
Example Conversations
Execute Commands:
You: "Change my gamemode to creative"
Claude: [Uses execute_command("gamemode creative")]
✓ Command executed successfullyGet Command Help:
You: "How do I use the island upgrade command?"
Claude: [Uses execute_command("island upgrade help")]
Shows the help output for island upgradeExplore Commands:
You: "What island commands are available?"
Claude: [Uses tab_complete("island ")]
Lists: upgrade, create, delete, invite, members...Configuration
Environment Variables
Variable | Required | Default | Description |
| Yes | - | Your player's API key |
| No |
| MasterControl API base URL |
API Endpoints
POST /api/v2/command/execute— Execute commandsPOST /api/v2/command/tabComplete— Get tab completions
Troubleshooting
"MIDNIGHT_API_KEY environment variable not set!"
Create a .env file:
echo "MIDNIGHT_API_KEY=your-key-here" > .env"Failed to execute command"
Check that:
MasterControl API is running
API key is correct
Player is online and on a server (not in proxy limbo)
Security
Never commit
.env— it contains your API key (already excluded via.gitignore)Commands execute with your player's permissions
The AI can run any command you can run in-game
Available Tools
2 toolsexecute_commandA
Execute a Minecraft command remotely as the authenticated player.
This tool allows you to run any Minecraft command as if the player associated with the API key typed it in-game. The player must be online and on a server. The player will be notified in-game that a remote command is being executed.
To get help for any command, simply append "help" as the last argument. For example: "island help", "island upgrade help", "gamemode help"
Args: command: The Minecraft command to execute (without the leading slash). Examples: "gamemode creative", "tp 100 64 200", "island upgrade speed 5"
Returns: The output from the command execution, or an error message if it failed.
Examples: - execute_command("help") - Shows general help - execute_command("island help") - Shows island command help - execute_command("island upgrade help") - Shows island upgrade help - execute_command("gamemode survival") - Changes gamemode
Inputs: command (required). Returns: result
tab_completeA
Get tab completion suggestions for a partial Minecraft command.
This tool provides autocomplete suggestions for commands, just like pressing Tab in the Minecraft client. Useful for discovering available commands, subcommands, and valid arguments.
Args: command_line: The partial command line to complete. Examples: "gamemode ", "island upgrade ", "give diamond"
Returns: A formatted list of completion suggestions, or a message if none are available.
Examples: - tab_complete("gamemode ") -> Lists: survival, creative, adventure, spectator - tab_complete("island ") -> Lists available island subcommands - tab_complete("give ") -> Lists available items
Inputs: command_line (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: execute_command runs commands, while tab_complete provides suggestions for command completion. There is no overlap or ambiguity between them, as one is for execution and the other is for discovery/assistance.
Both tools follow a consistent verb_noun naming pattern (execute_command and tab_complete). The naming is clear, predictable, and uses the same style throughout, making it easy to understand their functions at a glance.
With only 2 tools, the server feels thin for its purpose of Minecraft command execution. While the tools cover basic execution and completion, there are likely missing operations such as listing available commands, checking player status, or handling command history, which would enhance the server's utility and completeness.
The tool set is severely incomplete for the domain of Minecraft command execution. It lacks essential operations like listing all available commands, validating commands before execution, managing multiple players, or handling command feedback in a structured way. This forces agents to rely heavily on trial-and-error with execute_command and tab_complete, leading to potential inefficiencies and failures.
Maintenance
Related MCP Connectors
Use AI models for chat, image, and video generation from Claude Code and other MCP hosts.
Generate AI video, images and audio, and browse your history, from any MCP client.
All 20 YourAITools agent APIs in one MCP server. Most tools free; pay with credits or x402.
MCP server for OpenAI API (chat completions, image generation, embeddings) via AceDataCloud
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.16 npm1MIT
- 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.3-
- AlicenseAqualityDmaintenanceExposes Minecraft server commands via RCON as a tool, and optionally powers an in-game AI chat listener that answers player questions using Claude.2MIT