Skip to main content
Glama

๐ŸŒŸ What is MCP-MEmu?

MCP-MEmu is a Model Context Protocol (MCP) server that gives AI agents complete control over MEmu Android Emulator. It wraps the MEMUC CLI through PyMEMUC and exposes 69 tools, 8 resources, and 7 prompt templates for seamless AI-driven Android automation.

Connect it to Claude Desktop, Antigravity, Cursor, or any MCP-compatible client โ€” and your AI can boot VMs, install apps, automate UI, take screenshots, spoof GPS, transfer files, and much more.


Related MCP server: Android-MCP

โœจ Features

๐ŸŽฎ 69 Automation Tools

Category

Count

Highlights

๐Ÿ”„ Lifecycle

15

Create, clone, start, stop, reboot, delete, export/import VMs

โš™๏ธ Configuration

8

CPU, RAM, resolution, GPS, IMEI, device fingerprint randomization

๐Ÿ“ฑ App Management

7

Install APK, launch, stop, uninstall, clear data, list packages

๐Ÿ‘† UI Interaction

14

Tap, swipe, long press, text input, keys, scroll, rotate, zoom, shake

๐Ÿ“ธ Screenshot

3

Save to file, base64 for AI vision, get screen dimensions

๐ŸŒ Network & Sensors

6

Connect/disconnect, GPS spoofing, accelerometer, public IP

๐Ÿ’ป Shell & Advanced

8

Shell commands, ADB passthrough, file push/pull, clipboard

๐Ÿš€ Compound

8

Boot & ready, fresh start app, batch install, monkey test, snapshots

๐Ÿ“š 8 MCP Resources (LLM Context)

Resource

Description

memu://guide

Comprehensive getting started guide with anti-hallucination rules

memu://tools

Complete tool reference with all args and descriptions

memu://workflows

Step-by-step automation recipes

memu://config-keys

All VM configuration keys with valid values

memu://vms

Live VM list with status (dynamic)

memu://vm/{index}/status

Individual VM status (dynamic)

memu://security

Security model documentation

๐Ÿ’ก 7 Prompt Templates (Guided Workflows)

Prompt

Description

automate_app_testing

Full app testing workflow with screenshot-first rules

setup_new_vm

Create โ†’ configure โ†’ boot from scratch

ui_automation_guide

Screen coordinate system, swipe directions, input reference

batch_device_farm

Set up multiple VMs with diverse configs

debug_vm_issues

Diagnostic flowchart with error โ†’ fix mapping

gps_spoofing_guide

10 city presets with verification steps

file_transfer_guide

Push/pull files with VM path reference

๐Ÿ›ก๏ธ Security

  • Protected VM Registry โ€” Pre-existing VMs cannot be deleted/stopped/renamed

  • Input Validation โ€” VM index validation, dangerous command blocklist

  • Audit Logging โ€” All destructive operations logged with timestamps

  • Command Blocklist โ€” Blocks rm -rf /, mkfs, dd, reboot, shutdown, format, wipe


๐Ÿš€ Quick Start

Prerequisites

Requirement

Details

OS

Windows 10/11

MEmu Player

Download (installed & working)

Python

3.10 or higher

uv

Install โ€” Python package manager

Admin Privileges

Required by MEMUC CLI

Installation

# Clone the repository
git clone https://github.com/devbysatyam/mcp-memu.git
cd mcp-memu

# Install dependencies
uv sync

Run the Server

# Start the MCP server (stdio transport)
python server.py

# Or test with MCP Inspector (opens browser UI)
mcp dev server.py

Connect to Claude Desktop

Add to %APPDATA%\Claude\claude_desktop_config.json:

{
  "mcpServers": {
    "memu": {
      "command": "uv",
      "args": ["run", "--directory", "C:\\path\\to\\mcp-memu", "python", "server.py"]
    }
  }
}

Connect to Antigravity / Gemini

Add to your MCP server settings:

