Cursor + Android Emulator MCP Setup: BlueStacks, LDPlayer, MuMu, MEmu

Set up a Cursor Android emulator MCP server in minutes: the .cursor/mcp.json entries, the API key, first prompts, and the hosted route to cloud devices.

Macro Automation Studio Team 9 min read Published September 4, 2026
Cursor + Android Emulator MCP Setup: BlueStacks, LDPlayer, MuMu, MEmu

Cursor can control an Android emulator as soon as an MCP server turns the device into tools its agent can call. This Cursor Android emulator MCP setup uses the local MCP server built into Macro Automation Studio for BlueStacks, LDPlayer, MuMu or MEmu, plus the hosted MAS server when you want cloud devices, saved macros and MAS Agent in the same chat. Both are a few lines in .cursor/mcp.json, and the whole thing takes about ten minutes.

What Cursor gets

The desktop app hosts the local server itself, and it lists 37 tools. The device and vision tools work from pixels rather than an accessibility tree, so they behave the same on a game as on a settings screen:

  • Devices: list_devices and screen_size, plus tap, swipe, long_press, drag, type_text, press_key and wait.
  • Seeing: screenshot, read_text (OCR lines with the box that was scanned), find_image (template matching that returns coordinates and a score), and get_ui_tree, find_element and wait_for when the screen has real widgets.
  • Apps: open_app, close_app, current_app.
  • Your library: list_macros, get_macro_code, run_macro, get_run_status, stop_run and get_run_log, plus the Image Library through list_images, get_image and crop_image.
  • Building: author_macro and its session calls, the scaffold_macro, install_macro and validate_macro loop, and schedule_macro with list_schedules and cancel_schedule.

Screenshots come back scaled to 1280 px on the long edge with the scale factor attached, so coordinates from read_text and find_image line up with tap without arithmetic on your side. The server listens on loopback and answers only your own machine.

Cursor Android emulator MCP setup: prerequisites

  • An Android emulator on your machine: BlueStacks, LDPlayer, MuMu, MEmu or any other adb-compatible emulator, on Windows or macOS.
  • The emulator’s ADB option switched on. The app drives whatever adb can see. The BlueStacks setup guide shows where the switch lives; the other three keep it in their settings under a similar name.
  • Macro Automation Studio, open and signed in. It brings its own adb, so there is nothing else to install; the download is free to try.
  • Cursor, any recent version with MCP support.

Step 1: switch the local server on

Open the app and go to Integrations (MCP). Turn the local server on; the page shows the URL it listens on, http://127.0.0.1:3846/mcp unless you changed the port. While you are there, check the device list. If your emulator is missing, its ADB setting is off or its port is not exposed, and you should fix that before touching Cursor.

Step 2: add the Android MCP server to .cursor/mcp.json

Cursor reads MCP servers from .cursor/mcp.json in the project root (that project only) or from ~/.cursor/mcp.json (every project). Create the file if it does not exist and add the local server by URL:

{
  "mcpServers": {
    "mas-local": {
      "url": "http://127.0.0.1:3846/mcp"
    }
  }
}

Save the file, then open Cursor Settings and find the MCP section. The mas-local entry should show as running with its 37 tools listed. If you run more than one emulator, say which one in the prompt: every device tool takes a device, the id list_devices returned (emulator-21513), an adb serial (127.0.0.1:21513) or the bare port. Leave it out and the server uses the single emulator that is running.

Step 3: first prompts in the agent panel

Open the agent panel, pick agent mode, and ask in plain English. Cursor asks before each tool call until you allow the server’s tools to run on their own.

  • “List my Android devices.” You should get the emulator back with its serial.
  • “Take a screenshot of the device and describe what is on screen.” Cursor receives the image and reads it.
  • “Read the text on screen.” OCR lines come back with coordinates.
  • “Find the Claim button and tap it.” Cursor calls find_image with a template, gets coordinates and a score, then tap.

Then give it a job that chains several tools: “Open the game, claim the daily reward, close any popup that appears, and tell me what the energy counter says.” Every step shows up as a tool call you can expand, and every screenshot is something you can inspect. For a test flow on your own app: “Log in with the test account and tell me whether the welcome screen appears.”

Cursor is driving the app through the screen, with no root, no APK changes and no memory reading. No automation tool is 100% risk-free, so automate responsibly and at your own discretion.

The hosted server: cloud devices, macros and MAS Agent

The local server stays on your machine and works on the emulators adb can see. The hosted MAS MCP server is one HTTPS endpoint with 40 tools, and it works on the always-on cloud Android devices in your account. Add it alongside the local entry:

