levihead
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
LeviHead
LeviHead runs the real Minecraft Bedrock 1.26.66.1 headless on a hidden
virtual display and exposes it to an AI agent over MCP. It is not a clone,
not a web remake, and not a substitute engine. It launches the real APK /
libminecraftpe.so through LeviLauncher.
1920×1080 virtual display; the game runs at its native 58–63 fps.
60 fps raw preview in the Android monitor (no per-frame JPEG).
App-side screenshots that work while the game is in the background.
Exact-schema MCP tools, a skill file, an agent file, and a terminal TUI.
Real
.levipackbuild/install + crash-retry workflow.Root-aware: live logs, doctor, repair.
Install
git clone https://github.com/HakaI963/levihead.git ~/levihead
cd ~/levihead
./install.shor:
curl -fsSL https://raw.githubusercontent.com/HakaI963/levihead/main/install.sh | bashThe installer:
installs the
leviheadCLI wrapper (~/.local/bin/levihead),installs the
leviheadskill and agent context,registers the
leviheadMCP server with OpenCode,on a rooted Android chroot, installs the display APK and the LeviControl mod (and writes
mods_config.jsonwith only LeviControl enabled).
APK
dist/LeviHead-v1.1.apk is the Android display/input component. Install it on
the phone:
adb install -r dist/LeviHead-v1.1.apk
# or, on the device:
pm install -r /data/local/tmp/LeviHead-v1.1.apkThe APK is debug-signed for personal use. The Python/MCP app is the agent surface; the APK owns the hidden display and fast input path.
Related MCP server: minecraft-mcp-server
MCP setup
Generic client (~/.levihead/mcp.json is generated):
{
"mcpServers": {
"levihead": {
"command": "python3",
"args": ["/home/you/levihead/levihead/mcp_server.py"]
}
}
}OpenCode (~/.config/opencode/opencode.json):
{
"mcp": {
"servers": {
"levihead": {
"type": "local",
"command": ["python3", "/home/you/levihead/levihead/mcp_server.py"],
"enabled": true
}
}
}
}The MCP server is stdio JSON-RPC 2.0. It also exposes resources
levihead://commands and levihead://status.
What the agent can do
Start with levihead_status / levihead_doctor, then:
levihead_world_list
levihead_world_enter {"name":"My World","retries":3}
levihead_screenshot {"path":"/tmp/shot.jpg"}
levihead_give {"item":"minecraft:diamond","count":1}
levihead_tp {"x":0,"y":64,"z":0}
levihead_gamemode {"mode":"creative"}
levihead_time {"value":"day"}
levihead_weather {"value":"clear"}
levihead_attack
levihead_jump
levihead_look {"dx":120}
levihead_logs {"lines":80,"grep":"error"}
levihead_root {"command":"id"}
levihead_fixFull exact schemas are in the MCP tools/list response, SKILL.md, and
AGENTS.md. Do not use input keyevent, input tap, OCR, or
image-coordinate tapping for gameplay.
World entry
minecraft://connect/?localWorld=<name> is handled by Minecraft's own
LocalWorldConnectArgumentHandler. The reliable path is cold-start:
force-stop, launch the URI, and wait until the MinecraftActivity is top and
the HUD ticks. levihead_world_enter does that and retries on crash. Do not
start MinecraftActivity a second time — that triggers
BootstrapConfig::initialize() should only be called once.
Performance
The game options are set to render distance 8 and fast graphics on each world
load, to keep the 1080p view near 60 fps. The monitor receives raw 1920×1080
frames over a local socket; it is not JPEG/screencap. Screenshots come from the
app frame pipeline, not Android screencap.
Touch latency
The root engine keeps a shell-UID TouchInjector process alive and feeds it
MotionEvents over a pipe. The monitor sends touches through a background queue
to the engine's local control socket; the UI thread never spawns input or
blocks on a socket.
Mod workflow (.levipack)
levihead_mod_pack {"source":"/path/src","name":"MyMod","entry":"libmymod.so"}
levihead_mod_install {"path":"...levipack","force":true,"enable":false}
levihead_world_enter {"name":"My World","retries":3}If the game crashes or the retry loop fails:
levihead_logs {"lines":120,"grep":"FATAL|crash|LeviControl"}
levihead_mods_enforce {"only":["LeviControl"],"quarantine":true}
levihead_world_enter {"name":"My World","retries":3}Only LeviControl is auto-enabled. The installer and the app's config sync never turn every installed pack on.
Architecture
AI agent / MCP client
│ stdio MCP (30+ tools)
▼
levihead/mcp_server.py ── LauncherShell ── Android root bridge
│ (sudo chroot /proc/1/root)
├── TUI (curses + live frame)
├── root display engine 127.0.0.1:27402
│ └── VirtualDisplay 1920x1080 + raw levihead.video
└── native LeviControl mod 127.0.0.1:27404
└── exact RVA hooks in libminecraftpe 1.26.66.1Key paths:
levihead/mcp_server.py— MCP server (tools/resources).levihead/launcher.py— device, worlds, mods, fix, world retry.levihead/tui.py— non-blocking curses live view.android/src/...— root display engine, monitor, shell-UID touch injector.controlmod/— LeviControl exact-RVA native mod source +.levipack.dist/LeviHead-v1.1.apk— signed Android display APK.SKILL.md,AGENTS.md,agents/levihead.md— agent instructions.
Verified
Real game: 1920×1080, 58–63 fps (options: render distance 8, fast graphics).
Monitor: raw 1920×1080 stream, observed 60 fps.
World enter: cold-start URI, top activity
MinecraftActivity, HUD ticks.Touch: shell-UID MotionEvent injection; a swipe changes the game frame.
Screenshot: app-frame capture with no
screencap.MCP: initialize, tools/list, status, doctor, logs, root, frame.
Mods: only LeviControl enabled; others quarantined.
Limitations
Native LocalPlayer capture (
lp) is still being mapped, solevihead_movereturns an explicit error and native inventory open depends on the HUD/LocalPlayer state.attack,jump,look,give,tp,gamemode,time,weatherare verified.place/pickare experimental.The APK is debug-signed; use your own key for distribution.
The root bridge assumes KernelSU/root,
/proc/1/root,sudo -n, and the LeviLauncher package paths. Adjustlevihead/device.pyfor other setups.MCP is local stdio; do not expose it to a network.
Security
This is a root-level controller. It can run device commands, install APKs, and modify Minecraft worlds. Run it only on a device you own, keep the MCP server local, and review agent actions.
License
MIT. See LICENSE.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Make games with AI: one MCP server that connects your agent to Unity, Unreal and Godot editors.
Remote MCP server to control your Android phone from AI assistants with per-app permissions.
Free MCP server for AI agents: Python/JS sandbox, file-to-markdown, speech-to-text.
Generate game-ready 3D models, textures, and audio from natural language, over MCP.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to control Minecraft via MCP with configurable versions, creative building commands, survival helpers, and an autonomous agent loop.Apache 2.0
- AlicenseAqualityCmaintenanceEnables 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.38551MIT
- FlicenseNot gradedqualityCmaintenanceEnables LLMs to control a Minecraft bot and interact with the game through MCP tools, including observing state, moving, mining, crafting, building, farming, managing inventory, enchanting, and chatting in-game.1-
- AlicenseBqualityCmaintenanceEnables AI agents to operate a Minecraft Java Edition player through MCP, supporting movement, mining, crafting, combat, inventory, and chat with structured observations and action results.18MIT