{
  "memu": {
    "command": "uv",
    "args": ["run", "--directory", "C:\\path\\to\\mcp-memu", "python", "server.py"]
  }
}

๐Ÿ“– Use Cases

1. ๐Ÿ“ฑ Automated App Testing

"Install my APK, launch it, go through the onboarding flow, and take screenshots at each step."

The AI agent will:

  1. Boot the VM and wait for Android to fully load

  2. Install your APK via install_apk

  3. Launch the app and take a screenshot to see the screen

  4. Navigate through UI using tap, swipe, input_text

  5. Capture screenshots at each step for visual verification

Tools used: boot_and_ready โ†’ install_apk โ†’ launch_app โ†’ screenshot_base64 โ†’ tap โ†’ input_text โ†’ take_screenshot

2. ๐ŸŒ GPS-Based Testing

"Set the location to San Francisco and check if the app shows nearby restaurants."

Tools used: set_gps_location(lat=37.7749, lng=-122.4194) โ†’ launch_app โ†’ screenshot_base64

3. ๐Ÿญ Device Farm Setup

"Create 3 VMs with different resolutions and device fingerprints for compatibility testing."

The AI agent will:

  1. Create 3 new Android 9 VMs

  2. Configure each with different CPU, RAM, resolution

  3. Randomize device fingerprints so each looks unique

  4. Boot all VMs and verify they're working

Tools used: create_vm (x3) โ†’ set_vm_cpu โ†’ set_vm_memory โ†’ set_vm_resolution โ†’ randomize_vm_device โ†’ boot_and_ready

4. ๐Ÿ”„ CI/CD Integration

"Run a monkey test on the app and capture the results."

Tools used: boot_and_ready โ†’ install_apk โ†’ run_monkey_test โ†’ take_screenshot โ†’ pull_file (logs)

5. ๐Ÿ“‹ Clipboard & File Transfer

"Push a config file to the VM, read back the app's output log."

Tools used: push_file โ†’ launch_app โ†’ pull_file โ†’ set_clipboard โ†’ get_clipboard

6. ๐Ÿ”ง VM Configuration Management

"Read current config, change to 4 CPU cores and 4GB RAM, then reboot."

Tools used: get_all_vm_config โ†’ stop_vm โ†’ set_vm_cpu(cores=4) โ†’ set_vm_memory(mb=4096) โ†’ boot_and_ready

๐Ÿ”ง Tool Reference

Lifecycle Management

Tool

Description

Key Args

list_vms

List all VMs with status

โ€”

get_vm_status

Check running/stopped

vm_index

start_vm

Boot a VM

vm_index

stop_vm

Graceful shutdown

vm_index

reboot_vm

Restart a VM

vm_index

create_vm

Create new VM

vm_version (76=Android 7, 96=Android 9)

delete_vm

Permanently delete

vm_index

clone_vm

Clone existing VM

vm_index, new_name

rename_vm

Rename a VM

vm_index, new_name

export_vm

Export to .ova

vm_index, output_path

import_vm

Import from .ova

ova_path

compress_vm

Compress disk

vm_index

sort_out_all_vms

Re-tile windows

โ€”

stop_all_vms

Stop all non-protected

โ€”

check_task_status

Async task status

task_id

Configuration

Tool

Description

Key Args

get_all_vm_config

Read all common settings

vm_index

get_vm_config

Read single setting

vm_index, key

set_vm_config

Write single setting

vm_index, key, value

set_vm_cpu

Set CPU cores

vm_index, cores (1/2/4/8)

set_vm_memory

Set RAM

vm_index, mb

set_vm_resolution

Set display

vm_index, width, height, dpi

set_vm_gps

Set GPS

vm_index, lat, lng

randomize_vm_device

Random fingerprint

vm_index

App Management

Tool

Description

Key Args

list_apps

Installed packages

vm_index

install_apk

Install APK file

vm_index, apk_path

uninstall_app

Remove app

vm_index, package

launch_app

Start app

vm_index, package

stop_app