{
  "mcpServers": {
    "mas-cloud": {
      "url": "https://api.automationmacro.com/mcp",
      "headers": {
        "X-API-Key": "<your key>"
      }
    }
  }
}

What it adds over the local 37:

  • lease_device opens a control session on a cloud device. With auto_start it boots a stopped device first. Leases renew on every call and expire after ten idle minutes, so a forgotten session does not hold the device.
  • run_macro executes a saved macro server-side on the leased device. It costs zero credits, and the device keeps running with your PC off.
  • author_macro hands a goal in plain English to MAS Agent. The agent explores the app on the cloud device, captures template images and OCR regions verified on-device, states a budget you confirm, then compiles a deterministic Python macro and validates it by replay before it lands in your library. This is the one tool on the list that spends credits.
  • get_map returns the screens and proven routes the agent learned about an app, so a second task starts from memory instead of from zero.

The only other hosted-only names are release_device, which ends the lease, and get_run, the cloud spelling of get_run_status. Everything else in the 40 is the same tool under the same name on both servers, with no per-call charge on the device tools. The MCP page lists each tool with its parameters. A cloud device is $80 a month and includes 20,000 AI credits every month; the pricing page has the full table.

How the key works

Create a key in the app under Integrations (MCP) or API Keys, tick the scopes you want, and paste it into the X-API-Key header in mcp.json. The key itself goes out on every request, so nothing expires after an hour and there is nothing to refresh; when you want it gone, revoke it in the app. Clients that implement the MCP client-credentials extension can trade the key for a one-hour token instead, and clients that sign in from their own UI skip the key altogether.

Keep the key out of version control. Put the hosted entry in ~/.cursor/mcp.json rather than the project file, or add .cursor/mcp.json to .gitignore if the project file is where it has to live.

Troubleshooting

  • The server shows an error in Cursor’s MCP settings. The app is closed, or the local server is switched off. Open Macro Automation Studio, check the toggle under Integrations (MCP), and confirm the port in your URL matches the one the page shows.
  • list_devices returns nothing. The emulator’s ADB option is off, or the emulator is not running. Check the device list in the app first; the server returns what the app sees.
  • Taps land in the wrong place. Two devices are connected and the server picked the other one, or the emulator’s resolution changed after a template was captured. Name the device in the prompt and recapture the template.
  • The screenshot is blank. Some emulators render to a second window. Make sure the game is in the foreground of the device you selected.
  • The hosted server answers 401. No key header reached the server, or the key is unknown, revoked or expired. Check the header name and value, or create a new key in the app.
  • Every step is slow. Each action waits on a model decision. For anything you will repeat, let author_macro compile it into a macro and call run_macro instead, at zero credits and with no model in the loop.

Frequently asked questions

Can Cursor control an Android emulator?

Yes. With the MAS local server in .cursor/mcp.json, Cursor’s agent gets screenshots, OCR, template matching and input on BlueStacks, LDPlayer, MuMu, MEmu or any adb-compatible emulator, and it drives the emulator from plain English prompts.

Where does the Android MCP config go in Cursor?

In .cursor/mcp.json at the project root for one project, or ~/.cursor/mcp.json for every project. Both take the same mcpServers shape: two url entries, the hosted one carrying your key in a header and the local one pointing at http://127.0.0.1:3846/mcp.

Does the local server send anything to the cloud?

It listens on loopback and answers only your own machine, and the device work happens over adb on your PC. The app that hosts it is signed in to your MAS account, which is what lets the macro, Image Library and authoring tools reach your library. Only the hosted server at api.automationmacro.com drives devices remotely, and it reaches only the cloud devices your account owns.

How do I authenticate the hosted server?

Create a key in the app under Integrations (MCP) or API Keys and send it in the X-API-Key header. It is shown once, carries the scopes you tick, and stays valid until you revoke it or its expiry date passes.

Does each tool call cost credits?

Device and vision tools have no per-call charge on either server, and run_macro costs zero credits. author_macro spends credits while MAS Agent explores and builds, against a budget you confirm first.

Does it work on a physical phone or with other AI clients?

Yes to both. Enable USB debugging, plug the phone in, and the server lists it like an emulator with nothing installed on the phone. The same two URLs work from Claude Code, Codex and Hermes. Claude Desktop launches commands instead of calling URLs, so it starts the app itself with a --mcp flag that bridges to the same local server; the Claude Code walkthrough covers that client.

Ready to automate it?

Download Macro Automation Studio, point it at your emulator, cloud device or phone, and let the agent build the first macro.