Force stop

vm_index, package

clear_app_data

Wipe app data

vm_index, package

create_app_shortcut

Desktop shortcut

vm_index, package

UI Interaction

Tool

Description

Key Args

tap

Tap coordinates

vm_index, x, y

swipe

Swipe gesture

vm_index, x1, y1, x2, y2, duration_ms

long_press

Long press

vm_index, x, y, duration_ms

input_text

Type text

vm_index, text

send_key

Send key event

vm_index, key (home/back/menu/volumeup/volumedown)

press_enter

Enter key

vm_index

press_back

Back button

vm_index

press_home

Home button

vm_index

shake_device

Shake gesture

vm_index

rotate_screen

Toggle orientation

vm_index

zoom_in / zoom_out

Pinch zoom

vm_index

scroll_up / scroll_down

Scroll

vm_index, x

Screenshot & Capture

Tool

Description

Key Args

take_screenshot

Save to file

vm_index, save_path

screenshot_base64

Base64 PNG for AI vision

vm_index

get_screen_size

Current resolution

vm_index

Network & Sensors

Tool

Description

Key Args

connect_network

Enable internet

vm_index

disconnect_network

Disable internet

vm_index

get_public_ip

Get public IP

vm_index

set_gps_location

Spoof GPS

vm_index, lat, lng

set_accelerometer

Set sensor

vm_index, x, y, z

get_adb_connection_info

Get ADB address

vm_index

Shell & Advanced

Tool

Description

Key Args

execute_shell

Run shell command

vm_index, command

send_adb

Raw ADB command

vm_index, command

get_device_info

Model/version/CPU

vm_index

get_running_apps

Running processes

vm_index

pull_file

VM โ†’ Host

vm_index, remote_path, local_path

push_file

Host โ†’ VM

vm_index, local_path, remote_path

set_clipboard

Set clipboard

vm_index, text

get_clipboard

Read clipboard

vm_index

Compound (Multi-Step)

Tool

Description

wait_for_boot

Poll until Android is fully booted

boot_and_ready

Start VM + wait for boot

fresh_start_app

Stop โ†’ clear data โ†’ relaunch

install_and_launch

Install APK + launch

clone_and_configure

Clone + set CPU/RAM/resolution

batch_install

Install multiple APKs (;-separated)

full_vm_snapshot

Stop โ†’ export โ†’ restart

run_monkey_test

Random UI stress test


๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                   MCP Client                        โ”‚
โ”‚   (Claude Desktop / Antigravity / Cursor / etc.)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                        โ”‚ JSON-RPC (stdio)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                  MCP-MEmu Server                     โ”‚
โ”‚                   server.py                          โ”‚
โ”‚                                                      โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚  Tools   โ”‚  โ”‚Resources โ”‚  โ”‚    Prompts        โ”‚   โ”‚
โ”‚  โ”‚  (69)    โ”‚  โ”‚  (8)     โ”‚  โ”‚    (7 templates)  โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚       โ”‚                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚          Security Layer                        โ”‚   โ”‚
โ”‚  โ”‚  โ€ข Protected VM registry                      โ”‚   โ”‚
โ”‚  โ”‚  โ€ข Input validation & command blocklist        โ”‚   โ”‚
โ”‚  โ”‚  โ€ข Audit logging                              โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ”‚       โ”‚                                              โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”   โ”‚
โ”‚  โ”‚     PyMEMUC + ADB Helpers                     โ”‚   โ”‚
โ”‚  โ”‚  โ€ข MEMUC CLI wrapper                          โ”‚   โ”‚
โ”‚  โ”‚  โ€ข ADB pull/push with auto-reconnect          โ”‚   โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
        โ”‚
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚              MEmu Android Emulator                    โ”‚
โ”‚         (MEMUC CLI + ADB over TCP)                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ“ Project Structure

mcp-memu/
โ”œโ”€โ”€ assets/
โ”‚   โ””โ”€โ”€ banner.png             # GitHub banner image
โ”œโ”€โ”€ tools/
โ”‚   โ”œโ”€โ”€ lifecycle.py           # VM start, stop, create, delete, clone
โ”‚   โ”œโ”€โ”€ config.py              # CPU, RAM, resolution, GPS settings
โ”‚   โ”œโ”€โ”€ apps.py                # Install, launch, stop apps
โ”‚   โ”œโ”€โ”€ input.py               # Tap, swipe, type, scroll, shake
โ”‚   โ”œโ”€โ”€ capture.py             # Screenshots (file & base64)
โ”‚   โ”œโ”€โ”€ network.py             # Network, GPS, accelerometer
โ”‚   โ”œโ”€โ”€ shell.py               # Shell, ADB, file transfer, clipboard
โ”‚   โ””โ”€โ”€ compound.py            # High-level combined operations
โ”œโ”€โ”€ resources/
โ”‚   โ”œโ”€โ”€ vm_status.py           # MCP resources (guides, tools ref, config keys)
โ”‚   โ””โ”€โ”€ prompts.py             # MCP prompt templates (7 workflows)
โ”œโ”€โ”€ utils/
โ”‚   โ”œโ”€โ”€ memuc_instance.py      # Singleton PyMemuc + security layer
โ”‚   โ””โ”€โ”€ adb_helpers.py         # ADB pull/push with timeout & reconnect
โ”œโ”€โ”€ server.py                  # FastMCP entry point
โ”œโ”€โ”€ pyproject.toml             # Project metadata & dependencies
โ”œโ”€โ”€ protected_vms.json         # Auto-generated (gitignored)
โ”œโ”€โ”€ SECURITY.md                # Security documentation
โ”œโ”€โ”€ LICENSE                    # MIT License
โ””โ”€โ”€ README.md                 # This file

๐Ÿ“ฆ Dependencies

Package

Version

Purpose

pymemuc

โ‰ฅ 0.6.0

Python wrapper for MEmu's MEMUC CLI

mcp[cli]

โ‰ฅ 1.0.0

Model Context Protocol SDK + CLI tools

Pillow

โ‰ฅ 12.1.1

Image processing for screenshots

All dependencies are managed via pyproject.toml and installed automatically with uv sync.


๐Ÿ”’ Security

See SECURITY.md for full details.

Feature

Description

Protected VMs

Pre-existing VMs snapshotted on startup โ€” cannot be deleted/stopped

Input Validation

VM index validated, negative values rejected

Command Blocklist

rm -rf /, mkfs, dd, reboot, shutdown, format, wipe blocked

Audit Logging

All destructive ops logged with timestamps to stderr

Local-Only Transport

Uses stdio โ€” no network exposure by default

For remote deployments, implement OAuth 2.1 with PKCE per the MCP specification.


โš ๏ธ Known Limitations

Limitation

Details

Workaround

Clone requires disk space

Each clone needs 2-4GB

Free disk space before cloning

DirectX blank screenshots

MEmu's DirectX mode produces blank images

Set graphics_render_mode=0 (OpenGL)

ADB requires WiFi

ADB over TCP needs VM WiFi enabled

Call connect_network() first

Config needs stopped VM

CPU/RAM/resolution only changeable when stopped

stop_vm() before config changes

Windows only

MEmu is Windows-only software

No Linux/macOS support


๐Ÿค Contributing

  1. Fork the repository

  2. Create your feature branch (git checkout -b feature/amazing)

  3. Commit your changes (git commit -m 'Add amazing feature')

  4. Push to the branch (git push origin feature/amazing)

  5. Open a Pull Request


๐Ÿ“ License

This project is licensed under the MIT License โ€” see the LICENSE file for details.


๐Ÿ™ Acknowledgments


A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

โ€“Maintainers
โ€“Response time
โ€“Release cycle
โ€“Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

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/devbysatyam/mcp-memu'

If you have feedback or need assistance with the MCP directory API, please join our Discord server